The surface area of a cylinder, without the ends, is `LA=2pirh`
Since the cylinder is a right circular cylinder, we can draw a right triangle. Select a point on one of the ends. Draw a diameter from this point. From the point draw a segment perpendicular to the diameter to the other end of the cylinder.
The right triangle will have sides 2r,h, and 8. (2r since it is a diameter of the circle; h is the height of the cylinder; 8 because connecting the other end of the diameter to the far point is a diamter of the sphere.)
Then by the Pythagorean theorem we have `(2r)^2+h^2=8^2` or `h=sqrt(64-4r^2)`
Rewriting our formula for the lateral area we get:
To maximize, we take the first derivative to find the critical points.
For a fraction to be zero, we need the numerator to be zero when the denominator is nonzero.
Then the lateral area (the surface area not including the ends) is :