Text this: An optimal control problem in economics