V = π * r2 * h, and r + h = 12
You have 2 independent variables, so use both equations to develop a formula for V. It seems best to use substitution for h, to keep the equation relatively simple....So:
r + h = 12
rearrange to get: h = 12 - r
Substitute in the 1st equation to get:
V = π * r2 * (12 - r)
V = 12πr2 - πr3
To find a maximum (or minimum), the typical method is to find the 1st derivative and set it equal to zero.
V' = 24πr - 3πr2
Set equal to 0 and solve for r:
24πr - 3πr2 = 0
8r - r2 = 0
r = 0, 8 (Interpretation: 0 gives you the minimum volume, and 8 gives you the maximum)
CHECK this by plugging into the original formula and then trying values on either side.