## The Jacobian

The following image is Image 16.57 from your text, but I’ve modified it slightly. The idea is that we’re starting off in the situation on the left, with a function given in terms of $x$ and $y$ and a region $R$ awkwardly written (in this case a parallelogram) in the Cartesian plane. When we perform our change of variables, we are now integrating over a region $T$ in the variables $s$ and $t$. The key thing to notice is that $T$ is a rectangle, and we like integrating over rectangles.

For instance, this is the situation when we take a double integral in the Cartesian plane with $x$ and $y$ and convert it to a double integral in polar coordinates. Notice that an integral such as
$\int_{0}^{2\pi}\int_0^1 r\,dr\,d\theta$
calculates the area of a circle, by integrating over the rectangle where $0\le r\le 1$ and $0\le\theta\le 2\pi$. The extra $r$ in the integrand tells us that area increases linearly as $r$ increases from left to right inside this rectangle. So, looking at $T$ in the figure above, a small rectangle at the left side of $T$ is worth less in terms of area than the same sized rectangle at the right side of $T$.

In a general situation, we’d like to calculate our integral in the variables $s$ and $t$ given by the region $T$. But, we need to know how area in $x$ and $y$ relates to area in $s$ and $t$. In polar coordinates, the area in $R$ is given by taking the area in $T$ and multiplying it by $r$ (and so the area becomes more valuable as we move from left to right in $T$). In the general situation, we must calculate this translation factor, which is known as a Jacobian.

We view $x$ as a function $x=x(s,t)$ of $s$ and $t$. For instance, if $s=r$ and $t=\theta$, then $x=r\cos\theta$. Likewise, we view $y$ as a function $y(s,t)$. Given the diagram above, we have

\begin{align*} \vec{a} &= \left(x(s+\Delta s,t)-x(s,t)\right)\vec{i}+\left(y(s+\Delta s,t)-y(s,t)\right)\vec{j}\\ \vec{b} &= \left(x(s,t+\Delta t)-x(s,t)\right)\vec{i}+\left(y(s,t+\Delta t)-y(s,t)\right)\vec{j}.\\ \end{align*}

Notice that each component of $\vec{a}$ and $\vec{b}$ almost looks like a derivative. In fact, if we placed a $\Delta s$ or $\Delta t$ in the denominator, we’d have a difference quotient. So, we’ll multiply $\vec{a}$ by $\Delta s/\Delta s$ and multiply $\vec{b}$ by $\Delta t/\Delta t$, giving

$\vec{a}=\frac{\partial x}{\partial s}\Delta s\vec{i}+\frac{\partial y}{\partial s}\Delta s\vec{j} \qquad\text{and}\qquad \vec{b}=\frac{\partial x}{\partial t}\Delta t\vec{i}+\frac{\partial y}{\partial t}\Delta t\vec{j}.$

The whole reason why we’re doing this is to make the calculation of $\vec{a}\times\vec{b}$ easier to compute, since the cross product represents the area of the parallelogram between the two vectors. (We know the area in $T$ with respect to $s$ and $t$, and we want to know the corresponding area in $R$ with respect to $x$ and $y$.) We now compute the cross product. Actually, there are some technicalities here.

1. We only compute the magnitude of the cross product, which represents the area of the parallelogram. Recall that the cross product (which is only defined for 3-dimensional vectors) is a 3-dimensional vector. We’re only interested in the magnitude of the cross product, not its direction.

2. We could use the geometric interpretation $|\vec{a}\times\vec{b}|=|\vec{a}|\cdot|\vec{b}|\sin\theta$, if we knew the angle $\theta$ between $\vec{a}$ and $\vec{b}$. Usually, we don’t know $\theta$. So, we use the algebraic interpretation of the cross product:

$\vec{a}\times\vec{b}=\left| \begin{array}{ccc} \vec{i} & \vec{j} & \vec{k}\\ a_1 & a_2 & a_3\\ b_1 & b_2 & b_3 \end{array} \right|$

where we’re taking the determinant of the matrix and $a_3=b_3=0$ (since $\vec{a}$ and $\vec{b}$) are vectors in the $xy$-plane with no $z$-component).

