You can graph the function and choose the maximum point to use. This is also less work, please.
You are building moving boxes from big pieces of cardboard. The cardboard sheet is 30 cm x 50 cm. To build the box, you cut squares from the corners. What dimensions would maximize the volume?