Math basics › More calculus
Optimization
Two equations, then one
Write what you are maximising, and write the constraint. Use the constraint to eliminate a variable so the thing you are optimising has only one.
Then it is just critical points
Differentiate, set to zero, solve. The hard part was getting to one variable, not the calculus.
Check the ends
A maximum can sit at the edge of the allowed range rather than at a critical point. Check what the domain actually is — a length cannot be negative.