Let denote the stated cost per area of the cylindrical wall. Charge for the curved wall and cap as specified; no floor cost is supplied. The volume and cost are and . To minimize cost at fixed volume, apply a Lagrange multiplier to . Differentiation with respect to gives . The derivative then gives , reducing to . Thus the optimal cylinder and hemispherical cap with unequal surface costs has
For a global check, eliminate to obtain . Its second derivative is positive for , and its critical radius gives , so the constrained optimum lies inside the physically feasible range and is the unique minimum.