This is a constained optimisation problem. With these the optimum is either

a calculus type maximum (or minimum) inside the feasible region (in this case

[0,500]), or a point on the boundary of the feasible region.

So here you have no calculus type maximum in the feasible region, the maximum will be on the boundary.

RonL