Let r be the radius of the base and h be the height of the cylinder ABCD which is inscribed in a sphere of radius a. It is obvious that for maximum volume the axis of the cylinder must be along the diameter of the sphere. Let O be the centre of the sphere such that OL=x. Then, CA2=OL2+AL2 ⇒AL=a2−x2
Let V be the volume of the cylinder. Then, V=π(AL)2×LM ⇒V=π(AL)2×2(OL) ⇒V=2π(a2−x2)×2x ⇒V=2π(a2x−x3) ⇒dxdV=2π(a2−3x3)
and dx2d2V=−12πx
For maximum or minimum, we must have dxdV=0 ⇒2π(a2−3x3)=0 ⇒x=3a [neglectingx=3−a∵dx2d2V∣∣x=3−a>0]
Clearly, (dx2d2V)x=a/3=−12π×3a<0 ∴V is maximum when x=3a
Hence, height of the cylinder LM=2x=32a.