First thing to realize is that the sphere and the cylinder have the same center and the top edge of the cylinder touches the inner surface of the sphere (at some level, depending on the shape of the cylinder.)
They only tell you the radius of the sphere, "r", but you need to express the formulas for the CYLINDER in terms of "r"
Say "y" is the radius of the cylinder, and "h" is the height of the cylinder:
Surface area of Cylinder = top + bottom + wrap around part
The surface area of the wrap-around part is the circumference of the top or bottom times the height.
Surface area =pi*y^2 + pi*y^2 + 2*pi*y*h
= 2pi * (y^2 + yh)
Volume of Cylinder = area of bottom or top times height
= pi* y^2 * h
If you can get one of the variables, "y" or "h", in terms of "r" the radius of the sphere, then you can maximize surface area and volume.
Imagine going up the cylinder halfway up the height "h", to the center of both sphere and cylinder. Draw a line from that center to the edge of the cylinder, where the sphere and cylinder touch. This is the radius of the sphere. But, it also forms a right triangle with half the height of the cylinder and the raidus of the cylinder. Draw it and check it out, it works. So, the circle's radius forms the hypotenuse of this triangle, the cylinder's radius and half it's height form the legs.
In a right triangle, (leg1)^2 + (leg2)^2 = (hypotenuse)^2
OR
(h/2)^2 + (y)^2 = r^2
(h^2) / 4 + (y)^2 = (r)^2
h^2 + 4y^2 = 4r^2
h^2 = 4r^2 - 4y^2
h = 2*sqrt(r^2 - y^2)
Go back to the cylinder equations now:
SA(cylinder) = 2pi * (y^2 + y*h)
V(cylinder) = pi* y^2 * h
And rewrite them with the value for "h"
SA(cylinder) = 2pi * (y^2 + y*2*sqrt(r^2 - y^2))
V(cylinder) = pi* y^2 * 2*sqrt(r^2 - y^2)
You now have one-variable equations (r is assumed constant).
Take derivatives to maximize the V and SA and set equal to zero:
V' = 4pi* y *sqrt(r^2 - y^2) + 2pi*y^2 *(-2y)*(1/2)(r^2 - y^2)^(-1/2) = 0
Multply through by sqrt(r^2 - y^2)
4pi* y *(r^2 - y^2) + 2pi*y^2 *(-2y)*(1/2) = 0
4pi*r^2 *y - 4pi*y^3 - 2pi*y^3 = 0
2r^2 - 2y^2 - y^2 = 0
3y^2 = 2r^2
y^2 = (2/3)(r^2)
y = (sqrt(2/3))*r
y = r * sqrt(6)/3
Since
h = 2*sqrt(r^2 - y^2) -----> h = 2*sqrt(r^2 - (r * sqrt(6)/3)^2 )
h = 2*sqrt(r^2 - (r^2 * (2/3) )
h = 2*sqrt( (1/3)*r^2)
h = r * (2*sqrt(3)/3)
Now solve for volume and surface area:
V(cylinder) = pi* y^2 * h
=pi * (r * sqrt(6)/3)^2 * r * (2*sqrt(3)/3)
=pi * r^3 * (2/3) * (2/3) * (sqrt(3))
(r^3)*(4pi*sqrt(3) / 9)
SA(cylinder) = 2pi * (y^2 + y*h)
=2pi * ( [ (r * sqrt(6)/3)^2] + [r * sqrt(6)/3) * r * (2*sqrt(3)/3) ] )
=2pi * [(2/3)*r^2] + [sqrt(18)/9 * r^2]
=2pi * [(2/3)*r^2] + [3sqrt(2)/9 * r^2]
=2pi * [(2/3)*r^2] + [sqrt(2)/3 * r^2]
(r^2) * [4pi + 2pi*sqrt(2)] / 3