Solution (source code)

= Solution

Let $c>0$ denote the stated unit cost of cylindrical wall, and assume $V>0$. The <circular cylinder> and <hemisphere> give the volume constraint and total cost
$$
V=\pi r^2h+\frac23\pi r^3,\qquad C=2\pi crh+4\pi cr^2.
$$
Only the walls and cap have specified costs, so no separate base cost is included. Eliminating $h$ gives
$$
h=\frac{V}{\pi r^2}-\frac23r,\qquad
C(r)=\frac{2cV}{r}+\frac83\pi cr^2,
$$
with $0<r\le(3V/(2\pi))^{1/3}$ from $h\ge0$. Now $C'(r)=-2cV/r^2+(16/3)\pi cr$ vanishes at $r^3=3V/(8\pi)$. Moreover $C''(r)=4cV/r^3+(16/3)\pi c>0$ and the stationary point is feasible, so it is the unique global minimum. The optimal dimensions are
$$
\boxed{r=\left(\frac{3V}{8\pi}\right)^{1/3},\qquad h=2r.}
$$