The volume of the cyllinder is:
V = A base*height
We'll write the volume of the cylinder as a function of x.
The area of the base of the cyllinder is:
A = pi*r^2
We'll determine r using proportions:
R/H = r/(12-x)
R = 4, H = 12, h is the height of the cylinder and r is the radius of the cylinder.
4/12 = r/(12-x)
1/3 = r/(12-x)
We'll cross multiply and we'll get:
3r = 12 - x
r = (12-x)/3
The volume of the cylinder is:
V(x) = pi*x*(12-x)^2/9
V(x) = (pi/9)*(144x - 24x^2 + x^3)
The volume is maximum for the critical value of x that cancels the first derivative of V(x).
We'll determine V'(x):
V'(x) = (pi/9)*(144 - 48x + 3x^2)
V'(x) = 0
144 - 48x + 3x^2 = 0
We'll divide by 3:
x^2 - 16x + 48 = 0
We'll apply quadratic formula:
x1 = [16+sqrt(256 - 192)]/2
x1 = (16+8)/2
x1 = 12 cm
x2 = (16-8)/2
x2 = 4 cm
For x = 12 cm, the volume of the cylinder is maximum.