OK, now we calculate the magnitude of the cross product.

\begin{align*} |\vec{a}\times\vec{b}| &= \left|\left| \begin{array}{ccc} \vec{i} & \vec{j} & \vec{k}\\ & & \\ \displaystyle\frac{\partial x}{\partial s}\Delta s &\displaystyle \frac{\partial y}{\partial s}\Delta s & 0\\ & & \\ \displaystyle\frac{\partial x}{\partial t}\Delta t & \displaystyle\frac{\partial y}{\partial t}\Delta t & 0 \end{array} \right|\right|\\ &= \left|\frac{\partial x}{\partial s}\Delta s\frac{\partial y}{\partial t}\Delta t-\frac{\partial x}{\partial t}\Delta t\frac{\partial y}{\partial s}\Delta s\right|\\ &=\Delta s\Delta t\left|\frac{\partial x}{\partial s}\frac{\partial y}{\partial t}-\frac{\partial x}{\partial t}\frac{\partial y}{\partial s}\right| \end{align*}

The idea here is that $\Delta s\Delta t$ represents area in a rectangle in variables $s$ and $t$, while the partials computation that follows represents the translation factor for area in $x$ and $y$. Unfortunately, this formula is hard to memorize. With that in mind, we note that

$|\vec{a}\times\vec{b}| = \left|\left| \begin{array}{ccc} \vec{i} & \vec{j} & \vec{k}\\ & & \\ \displaystyle\frac{\partial x}{\partial s}\Delta s &\displaystyle \frac{\partial y}{\partial s}\Delta s & 0\\ & & \\ \displaystyle\frac{\partial x}{\partial t}\Delta t & \displaystyle\frac{\partial y}{\partial t}\Delta t & 0 \end{array}\right|\right| = \left|\left| \begin{array}{ccc} \vec{i} & \vec{j} & \vec{k}\\ & & \\ \displaystyle\frac{\partial x}{\partial s}\Delta s & \displaystyle\frac{\partial x}{\partial t}\Delta t & 0\\ & & \\ \displaystyle \frac{\partial y}{\partial s}\Delta s & \displaystyle\frac{\partial y}{\partial t}\Delta t & 0 \end{array}\right|\right| = \left|\left| \begin{array}{cc} \displaystyle\frac{\partial x}{\partial s} & \displaystyle\frac{\partial x}{\partial t}\\ & \\ \displaystyle \frac{\partial y}{\partial s} & \displaystyle\frac{\partial y}{\partial t} \end{array} \right|\right|\Delta s\Delta t.$

Thus, we define the Jacobian using this slightly easier to remember formula:

$\frac{\partial(x,y)}{\partial(s,t)}=\left|\left|\begin{array}{cc} \displaystyle\frac{\partial x}{\partial s} & \displaystyle\frac{\partial x}{\partial t}\\ & \\ \displaystyle \frac{\partial y}{\partial s} & \displaystyle\frac{\partial y}{\partial t} \end{array} \right|\right|\,ds\,dt$

## Algorithm for 2-Dimensional Change of Variables

To change the variables of a double integral $\displaystyle\int\int_R f(x,y)\,dx\,dy$ from the $xy$-plane to the $st$-plane:

1. Write the function $f(x,y)$ as a function in $s$ and $t$.

2. Write the bounds of integration in terms of $s$ and $t$.

3. Calculate the Jacobian and use it to replace $dx\,dy$ as

$dx\,dy = \frac{\partial(x,y)}{\partial(s,t)}= \left|\left|\begin{array}{cc} \displaystyle\frac{\partial x}{\partial s} & \displaystyle\frac{\partial x}{\partial t}\\ & \\ \displaystyle \frac{\partial y}{\partial s} & \displaystyle\frac{\partial y}{\partial t} \end{array} \right|\right|\,ds\,dt$

## Polar Coordinates

Problem: Calculate the area of a circle of radius 1 centered at the origin.

Solution: We wish to calculate

$\int_{-1}^1\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}1\,dy\,dx.$

