# Old Derivative Problem solved with partial derivatives

Sometimes I get my best understanding when I work older problems with new techniques. So, I wanted to work the old derivative problem of minimizing the surface area of a cylindrical can to hold 1 liter of oil. We solved this in single variable calculus by getting the surface area equation to have only one variable and then taking the derivative and setting it =0. Worked perfectly.

Now, I thought, well, since I know partial derivatives, I'm thinking I don't need to get that Surface area equation to have just one variable. I can leave it as:

$$A= 2\pi rh+ 2 \pi r^2$$

Shouldn't I just be able to find the partial derivative with respect to h and a separate partial derivative with respect to r, set them both =0 and solve to get the critical values.

hmmmmm...when I do this, I get something weird.

(a) $$\frac {\partial A}{\partial r} = 2\pi h + 4\pi r$$

(b) $$\frac {\partial A}{\partial h} = 2\pi r$$

Setting $(a) =0$ I get $2\pi h=-4\pi r$ or $h = -2 r$

HUH? This doesn't make sense. My height is a negative number!

Why doesn't this old calculus problem work using partials?

• Have you done legrange multipliers? That's how you do optimization in multiple variables – Teh Rod Nov 21 '16 at 3:16
• Remember that you have a constraint! – MattG88 Nov 21 '16 at 3:18
• yikes....have NOT done Legrange multipliers. – user163862 Nov 21 '16 at 3:23
• Yes, was thinking about the constraint of the oil having a volume of some number, say 1 liter. I still don't see how that could fix the height = a neg #. – user163862 Nov 21 '16 at 3:24
• You can't "fix" the negative height. That simply tells you that $\frac{\partial A}{\partial \,r}$ has no zeros for positive heights. Which, in fact, boils down to the observation that the area of a cylinder with given (positive) height is strictly increasing with its radius. – dxiv Nov 21 '16 at 3:44

Here is one way we generalize optimization with multiple variables given a constraint. We start with the following: Surface Area $= 2\pi rh+2\pi r^2$, Volume $= \pi r^2h = 1$

We will now apply the method of Lagrange Multipliers. If you haven't covered this already in your class the Wikipedia link should suffice.

Note that we wish to maximize $f(x)=2\pi rh$ subject to the constraint $g(x) = \pi r^2h-1=0$
We will now construct a function $\mathcal{L}(r,h,\lambda)=f(x)-\lambda g(x)=2\pi rh+2\pi r^2-\lambda(\pi r^2h-1)$ and we will calculate the total gradient

First comes the work finding the partial derivatives

\begin{align} &\frac{\partial \mathcal{L}}{\partial r} =\; -2 \pi (h (\lambda r-1)-2 r)\\ &\frac{\partial \mathcal{L}}{\partial h} =\; \pi r (2-\lambda r)\\ &\frac{\partial \mathcal{L}}{\partial \lambda} =\; h \pi r^2-1 \end{align} We now find when the gradient is zero, which occurs when each of the above partial derivatives is zero. $$\nabla_{r,h,\lambda}\mathcal{L}(r,h,\lambda)=0 \iff \begin{cases} -2 \pi (h (\lambda r-1)-2 r) & = 0 \\ \pi r (2-\lambda r) & = 0 \\ h \pi r^2-1 & = 0 \end{cases}$$ We now simplify this a bit, assume the height and radius are non-zero $$\begin{cases} h (\lambda r-1)-2 r & = 0 \\ 2-\lambda r & = 0 \\ h \pi r^2-1 & = 0 \end{cases}$$ From the second equation we get that $\lambda r=2$; substituting this into the first equation gives $$\begin{cases} h-2 r & = 0 \\ h \pi r^2-1 & = 0 \end{cases}$$ This yields the solution $$(r,h) = \left((2\pi)^{-1/3},(4/\pi)^{1/3}\right)$$ This yields a surface area of $3\sqrt[3]{2 \pi}$
Note that this is just so much easier to do the Calculus 1 way. Just note that the condition implies that $$h=\frac{1}{\pi r^2}\implies \text{Surface Area} = \frac{2}{r} + 2\pi r^2$$ Solving this gives the same radius as above, which can be plugged in to the simpler surface area formula to get the answer quickly.

• Wow, this is quite enlightening. What is interesting is that the optimization problem in my text is for a rectangular "box" without lid and the problem asked for the dimensions to maximize volume given a surface area of 12 square ft. This problem is relatively easily done with partial derivatives and no mention of Lagrange multipliers.....so I thought it might be easy to work my old calculus 1 problem using partials. It's interesting that this problem needs Lagrange multipliers and the rectangular box didn't. However, in that problem we were maximizing volume with a given surface area. – user163862 Nov 22 '16 at 18:39
• @user163862 I'm curious how you solved the box problem you mention. If you wouldn't mind sharing I would like to see it! By the way, note that Lagrangian multipliers really are just an extension of the one dimensional case of setting the derivative equal to zero and solving... Problem here is that we have to use a gradient to get all the partial derivatives at once, and we include a factor $\lambda$ to make the equations work out. – Brevan Ellefsen Nov 22 '16 at 20:19