find the maximum volume of a cylinder whose height and radius do not exceed a combined total of 12cm

I think we can safely assume that the max volume occurs when h+r is in fact 12, and not less. So, h = 12-r

v = πr^2 h = πr^2(12-r)
dv/dr = 3πr(8-r)
So, max v occurs at r=8
v(8) = π*8^2(4) = 256π

I think you can easily show that if h < 12-r, max v will occur when r<8.