Step (1), changing the function $f(x,y)=1$ to be in terms of $r$ and $\theta$ is trivial. We still have 1 instead the integral. Step (2) is where we change the limits of integration to $0\le \theta\le 2\pi$ and $0\le r\le 1$. Step (3) is where we calculate

$dx\,dy = \frac{\partial(x,y)}{\partial(r,\theta)}= \left|\left|\begin{array}{cc} \cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta \end{array} \right|\right|\,dr\,d\theta= (r\cos^2\theta +r\sin^2\theta)\,dr\,d\theta= r\,dr\,d\theta$

Putting this together, we have

$\int_0^{2\pi}\int_0^1 1r\,dr\,d\theta=\pi.$

## Area of an Ellipse

This is an example taken from our text, with some more details added. Find the area of the ellipse

$\frac{x^2}{a^2}+\frac{y^2}{b^2}\le 1.$

Solution: I would approach this a different way than your text does. First, I’m only interested in finding the area in one quadrant, since the area of the entire ellipse is four times that. Solving for $y$ and looking at the first quadrant gives us

$4\int_0^a\int_0^{\sqrt{b^2-\frac{b^2x^2}{a^2}}} 1\,dy\,dx.$

That integral doesn’t look fun. Let’s use a change of variables to squash the ellipse into a circle. We’ll use the variables $s$ and $t$ and write our original variables $x$ and $y$ in terms

$x=as\qquad\text{and}\qquad y=bt.$

Then, we are looking at finding the area of

$s^2+t^2\le 1$

in the $st$-plane. The function we’re integrating is 1, and so step (1) of the algorithm is already complete for us. Step (2) involves changing the limits of integration. Again, we’re only going to consider one quadrant, and multiply the result by 2. The Jacobian turns out to be $ab\,ds\,dt$. All of this together gives us

$4\int_0^1\int_0^{\sqrt{1-t^2}}ab\,ds\,dt=4ab\int_0^1\int_0^{\sqrt{1-t^2}}1\,ds\,dt.$

Converting this again to polar coordinates (and going through all 3 steps) gives us

$4ab\int_0^1\int_0^{\sqrt{1-t^2}}1\,ds\,dt=4ab\int_0^{\pi/2}\int_0^1r\,dr\,d\theta.$

Calculating this yields

$4ab\int_0^{\pi/2}\int_0^1r\,dr\,d\theta=4ab\int_0^{\pi/2}\,d\theta\int_0^1r\,dr=4ab\frac{\pi}{2}\frac{1}{2}=\pi ab.$

## Integration by Parts Notes

This is designed to be a fairly complete review of integration by parts using some examples. For the basics, see your text. These examples are more designed to show you how integration by parts is actually done.

A printable version is here: spring2012math2400_examples_7.2 (pdf)

## Classic Examples

Example 1. $\displaystyle \int xe^x\,dx$

Solution: We select $u$ and $v’$ and then $u’$ and $v$ follow.
\begin{align*} u &= x & v'&=e^x\\ u'&= 1 & v &=e^x \end{align*}

\begin{align*} \int xe^x\,dx&=xe^x-\int e^x\,dx\\ &=xe^x-e^x+C \end{align*}

Example 2. $\displaystyle \int x\sin x\,dx$

Solutions:
\begin{align*} u &= x & v'&= \sin x\\ u' &= 1 & v &= -\cos x \end{align*}

\begin{align*} \int x\sin x\,dx &= -x\cos x+\int \cos x\,dx\\ &= -x\cos x+\sin x+ C \end{align*}

## Integration By Parts Multiple Times

Example 3. $\displaystyle \int x^2\sin x\,dx$

Solution: What happens here is that the first application of integration by parts results in another integral that is best approached by using integration by parts.
\begin{align*} u_1&=x^2 & v_1'&=\sin x\\ u_1'&=2x & v_1&=-\cos x \end{align*}
\begin{align*} \int x^2\sin x\,dx &= x^2\cos x+\int 2x\cos x\,dx\\ &=x^2\cos x+2\int x\cos x\,dx \end{align*}
\begin{align*} u_2&=x & v_2'&=\cos x\\ u_2'&=1 & v_2&=\sin x \end{align*}
\begin{align*} &=x^2\cos x+2\left(x\sin x-\int \sin x\,dx\right)\\ &=x^2\cos x+2x\sin x+2\cos x+C \end{align*}

