You can put this solution on YOUR website!
We know that, from the constraint, h = 30 - r. Hence, the volume V is
If we suppose V is a function of r, we can take the derivative of V with respect to r:
The derivative is zero when r = 0 or r = 20. Clearly, r = 0 would imply V = 0. It can be checked that r = 20, h = 10 maximizes the volume, which is