Maximum-area cylinder inscribed in a sphere (source code)

= Maximum-area cylinder inscribed in a sphere
{title2=$h/r=\sqrt5-1,\quad A_{\max}=\pi R^2(1+\sqrt5)$}

For a closed right <circular cylinder> with radius $r>0$, height $h>0$, and total <surface area> $A=2\pi r(r+h)$, inscription in a <sphere> of radius $R$ gives $r^2+h^2/4=R^2$. The <Lagrange multiplier> equations imply $h^2+2rh-4r^2=0$, so the positive aspect ratio is $h/r=\sqrt5-1$. The dimensions are $r^2=R^2(5+\sqrt5)/10$ and $h^2=2R^2(5-\sqrt5)/5$.

There is also an <eigenvalue> proof of global maximality. Set $w=h/2$, so the <constraint> is $r^2+w^2=R^2$, and write $A/(2\pi)=r^2+2rw$. This <quadratic form> has <symmetric matrix> $\begin{pmatrix}1&1\\1&0\end{pmatrix}$ with largest <eigenvalue> $(1+\sqrt5)/2$, the <golden ratio>. Its maximizing <eigenvector> lies in the positive quadrant, yielding the displayed area and aspect ratio.