Example 4. $\displaystyle \int x^2 e^x\,dx$

Solution: Again, we use integration by parts twice. The subscripts on the variables below tell us during which application of integration by parts those variables were used.
\begin{align*} u_1&=x^2 & v_1'&=e^x\\ u_1'&=2x & v_1&=e^x\\ u_2&=2x & v_2'&=e^x\\ u_2'&=2 & v_2&=e^x \end{align*}
\begin{align*} \int x^2e^x\,dx &= x^2e^x-\int 2xe^x\,dx\\ &=x^2e^x-\left(2xe^x-\int 2e^x\,dx\right)\\ &= x^2e^x-2xe^x-2e^x+C. \end{align*}

## Definite Integral Examples

Example 5. $\displaystyle \int_1^5\ln x\,dx$

This is also a good example of how you can sometimes use integration by parts with one of the functions being trivial (i.e., $v’=1$).

Solution: When we use integration by parts, we simply keep in mind that we’re evaluating the original integral from 1 to 5. That means that we must evaluate BOTH terms (the $x\ln x$ and the integral) given by integration by parts. Also, it helps to remember here that $\ln 1=0$.
\begin{align*} u&= \ln x & v'&=1\\ u'&=\frac{1}{x} & v&=x \end{align*}
\begin{align*} \int_1^5\ln x\,dx &= x\ln x\Big\vert_1^5-\int_1^5\,dx\\ &=5\ln 5-\ln 1-4\\ &=5\ln 5-4 \end{align*}

## More Complicated Examples

Example 6. $\displaystyle \int \cos^2(3\alpha+1)\,d\alpha$

Solutions: We need to use integration by parts, plus a trig identity, plus substitution in order to compute this integral.
\begin{align*} u&=\cos(3\alpha+1) & v'&=\cos(3\alpha+1)\\ u'&=-3\sin(3\alpha+1) & v&=\frac{1}{3}\sin(3\alpha+1) \end{align*}
\begin{align*} &\int\cos^2(3\alpha+1)\,d\alpha =\int\cos(3\alpha+1)\cos(3\alpha+1)\,d\alpha\\ &=\frac{1}{3}\cos(3\alpha+1)\sin(3\alpha+1)+\int\sin^2(3\alpha+1)\,d\alpha \end{align*}
By using the trig identity $\cos 2\alpha = 1-2\sin^2\alpha$ and solving for $\sin^2\alpha$ we can write the above as
{\small\begin{align*} &=\frac{1}{3}\cos(3\alpha+1)\sin(3\alpha+1)+\int\frac{1}{2}-\frac{1}{2}\cos(6\alpha+2)\,d\alpha \end{align*}}
Using the substitution $w=6\alpha+2$ (and so $dw=6\,d\alpha$) this then becomes
{\small\begin{align*} &=\frac{1}{3}\cos(3\alpha+1)\sin(3\alpha+1)+\frac{1}{4}x^2-\frac{1}{12}\int\cos w\,dw\\ &=\frac{1}{3}\cos(3\alpha+1)\sin(3\alpha+1)+\frac{1}{4}x^2-\frac{1}{12}\sin w+C\\ &=\frac{1}{3}\cos(3\alpha+1)\sin(3\alpha+1)+\frac{1}{4}x^2-\frac{1}{12}\sin(6\alpha+2)+C \end{align*}}

## Recursive Examples

Example 7. $\displaystyle \int e^x\sin x\,dx$

