Optimization Problem / Fuel Tank I am asked to design a fuel tank for a fighter jet that will hold $300$ liters of jet fuel. The shape of the tank is a cylinder with two hemispheres attached to each end. The side wall (the cylinder part) costs $\$\ 0.1$ per cm$^2$ to make and the rounded tops costs $\$\ 0.3$ per cm$^2$ to make. What is the optimal radius of the tube that will minimize manufacturing costs?
 A: Well, the volume of that shape is given by:
$$\mathcal{V}=\mathcal{V}_\text{cylinder}+\mathcal{V}_\text{hemisphere}+\mathcal{V}_\text{hemisphere}=\mathcal{V}_\text{cylinder}+\mathcal{V}_\text{sphere}\tag1$$
Now, for the volume of a cylinder:
$$\mathcal{V}_\text{cylinder}=\pi\cdot\text{r}_\text{cylinder}^2\cdot\text{h}\space_\text{cylinder}\tag2$$
And for the sphere:
$$\mathcal{V}_\text{sphere}=\frac{4}{3}\cdot\pi\cdot\text{r}_\text{sphere}^3\tag3$$
Now, we also know that:
$$\text{r}=\text{r}_\text{cylinder}=\text{r}_\text{sphere}\tag4$$
So the total volume is given by:
$$\mathcal{V}=\pi\cdot\text{r}^2\cdot\text{h}\space_\text{cylinder}+\frac{4}{3}\cdot\pi\cdot\text{r}^3=\frac{\pi\text{r}^2}{3}\cdot\left(3\text{h}\space_\text{cylinder}+4\text{r}\right)\tag5$$
And the surface area is given by:
$$\mathcal{S}=2\cdot\pi\cdot\text{r}\cdot\text{h}\space_\text{cylinder}+4\cdot\pi\cdot\text{r}^2\tag6$$
And for the costs we can set up a function:
$$\mathcal{K}=\text{K}_1\cdot2\cdot\pi\cdot\text{r}\cdot\text{h}\space_\text{cylinder}+\text{K}_2\cdot4\cdot\pi\cdot\text{r}^2\tag7$$
Well, you know the volume:
$$\mathcal{V}=\frac{\pi\text{r}^2}{3}\cdot\left(3\text{h}\space_\text{cylinder}+4\text{r}\right)\space\Longleftrightarrow\space\text{h}\space_\text{cylinder}=\frac{\mathcal{V}}{\pi\text{r}^2}-\frac{4\text{r}}{3}\tag8$$
So, in order to minimize the costs we can write:
$$\frac{\partial\mathcal{K}}{\partial\text{r}}=\frac{\partial}{\partial\text{r}}\left\{\text{K}_1\cdot2\cdot\pi\cdot\text{r}\cdot\left(\frac{\mathcal{V}}{\pi\text{r}^2}-\frac{4\text{r}}{3}\right)+\text{K}_2\cdot4\cdot\pi\cdot\text{r}^2\right\}=$$
$$8\text{K}_2\pi\text{r}-\frac{16\text{K}_1\pi\text{r}}{3}-\frac{2\text{K}_1\mathcal{V}}{\text{r}^2}=0\space\Longrightarrow\space\text{r}=\left(\frac{1}{4}\cdot\frac{\text{K}_1\mathcal{V}}{\pi\text{K}_2-\frac{2\pi\text{K}_1}{3}}\right)^\frac{1}{3}\tag9$$
And so the height will be:
$$\text{h}\space_\text{cylinder}=2\cdot\left(\frac{6}{\pi}\right)^\frac{1}{3}\left(\frac{\text{K}_2}{\text{K}_1}-1\right)\cdot\left(\frac{\text{K}_1\mathcal{V}}{3\text{K}_2-2\text{K}_1}\right)^\frac{1}{3}\tag{10}$$

Here I assumed that $\text{K}_2>\text{K}_1$.

A: Let the radius be $r$ and the height $h$. Let the surface area of each hemisphere be $S_{h}$ and the surface area of the cylinder be $S_{c}$ and let the total surface area be $S$
$S_{c} = 2\pi r h$
$S_{h} = 2\pi r^{2}$
Then $S = 2\pi r(2r+h)$
Let the volume of each hemisphere be $V_{h}$ and the volume of the cylinder be $V_{c}$. Let the total volume be $V$
$V_{c} = \pi r^{2}h$
$V_{h} = \frac{2}{3}\pi r^{3}$
$V = \pi r^{2}(h + \frac{4r}{3})$
We wish to maximise the volume for a given surface area (so we treat the surface area as constant). 
Now you should also apply the price weightings to each component of the surface area, then substitute $h$ in terms of $S$ and $r$ into $V$. Then you can differentiate $V$ with respect to $r$ to find the value of $r$ which gives the maximum value of $V$
A: I too would be brief  about solution ... (if you care to learn Lagrange multiplier more powerful approach) with 2 functions $ (V,A) $  and two variables $ (r,h)$  ; k= Ratio of costs Cyl/ Hemisphere
$$  S=2πr(k2r+h),\, V=πr^2(k h+4r^3) $$
$$ \frac{S_r}{S_h} =\frac{V_r}{V_h} \rightarrow k =2r/h $$
