Setting up an optimization problem

To optimize, write the quantity as a function of one variable using the problem's constraint, and find the interval that variable is allowed to take.

From AP Calculus BC.