Solution: In this case, neither $e^x$ or $\sin x$ will become simpler when differentiated, and so at the start it doesn’t seem like integration by parts can help. But, something interesting happens.
\begin{align*} u_1&=e^x & v_1'&=\sin x\\ u_1'&=e^x & v_1&=-\cos x\\ u_2&=e^x & v_2'&=\cos x\\ u_2'&=e^x & v_2&=\sin x \end{align*}
\begin{align*} \int e^x\sin x\,dx &= -e^x\cos x+\int e^x\cos x\,dx\\ &=-e^x\cos x+e^x\sin x-\int e^x\sin x\,dx \end{align*}
The main thing to notice here is that the integral we are trying to find is on both sides of the equation, and since the right hand side version is negative, we add it to both sides. We get
\begin{align*} 2\int e^x\sin x\,dx &= -e^x\cos x+e^x\sin x \end{align*}
and dividing both sides by 2 gives
$\int e^x\sin x\,dx =\frac{1}{2}\left(-e^x\cos x+e^x\sin x\right)+C.$

Example 8. $\displaystyle \int \cos^2\theta\,d\theta$

Solution: There are two ways to consider this problem. One is to use the identity
$\cos^2\theta=\frac{1+\cos 2\theta}{2}$
and substitution. The other is to use the Pythagorean identity
$\cos^2\theta = 1-\sin^2\theta$
and integration by parts. The latter is done here.
\begin{align*} u&=\cos\theta & v'&=\cos\theta\\ u'&=-\sin\theta & v&=\sin\theta \end{align*}
\begin{align*} \int\cos^2\theta\,d\theta &= \cos\theta\sin\theta +\int\sin^2\theta\,d\theta\\ &=\cos\theta\sin\theta+\int 1-\cos^2\theta\,d\theta\\ &=\cos\theta\sin\theta+\int 1\,d\theta-\int\cos^2\theta\,d\theta \end{align*}
Adding the integral of $\cos^2\theta$ to both sides gives
\begin{align*} 2\int\cos^2\theta\,d\theta &=\cos\theta\sin\theta+\int 1\,d\theta\\ 2\int\cos^2\theta\,d\theta &=\cos\theta\sin\theta+\theta+C\\ \int\cos^2\theta\,d\theta &=\frac{1}{2}\left(\cos\theta\sin\theta+\theta\right)+C. \end{align*}

## Reduction Formula Example

Example 9. Prove the formula
$\int\sin^n\,dx=-\frac{1}{n}\cos x\sin^{n-1}x+\frac{n-1}{n}\int \sin^{n-2}x\,dx$

Solution: The main idea is to start with one function as $\sin^{n-1}x$ and the other as $\sin x$. Proceed as follows.
\begin{align*} u&=\sin^{n-1}x & v'&=\sin x\\ u'&= (n-1)\sin^{n-2}x\cos x & v&=-\cos x. \end{align*}
\begin{align*} &\ \ \int\sin^nx\,dx\\ &= -\cos x\sin^{n-1}x +\int(n-1)\sin^{n-2}x\cos x\cos x\,dx\\ &= -\cos x\sin^{n-1}x+\int(n-1)\sin^{n-2}x\cos^2 x\,dx\\ &= -\cos x\sin^{n-1}x+\int(n-1)\sin^{n-2}x(1-\sin^2 x)\,dx\\ &= -\cos x\sin^{n-1}x+(n-1)\int \sin^{n-2}x-\sin^nx\,dx\\ &= -\cos x\sin^{n-1}x+(n-1)\int\sin^{n-2}x\,dx-(n-1)\int\sin^{n}x\,dx \end{align*}
Now move the $(n-1)\int\sin^nx\,dx$ to the left side.
\begin{align*} \int\sin^nx\,dx+(n-1)\int\sin^nx\,dx &=-\cos x\sin^{n-1}x+(n-1)\int\sin^{n-2}x\,dx\\ n\int\sin^nx\,dx &=-\cos x\sin^{n-1}x+(n-1)\int\sin^{n-2}x\,dx\\ \int\sin^nx\,dx &=-\frac{1}{n}\cos x\sin^{n-1}x+\frac{n-1}{n}\int\sin^{n-2}x\,dx \end{align*}

## Spring Undergraduate Lecture

At 6PM on Thursday, March 15, Edward Burger will be speaking in MATH100. More information is available here.

## WebWork 15.3 #7

The problem is something like the following: The maximum value of $f(x,y)$ subject to the constraint $g(x,y)=250$ is 6000. The method of Lagrange multipliers gives $\lambda=35$. Find an approximate value for the maximum of $f(x,y)$ subject to the constraint $g(x,y)=252$.

Hint: The main idea here is that the functions satisfy the relation $\nabla f=35\nabla g$ at the maximum point where $g(x,y)=250$ and, very importantly, this implies that the gradients are parallel. Hence, if one increases $g$ by 2, one will increase $f$ by some very easy to calculate value. How fast is $f$ increasing compared to $g$??

## Main Idea

Given a function $f$ in multiple variables, we want to maximize $f$ under a constraint $g=c$. We view $g=c$ as a level surface for the function $g$. For example, we could maximize or minimize the function $f(x,y)=2x+3y$ under the constraint $g(x,y)=x^2+y^2=2$. As I showed in class, we’re looking for points $(x,y)$ such that the contours of $f$ are parallel with the contour of $g(x,y)=x^2+y^2=10$. At these points, $\nabla f=\lambda\nabla g$ for some constant $\lambda$. (You can also insist alternatively on $\nabla f=-\lambda\nabla g$, since $\lambda$ is a constant real number.)

The $\lambda$ constant is called a Lagrange multiplier. We can generalize this situation by creating the Lagrangian function, defined as
$\Lambda(x,y,\lambda)=f+\lambda(g-c)$
where $c$ is the level curve given for $g$. Now, taking the gradient of $\Lambda$ and setting each component to zero allows us to find the points where the contours of $f$ are parallel to the contour $g=c$.

## Example 1

Problem: Find the maximum and minimum points of $f(x,y)=x+y$ relative to the constraint $g(x,y)=x^2+y^2=1$. (That is, find the maximum and minimum values of the function $f$ that lie above the unit circle.)

Solution 1: The Lagrangian in this situation (with the minus sign, as in your text) is
$\Lambda(x,y,\lambda)=f(x,y)-\lambda(g(x,y)-c)=x+y-\lambda(x^2+y^2-1).$
The gradient of the Lagrangian is then
$\nabla\Lambda = \left[1-2\lambda x,1-2\lambda y,-x^2-y^2-1 \right].$
Setting the first two components to zero implies $1-2\lambda x=1-2\lambda y=0$. Notice that the function $f(x,y)$ has no critical points (it is a plane), and so we never have to worry about the gradient being zero. Thus, we never have to worry about $\lambda$ being zero. Thus, we know that if $\nabla\Lambda=\vec{0}$ then $x=y$. We know from $x^2+y^2=1$ then that $2x^2=1$ and hence $x=\pm\frac{\sqrt{2}}{2}$. We now know that the points to consider are
$\left(-\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right) \qquad\text{and}\qquad\left(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right).$
Of course, knowing what the plane $z=f(x,y)=x+y$ looks like, we know that the first of these is the minimum and the latter is the maximum. (If we have more points to check, or if the structure of the surface $f$ isn’t obvious, then we simply plug in all of the points under consideration to $f$, keeping track of which one is a minimum and which is a maximum.)

Solution 2: One can do this without the Lagrangian. If we consider simply the gradient of $f$ and the gradient of $g$, setting the gradients parallel with a Lagrange multiplier as a constant gives
$1=\lambda 2x\qquad\text{and}\qquad 1=\lambda 2y.$
Again, this implies $x=y$ and then we solve the problem as in Solution 1.

## Example 2

Problem: Find the maximum and minimum points of $f(x,y)=x^2y+3y^2-y$ under the constraint $g(x,y)=x^2+y^2\le 10$.

Solution: Here’s an example of where the constraint may not actually matter. We’ll consider two problems:

1. Maximize/minimize $f$ with respect to $x^2+y^2< 10$.
2. Maximize/minimize $f$ with respect to $x^2+y^2=10$.

The first of these is a standard optimization problem where we simply verify that each pair of critical points under consideration satisfies $x^2+y^2<10$. The second problem is a Lagrange multiplier problem.

In terms of the first problem, we find the critical points of $f$:
$f_x=2xy=0\qquad f_y=x^2+6y-1=0.$
From the first equation, we get either $x=0$ or $y=0$. If $x=0$, from the second equation we get $6y-1=0$ and so $y=1/6$. If instead we have $y=0$ then the second equation tells us that $x=\pm 1$. We conclude that the critical points are
$(0,1/6),\ (1,0),\ \text{and}\ (-1,0).$
Notice that all of these critical points satisfy the constraint $x^2+y^2\le 10$. We keep these points in mind and start on the second problem.

The Lagrange conditions $\nabla f=\lambda\nabla g$ tell us that
$2xy=\lambda 2x\qquad\text{and}\qquad x^2+6y-1=\lambda 2y.$
From the first equation, when $x\neq 0$, we divide by $x$ and get $\lambda=x$. Substituting into the second equation, we then have
$x^2+6y-1=2y^2.$
Then using $x^2=10-y^2$ from the constraint, we get
$10-y^2+6y-1=2y^2.$
This implies that $3y^2-6y-9=0$. Factoring gives $3(y-3)(y+1)=0$. From the constraint, we get $x=\pm 1$ when $y=3$ and $x\pm 3$ when $y=-1$. If instead we have $x=0$ (where we cannot divide by $x$ in the first Lagrange equation), then from the constraint we know that $y=\pm\sqrt{10}$.

Thus, we collect all of our points that are of interest (those found previously and those found in the Lagrange multiplier version) and we have all of the following points to consider:

$(1,0),\ (-1,0),\ (0,1/6),\ (\pm 1,3),\ (\pm 3,-1),\ (0,\pm\sqrt{10}).$
The maximum value is found to be at $(0,-\sqrt{10})$ and the minimum is at $(3,-1)$ and $(-3,-1)$.

## Example 3

Problem: Consider a closed cylindrical container holding 100 cubic centimeters. Provide a relationship between the radius and height which will minimize the surface area for such a container.

Solution: The surface are is given by $S(r,h)=2\pi r^2+2\pi rh$. The constraint on this surface area equation is provided by the volume function and level surface $g(r,h)=\pi r^2h=100$. What is really sort of cool here is that we don’t need to consider the 100 component at all. Taking gradients, we find that
$\nabla S=\langle 4\pi r+2\pi h,2\pi r\rangle=\lambda\nabla g=\lambda\langle 2\pi rh,\pi r^2\rangle.$
Solving for $\lambda$ gives $\lambda=2/r$. This then implies that $4\pi r+2\pi h=4\pi h$, and we find from here that $2r=h$. That is, there is a critical point with respect to our constraint when we make the radius twice the height. How do we know that this is a minimum? You could view that in several ways. It makes sense geometrically from the definition of the surface area function. If you’re not yet convinced, you could use the second derivative test.

## Minimizing Distance

There is a problem on WebWork that a few of you are asking about. Problem 18 in the Section 15.1 & 15.2 assignment asks the following: What is the shortest distance from the surface $xy+3x+z^2=12$ to the origin?

Solution: When you’re dealing with a distance problem, you’re tempted to minimize something that looks like

$f(x,y,z)=\sqrt{x^2+y^2+z^2}.$

I’d caution against doing that, since you might as well minimize $f(x,y,z)=x^2+y^2+z^2$ instead (it’s a LOT easier). We’ll set $S=x^2+y^2+z^2$ and we’ll take the given function and solve for $z$ as best as possible, getting $z^2=12-xy-3x$. Putting these two pieces together, we end up with

$S=x^2+y^2+12-xy-3x.$

This is a polynomial function, so we know that the critical points will only occur where the gradient is zero. So, we have

$\nabla S=\langle 2x-y-3,2y-x\rangle =\vec{0}.$

This implies that $x=2y$, and it follows that $(2,1)$ is the only critical point. Now, we use the second derivative test, where

$D=S_{xx}(2,1)S_{yy}(2,1)-(S_{xy}(2,1))^2=3>0$

and so we know that we’re at a local minimum. Moreover, looking at $S$ as $x\to\pm\infty$ and $y\to\pm\infty$, we have $S$ going to positive infinity in all directions. Thus, we know that we have found the global minimum of our distance function.

## Review and Assignment

A review for midterm 2 is here

There is no homework assigned for this week.