Mathematics for Information Science 1. Module 3, three-variable chain rule to directional derivatives.

GAMAT101 · 14 pages · Your place is saved in this browser

Contents · Where each topic sits
Text size18

Page 1 of 14

Module 3 at a glance

In Module 2 you learnt how to differentiate functions of two variables. In Module 3 we use those derivatives, and also extend them to three variables.

  1. The chain rule in three variables. The same tree-diagram idea, now with three branches, and also with unknown functions.
  2. Maxima and minima. Use partial derivatives to find the highest and lowest values of a function: first the local tops and bottoms, and then the absolute highest and lowest values on a closed region.
  3. The gradient. One vector that has all the partial derivatives and points uphill.
  4. Directional derivatives. The rate of change in any direction, not just along the axes, and the direction of steepest rise.

What you will be able to do

  • Apply the chain rule to w=f(x,y,z)w=f(x,y,z) when x,y,zx,y,z depend on one or several parameters.
  • Prove identities for u=f(x−y, y−z, z−x)u=f(x-y,\,y-z,\,z-x) without knowing ff.
  • Find critical points and classify them as local maxima, local minima or saddle points.
  • Solve optimisation problems, such as smallest surface area and lowest cost.
  • Find the absolute maximum and minimum of a function on a closed region.
  • Find ∇f\nabla f at a point for two or three variables.
  • Find the rate of change of ff in any direction, and find the direction of fastest increase.

How to use these notes

  • Every topic has the same shape: idea → rule → worked example → common mistakes.
  • Try each worked example yourself first. Cover the answer, solve it, and then compare.
  • Green boxes hold key ideas. Amber boxes marked Watch out show the mistakes that make you lose marks.
  • The last page has practice questions with answers, and then a one-page formula sheet for revision.

Where each topic sits

PartTopics
Chain ruleThree variables, several parameters, unknown functions
Local extremaCritical points, the second-derivative test, saddle points, optimisation
Absolute extremaClosed regions: interior points, edges and corners
DirectionGradient, directional derivative, steepest ascent and descent

Before you start. You should know Module 2: partial derivatives, second-order and mixed partials, and the two-variable chain rule. For the last three pages you should also be comfortable with adding vectors and finding dot products. The basics are revised where they are first used.

Page 2 of 14

The chain rule for three variables

The idea

In Module 2, a function z=f(x,y)z=f(x,y) had two paths down to its parameter. With w=f(x,y,z)w=f(x,y,z) there are three middle variables, so there are three paths. The rule is the same tree rule that you already know: multiply along each path, and add the paths.

Chain rule (one parameter). If w=f(x,y,z)w=f(x,y,z) and x=x(t)x=x(t), y=y(t)y=y(t), z=z(t)z=z(t), then

dwdt=∂w∂xdxdt+∂w∂ydydt+∂w∂zdzdt\frac{dw}{dt}=\frac{\partial w}{\partial x}\frac{dx}{dt}+\frac{\partial w}{\partial y}\frac{dy}{dt}+\frac{\partial w}{\partial z}\frac{dz}{dt}

graph TD w --> x w --> y w --> z x --> t y --> t z --> t

For each path from ww down to tt, take the product of the derivatives along it: ∂w∂xdxdt\dfrac{\partial w}{\partial x}\dfrac{dx}{dt}, ∂w∂ydydt\dfrac{\partial w}{\partial y}\dfrac{dy}{dt}, ∂w∂zdzdt\dfrac{\partial w}{\partial z}\dfrac{dz}{dt}. Add the three paths.

Method

  1. Find the three partial derivatives ∂w∂x\dfrac{\partial w}{\partial x}, ∂w∂y\dfrac{\partial w}{\partial y}, ∂w∂z\dfrac{\partial w}{\partial z}.
  2. Find the three ordinary derivatives dxdt\dfrac{dx}{dt}, dydt\dfrac{dy}{dt}, dzdt\dfrac{dz}{dt}.
  3. Multiply in pairs and then add.
  4. Finally, put x(t),y(t),z(t)x(t),y(t),z(t), or the given value of tt.

Examples

Example 1. Let w=x2y+yz3w=x^2y+yz^3 with x=t2x=t^2, y=ety=e^t, z=sin⁡tz=\sin t. Find dwdt\dfrac{dw}{dt}.

∂w∂x=2xy∂w∂y=x2+z3∂w∂z=3yz2dxdt=2tdydt=etdzdt=cos⁡t\frac{\partial w}{\partial x}=2xy\quad\frac{\partial w}{\partial y}=x^2+z^3\quad\frac{\partial w}{\partial z}=3yz^2 \qquad \frac{dx}{dt}=2t\quad\frac{dy}{dt}=e^t\quad\frac{dz}{dt}=\cos t dwdt=2xy⋅2t+(x2+z3) et+3yz2cos⁡t\frac{dw}{dt}=2xy\cdot2t+(x^2+z^3)\,e^t+3yz^2\cos t

Put x=t2x=t^2, y=ety=e^t, z=sin⁡tz=\sin t:

dwdt=4t3et+(t4+sin⁡3t)et+3etsin⁡2tcos⁡t\frac{dw}{dt}=\mathbf{4t^3e^t+\left(t^4+\sin^3t\right)e^t+3e^t\sin^2t\cos t}

Example 2. Let w=x2+y2+z2w=\sqrt{x^2+y^2+z^2} with x=cos⁡θx=\cos\theta, y=sin⁡θy=\sin\theta, z=tan⁡θz=\tan\theta. Find dwdθ\dfrac{dw}{d\theta} at θ=π4\theta=\dfrac\pi4.

Let ρ=x2+y2+z2\rho=\sqrt{x^2+y^2+z^2}. Then ∂w∂x=xρ\dfrac{\partial w}{\partial x}=\dfrac x\rho, and similarly for yy and zz. The parameter derivatives are −sin⁡θ-\sin\theta, cos⁡θ\cos\theta, sec⁡2θ\sec^2\theta.

dwdθ=x(−sin⁡θ)+ycos⁡θ+zsec⁡2θρ\frac{dw}{d\theta}=\frac{x(-\sin\theta)+y\cos\theta+z\sec^2\theta}{\rho}

Now x(−sin⁡θ)+ycos⁡θ=−cos⁡θsin⁡θ+sin⁡θcos⁡θ=0x(-\sin\theta)+y\cos\theta=-\cos\theta\sin\theta+\sin\theta\cos\theta=0, and ρ=1+tan⁡2θ=sec⁡θ\rho=\sqrt{1+\tan^2\theta}=\sec\theta. So

dwdθ=tan⁡θsec⁡2θsec⁡θ=tan⁡θsec⁡θ\frac{dw}{d\theta}=\frac{\tan\theta\sec^2\theta}{\sec\theta}=\tan\theta\sec\theta

At θ=π/4\theta=\pi/4 this is 1⋅2=21\cdot\sqrt2=\mathbf{\sqrt2}.

Check. Substituting first, w=1+tan⁡2θ=sec⁡θw=\sqrt{1+\tan^2\theta}=\sec\theta, so dwdθ=sec⁡θtan⁡θ\dfrac{dw}{d\theta}=\sec\theta\tan\theta. ✓\checkmark

Example 3. If u=x2+y2+z2u=x^2+y^2+z^2 with x=etcos⁡tx=e^t\cos t, y=etsin⁡ty=e^t\sin t, z=etz=e^t, show that dudt=4e2t\dfrac{du}{dt}=4e^{2t} using the chain rule, and verify by substituting first.

dxdt=et(cos⁡t−sin⁡t)dydt=et(cos⁡t+sin⁡t)dzdt=et\frac{dx}{dt}=e^t(\cos t-\sin t)\quad\frac{dy}{dt}=e^t(\cos t+\sin t)\quad\frac{dz}{dt}=e^t dudt=2x⋅et(cos⁡t−sin⁡t)+2y⋅et(cos⁡t+sin⁡t)+2z⋅et=2e2tcos⁡t(cos⁡t−sin⁡t)+2e2tsin⁡t(cos⁡t+sin⁡t)+2e2t=2e2tcos⁡2t−2e2tsin⁡tcos⁡t+2e2tsin⁡tcos⁡t+2e2tsin⁡2t+2e2t=2e2t(cos⁡2t+sin⁡2t)+2e2t=4e2t\begin{aligned} \frac{du}{dt}&=2x\cdot e^t(\cos t-\sin t)+2y\cdot e^t(\cos t+\sin t)+2z\cdot e^t\\ &=2e^{2t}\cos t(\cos t-\sin t)+2e^{2t}\sin t(\cos t+\sin t)+2e^{2t}\\ &=2e^{2t}\cos^2t-2e^{2t}\sin t\cos t+2e^{2t}\sin t\cos t+2e^{2t}\sin^2t+2e^{2t}\\ &=2e^{2t}(\cos^2t+\sin^2t)+2e^{2t}=\mathbf{4e^{2t}} \end{aligned}

Verification. Substituting first, u=e2tcos⁡2t+e2tsin⁡2t+e2t=2e2tu=e^{2t}\cos^2t+e^{2t}\sin^2t+e^{2t}=2e^{2t}, so dudt=4e2t\dfrac{du}{dt}=4e^{2t}. ✓\checkmark

Watch out. The last step of every example is to put the values back. If you leave xx, yy, zz in the answer when the question asks for a function of tt (or a value at t=3t=3), you will lose marks. Also, a quick check by substituting first, as in Examples 2 and 3, helps you find mistakes.

Page 3 of 14

The chain rule with several parameters

The idea

If w=f(x,y,z)w=f(x,y,z) and each of x,y,zx,y,z depends on several parameters, say uu, vv and mm, then ww has a partial derivative with respect to each parameter.

Chain rule (several parameters). For x=x(u,v,m)x=x(u,v,m), y=y(u,v,m)y=y(u,v,m), z=z(u,v,m)z=z(u,v,m):

∂w∂u=∂w∂x∂x∂u+∂w∂y∂y∂u+∂w∂z∂z∂u\frac{\partial w}{\partial u}=\frac{\partial w}{\partial x}\frac{\partial x}{\partial u}+\frac{\partial w}{\partial y}\frac{\partial y}{\partial u}+\frac{\partial w}{\partial z}\frac{\partial z}{\partial u}

and the same with vv, and with mm, in place of uu.

For each parameter: take the three paths from ww down to that parameter, multiply along each path, and add.

Method

  1. Compute the three outer partials ∂w∂x,∂w∂y,∂w∂z\dfrac{\partial w}{\partial x},\dfrac{\partial w}{\partial y},\dfrac{\partial w}{\partial z}.
  2. Make a table of the middle derivatives: each of x,y,zx,y,z against each parameter. That gives nine entries for three parameters.
  3. For each parameter, multiply and add down its column, like a dot product.
  4. At the end, write x,y,zx,y,z in terms of the parameters.

Example: spherical coordinates

Example 1. Let w=4x2+4y2+z2w=4x^2+4y^2+z^2 with

x=ρsin⁡ϕcos⁡θy=ρsin⁡ϕsin⁡θz=ρcos⁡ϕx=\rho\sin\phi\cos\theta\qquad y=\rho\sin\phi\sin\theta\qquad z=\rho\cos\phi

Find ∂w∂ρ\dfrac{\partial w}{\partial\rho}, ∂w∂ϕ\dfrac{\partial w}{\partial\phi} and ∂w∂θ\dfrac{\partial w}{\partial\theta}.

The outer partials are ∂w∂x=8x\dfrac{\partial w}{\partial x}=8x, ∂w∂y=8y\dfrac{\partial w}{\partial y}=8y, ∂w∂z=2z\dfrac{\partial w}{\partial z}=2z. The nine middle derivatives:

ρ\rhoϕ\phiθ\theta
xxsin⁡ϕcos⁡θ\sin\phi\cos\thetaρcos⁡ϕcos⁡θ\rho\cos\phi\cos\theta−ρsin⁡ϕsin⁡θ-\rho\sin\phi\sin\theta
yysin⁡ϕsin⁡θ\sin\phi\sin\thetaρcos⁡ϕsin⁡θ\rho\cos\phi\sin\thetaρsin⁡ϕcos⁡θ\rho\sin\phi\cos\theta
zzcos⁡ϕ\cos\phi−ρsin⁡ϕ-\rho\sin\phi00

With respect to ρ\rho (first column):

∂w∂ρ=8xsin⁡ϕcos⁡θ+8ysin⁡ϕsin⁡θ+2zcos⁡ϕ=8ρsin⁡2ϕcos⁡2θ+8ρsin⁡2ϕsin⁡2θ+2ρcos⁡2ϕ=8ρsin⁡2ϕ+2ρcos⁡2ϕ=2ρ(1+3sin⁡2ϕ)\begin{aligned} \frac{\partial w}{\partial\rho}&=8x\sin\phi\cos\theta+8y\sin\phi\sin\theta+2z\cos\phi\\ &=8\rho\sin^2\phi\cos^2\theta+8\rho\sin^2\phi\sin^2\theta+2\rho\cos^2\phi\\ &=8\rho\sin^2\phi+2\rho\cos^2\phi=\mathbf{2\rho\left(1+3\sin^2\phi\right)} \end{aligned}

With respect to ϕ\phi (second column):

∂w∂ϕ=8x⋅ρcos⁡ϕcos⁡θ+8y⋅ρcos⁡ϕsin⁡θ+2z⋅(−ρsin⁡ϕ)=8ρ2sin⁡ϕcos⁡ϕ(cos⁡2θ+sin⁡2θ)−2ρ2sin⁡ϕcos⁡ϕ=6ρ2sin⁡ϕcos⁡ϕ\begin{aligned} \frac{\partial w}{\partial\phi}&=8x\cdot\rho\cos\phi\cos\theta+8y\cdot\rho\cos\phi\sin\theta+2z\cdot(-\rho\sin\phi)\\ &=8\rho^2\sin\phi\cos\phi\left(\cos^2\theta+\sin^2\theta\right)-2\rho^2\sin\phi\cos\phi\\ &=\mathbf{6\rho^2\sin\phi\cos\phi} \end{aligned}

With respect to θ\theta (third column):

∂w∂θ=8x(−ρsin⁡ϕsin⁡θ)+8y(ρsin⁡ϕcos⁡θ)+0=−8ρ2sin⁡2ϕsin⁡θcos⁡θ+8ρ2sin⁡2ϕsin⁡θcos⁡θ=0\begin{aligned} \frac{\partial w}{\partial\theta}&=8x(-\rho\sin\phi\sin\theta)+8y(\rho\sin\phi\cos\theta)+0\\ &=-8\rho^2\sin^2\phi\sin\theta\cos\theta+8\rho^2\sin^2\phi\sin\theta\cos\theta=\mathbf{0} \end{aligned}

Check. Substituting first, 4(x2+y2)+z2=4ρ2sin⁡2ϕ+ρ2cos⁡2ϕ=ρ2(1+3sin⁡2ϕ)4(x^2+y^2)+z^2=4\rho^2\sin^2\phi+\rho^2\cos^2\phi=\rho^2\left(1+3\sin^2\phi\right). This has no θ\theta in it, so ∂w∂θ=0\dfrac{\partial w}{\partial\theta}=0. Differentiating gives 2ρ(1+3sin⁡2ϕ)2\rho(1+3\sin^2\phi) for ρ\rho and 6ρ2sin⁡ϕcos⁡ϕ6\rho^2\sin\phi\cos\phi for ϕ\phi. ✓\checkmark

Note on the source. In the first line, the handwritten page used cos⁡θ\cos\theta instead of sin⁡ϕcos⁡θ\sin\phi\cos\theta for ∂x/∂ρ\partial x/\partial\rho, which gave a wrong answer for ∂w/∂ρ\partial w/\partial\rho. The corrected value above is confirmed by the substitute-first check.

Watch out. With nine middle derivatives, it is easy to put one in the wrong place. A table like the one above keeps them in order. Also, look for cancellations: here every θ\theta term cancels, which tells you immediately that ww does not depend on θ\theta.

Page 4 of 14

The chain rule with an unknown function

The idea

Sometimes uu is given as ff of some expressions, with no formula for ff: for example u=f(x−y, y−z, z−x)u=f(x-y,\ y-z,\ z-x). You cannot differentiate ff itself, but you can still find how uu changes with xx, yy and zz. The chain rule does this, and we keep ∂u∂r\dfrac{\partial u}{\partial r}, ∂u∂s\dfrac{\partial u}{\partial s}, ∂u∂t\dfrac{\partial u}{\partial t} as unknown symbols.

Method

  1. Give names to the inside expressions: r=…r=\dots, s=…s=\dots, t=…t=\dots. Now u=f(r,s,t)u=f(r,s,t).
  2. Compute the nine partials of r,s,tr,s,t with respect to x,y,zx,y,z.
  3. Write ∂u∂x=∂u∂r∂r∂x+∂u∂s∂s∂x+∂u∂t∂t∂x\dfrac{\partial u}{\partial x}=\dfrac{\partial u}{\partial r}\dfrac{\partial r}{\partial x}+\dfrac{\partial u}{\partial s}\dfrac{\partial s}{\partial x}+\dfrac{\partial u}{\partial t}\dfrac{\partial t}{\partial x}, and likewise for yy and zz.
  4. Combine them as the question asks. The unknown terms cancel in pairs.

Examples

Example 1. If u=f(x−y, y−z, z−x)u=f(x-y,\ y-z,\ z-x), show that ∂u∂x+∂u∂y+∂u∂z=0\dfrac{\partial u}{\partial x}+\dfrac{\partial u}{\partial y}+\dfrac{\partial u}{\partial z}=0.

Put r=x−yr=x-y, s=y−zs=y-z, t=z−xt=z-x. Then

∂r∂x=1∂r∂y=−1∂r∂z=0∂s∂x=0∂s∂y=1∂s∂z=−1∂t∂x=−1∂t∂y=0∂t∂z=1\frac{\partial r}{\partial x}=1\quad\frac{\partial r}{\partial y}=-1\quad\frac{\partial r}{\partial z}=0 \qquad \frac{\partial s}{\partial x}=0\quad\frac{\partial s}{\partial y}=1\quad\frac{\partial s}{\partial z}=-1 \qquad \frac{\partial t}{\partial x}=-1\quad\frac{\partial t}{\partial y}=0\quad\frac{\partial t}{\partial z}=1

Apply the chain rule three times:

∂u∂x=ur−ut∂u∂y=−ur+us∂u∂z=−us+ut\frac{\partial u}{\partial x}=u_r-u_t\qquad \frac{\partial u}{\partial y}=-u_r+u_s\qquad \frac{\partial u}{\partial z}=-u_s+u_t

Add them: every term comes once with ++ and once with −-:

∂u∂x+∂u∂y+∂u∂z=(ur−ut)+(−ur+us)+(−us+ut)=0 ✓\frac{\partial u}{\partial x}+\frac{\partial u}{\partial y}+\frac{\partial u}{\partial z}=(u_r-u_t)+(-u_r+u_s)+(-u_s+u_t)=\mathbf{0}\ \checkmark

Example 2. If u=f ⁣(xy, yz, zx)u=f\!\left(\dfrac xy,\ \dfrac yz,\ \dfrac zx\right), show that x∂u∂x+y∂u∂y+z∂u∂z=0x\dfrac{\partial u}{\partial x}+y\dfrac{\partial u}{\partial y}+z\dfrac{\partial u}{\partial z}=0.

Put r=xyr=\dfrac xy, s=yzs=\dfrac yz, t=zxt=\dfrac zx. The partials that are not zero are

∂r∂x=1y∂r∂y=−xy2∂s∂y=1z∂s∂z=−yz2∂t∂z=1x∂t∂x=−zx2\frac{\partial r}{\partial x}=\frac1y\quad\frac{\partial r}{\partial y}=-\frac{x}{y^2}\qquad \frac{\partial s}{\partial y}=\frac1z\quad\frac{\partial s}{\partial z}=-\frac{y}{z^2}\qquad \frac{\partial t}{\partial z}=\frac1x\quad\frac{\partial t}{\partial x}=-\frac{z}{x^2}

Use the chain rule, and then multiply each by its variable so that the powers cancel:

x∂u∂x=x(1yur−zx2ut)=xy ur−zx utx\frac{\partial u}{\partial x}=x\left(\frac1yu_r-\frac{z}{x^2}u_t\right)=\frac xy\,u_r-\frac zx\,u_t y∂u∂y=y(−xy2ur+1zus)=−xy ur+yz usy\frac{\partial u}{\partial y}=y\left(-\frac{x}{y^2}u_r+\frac1zu_s\right)=-\frac xy\,u_r+\frac yz\,u_s z∂u∂z=z(−yz2us+1xut)=−yz us+zx utz\frac{\partial u}{\partial z}=z\left(-\frac{y}{z^2}u_s+\frac1xu_t\right)=-\frac yz\,u_s+\frac zx\,u_t

Add:

x ux+y uy+z uz=(xy−xy)ur+(yz−yz)us+(zx−zx)ut=0 ✓x\,u_x+y\,u_y+z\,u_z=\left(\frac xy-\frac xy\right)u_r+\left(\frac yz-\frac yz\right)u_s+\left(\frac zx-\frac zx\right)u_t=\mathbf{0}\ \checkmark

Why these are zero. In Example 1, uu depends only on the differences of x,y,zx,y,z. So if we increase all three by the same amount, nothing changes, and the sum of the three rates of change is 00. In Example 2, uu depends only on the ratios. So if we multiply all three by the same factor, nothing changes, and we get the weighted sum xux+yuy+zuz=0xu_x+yu_y+zu_z=0.

Watch out. Keep the unknown derivatives ur,us,utu_r,u_s,u_t as symbols. Do not try to "find their values". Also, in Example 2 remember to multiply by xx, yy, zz before adding. The cancellation works only after that.

Page 5 of 14

Local maxima and minima

The idea

A local maximum is a point where ff is at least as large as at every nearby point, like the top of a hill. A local minimum is like the bottom of a valley. Together they are called local (or relative) extrema.

At the top of a smooth hill the ground is flat in every direction. So the slope in the xx-direction and the slope in the yy-direction are both zero.

Critical point. A point (a,b)(a,b) is a critical point of f(x,y)f(x,y) when

fx(a,b)=0andfy(a,b)=0f_x(a,b)=0\qquad\text{and}\qquad f_y(a,b)=0

Every local extremum is at a critical point. But every critical point is not an extremum, so we need a test.

The second-derivative test

Find the second derivatives at the critical point and form

D=fxx fyy−(fxy)2D=f_{xx}\,f_{yy}-\left(f_{xy}\right)^2

(the determinant of second derivatives, often called the Hessian).

Condition at (a,b)(a,b)Conclusion
D>0D>0 and fxx>0f_{xx}>0local minimum
D>0D>0 and fxx<0f_{xx}<0local maximum
D<0D<0saddle point
D=0D=0the test fails: use another method

A saddle point is a critical point that is a maximum in one direction and a minimum in another, like the middle of a horse's saddle or a mountain pass. It is neither a top nor a bottom.

Why checking fxxf_{xx} alone is enough when D>0D>0. If D>0D>0 then fxxfyy>fxy2≥0f_{xx}f_{yy}>f_{xy}^2\ge0, so fxxf_{xx} and fyyf_{yy} have the same sign. If you check one, you know both.

Method

  1. Find fxf_x and fyf_y. Put both equal to 00 and solve the two equations. These give the critical points.
  2. Find fxxf_{xx}, fyyf_{yy}, fxyf_{xy}.
  3. At each critical point find DD, and if D>0D>0, find the sign of fxxf_{xx}.
  4. Classify the point. For the extreme value, put the point in ff.

Examples

Example 1. Find the relative extrema of f(x,y)=x2+y2−2x−6y+14f(x,y)=x^2+y^2-2x-6y+14.

fx=2x−2fy=2y−6f_x=2x-2\quad f_y=2y-6

Putting both equal to zero gives x=1x=1, y=3y=3, so the only critical point is (1,3)(1,3).

fxx=2fyy=2fxy=0 ⇒ D=2⋅2−02=4f_{xx}=2\quad f_{yy}=2\quad f_{xy}=0\ \Rightarrow\ D=2\cdot2-0^2=4

D=4>0D=4>0 and fxx=2>0f_{xx}=2>0, so (1,3)(1,3) is a local minimum. The minimum value is

f(1,3)=1+9−2−18+14=4f(1,3)=1+9-2-18+14=\mathbf4

Example 2. Find the relative extrema of f(x,y)=xy−x2−y2−2x−2y+4f(x,y)=xy-x^2-y^2-2x-2y+4.

fx=y−2x−2fy=x−2y−2f_x=y-2x-2\qquad f_y=x-2y-2

Solve y−2x−2=0y-2x-2=0 and x−2y−2=0x-2y-2=0. From the first, y=2x+2y=2x+2. Putting it in the second: x−4x−4−2=0x-4x-4-2=0, so x=−2x=-2 and then y=−2y=-2. The critical point is (−2,−2)(-2,-2).

fxx=−2fyy=−2fxy=1 ⇒ D=(−2)(−2)−12=3f_{xx}=-2\quad f_{yy}=-2\quad f_{xy}=1\ \Rightarrow\ D=(-2)(-2)-1^2=3

D=3>0D=3>0 and fxx=−2<0f_{xx}=-2<0, so (−2,−2)(-2,-2) is a local maximum, with value

f(−2,−2)=4−4−4+4+4+4=8f(-2,-2)=4-4-4+4+4+4=\mathbf8

Watch out. Students make four mistakes here. (1) Forgetting the square in D=fxxfyy−(fxy)2D=f_{xx}f_{yy}-(f_{xy})^2. (2) Thinking that D>0D>0 means "minimum". You must also check the sign of fxxf_{xx}. (3) Treating every critical point as an extremum. If D<0D<0, it is a saddle point. (4) Finding the extreme value by putting the point in fxf_x or DD instead of ff itself.

Page 6 of 14

Local extrema: worked examples

In each example, we find the critical points and then classify them using DD. When there are many critical points, a table keeps the work neat.

Example 1. Find the critical points of f(x,y)=2xy−x3−y3f(x,y)=2xy-x^3-y^3 and the extreme values.

fx=2y−3x2fy=2x−3y2f_x=2y-3x^2\qquad f_y=2x-3y^2

From fx=0f_x=0, y=3x22y=\dfrac{3x^2}{2}. Put this in fy=0f_y=0:

2x−3(3x22)2=2x−27x44=x(2−27x34)=02x-3\left(\frac{3x^2}{2}\right)^2=2x-\frac{27x^4}{4}=x\left(2-\frac{27x^3}{4}\right)=0

So x=0x=0 or x3=827x^3=\dfrac{8}{27}, that is x=23x=\dfrac23. The critical points are (0,0)(0,0) and (23,23)\left(\dfrac23,\dfrac23\right).

fxx=−6xfyy=−6yfxy=2f_{xx}=-6x\quad f_{yy}=-6y\quad f_{xy}=2
Pointfxxf_{xx}fyyf_{yy}fxyf_{xy}DDResult
(0,0)(0,0)000022−4-4saddle point
(23,23)\left(\tfrac23,\tfrac23\right)−4-4−4-4221212local maximum

Maximum value:

f ⁣(23,23)=89−827−827=24−8−827=827f\!\left(\tfrac23,\tfrac23\right)=\frac89-\frac8{27}-\frac8{27}=\frac{24-8-8}{27}=\mathbf{\frac8{27}}

Example 2. Find the extreme values of f(x,y)=3x2−2xy+y2−8yf(x,y)=3x^2-2xy+y^2-8y.

fx=6x−2yfy=−2x+2y−8f_x=6x-2y\qquad f_y=-2x+2y-8

Adding fx=0f_x=0 and fy=0f_y=0 gives 4x−8=04x-8=0, so x=2x=2. Then 6(2)−2y=06(2)-2y=0 gives y=6y=6. The critical point is (2,6)(2,6).

fxx=6fyy=2fxy=−2 ⇒ D=12−4=8>0, fxx>0f_{xx}=6\quad f_{yy}=2\quad f_{xy}=-2\ \Rightarrow\ D=12-4=8>0,\ f_{xx}>0

So (2,6)(2,6) is a local minimum, with value

f(2,6)=12−24+36−48=−24f(2,6)=12-24+36-48=\mathbf{-24}

Example 3. Find the extreme values of f(x,y)=x3+3xy2−15x2−15y2+72xf(x,y)=x^3+3xy^2-15x^2-15y^2+72x.

fx=3x2+3y2−30x+72fy=6xy−30y=6y(x−5)f_x=3x^2+3y^2-30x+72\qquad f_y=6xy-30y=6y(x-5)

fy=0f_y=0 gives two cases: y=0y=0 or x=5x=5.

Case y=0y=0. Then fx=3(x2−10x+24)=3(x−4)(x−6)=0f_x=3(x^2-10x+24)=3(x-4)(x-6)=0, so x=4x=4 or x=6x=6. Points: (4,0)(4,0) and (6,0)(6,0).

Case x=5x=5. Then fx=75+3y2−150+72=3y2−3=0f_x=75+3y^2-150+72=3y^2-3=0, so y=±1y=\pm1. Points: (5,1)(5,1) and (5,−1)(5,-1).

With fxx=6x−30f_{xx}=6x-30, fyy=6x−30f_{yy}=6x-30, fxy=6yf_{xy}=6y:

Pointfxxf_{xx}fyyf_{yy}fxyf_{xy}DDResult
(5,1)(5,1)000066−36-36saddle point
(5,−1)(5,-1)0000−6-6−36-36saddle point
(6,0)(6,0)6666003636local minimum
(4,0)(4,0)−6-6−6-6003636local maximum

Values: f(6,0)=216−540+432=108f(6,0)=216-540+432=\mathbf{108} is the local minimum, and f(4,0)=64−240+288=112f(4,0)=64-240+288=\mathbf{112} is the local maximum.

Example 4. Find the extreme values of f(x,y)=4xy−x4−y4f(x,y)=4xy-x^4-y^4.

fx=4y−4x3fy=4x−4y3f_x=4y-4x^3\qquad f_y=4x-4y^3

fx=0f_x=0 gives y=x3y=x^3. Substituting into fy=0f_y=0: 4x−4x9=4x(1−x8)=04x-4x^9=4x(1-x^8)=0, so x=0x=0 or x=±1x=\pm1. The critical points are (0,0)(0,0), (1,1)(1,1), (−1,−1)(-1,-1).

fxx=−12x2fyy=−12y2fxy=4f_{xx}=-12x^2\quad f_{yy}=-12y^2\quad f_{xy}=4
Pointfxxf_{xx}fyyf_{yy}fxyf_{xy}DDResult
(0,0)(0,0)000044−16-16saddle point
(1,1)(1,1)−12-12−12-1244128128local maximum
(−1,−1)(-1,-1)−12-12−12-1244128128local maximum

Both maxima have value f(1,1)=f(−1,−1)=4−1−1=2f(1,1)=f(-1,-1)=4-1-1=\mathbf2.

Solving the equations fx=fy=0f_x=f_y=0. This is usually the difficult part. Three methods cover almost every question: (1) solve one equation for one variable and put it in the other equation (Examples 1 and 4); (2) add or subtract the equations to remove a variable (Example 2); (3) if one equation can be factorised, make separate cases (Example 3). Always check that you have found every case. Missing a critical point is the most common reason for losing marks.

Page 7 of 14

Extrema with a parameter

The idea

When the function has a constant like aa, the critical points and their type depend on aa. Keep aa in the whole working, and at the end let the sign of aa decide between a maximum and a minimum.

Examples

Example 1. Discuss the maxima and minima of f(x,y)=xy(a−x−y)f(x,y)=xy(a-x-y), where a≠0a\neq0.

Expand: f=axy−x2y−xy2f=axy-x^2y-xy^2.

fx=ay−2xy−y2=y (a−2x−y)fy=ax−x2−2xy=x (a−x−2y)f_x=ay-2xy-y^2=y\,(a-2x-y)\qquad f_y=ax-x^2-2xy=x\,(a-x-2y)

fx=0f_x=0 gives y=0y=0 or a−2x−y=0a-2x-y=0. fy=0f_y=0 gives x=0x=0 or a−x−2y=0a-x-2y=0. Combining the cases:

  • y=0y=0 and x=0x=0: the point (0,0)(0,0).
  • y=0y=0 and a−x−2y=0a-x-2y=0: x=ax=a, the point (a,0)(a,0).
  • x=0x=0 and a−2x−y=0a-2x-y=0: y=ay=a, the point (0,a)(0,a).
  • a−2x−y=0a-2x-y=0 and a−x−2y=0a-x-2y=0: subtracting gives x=yx=y, then 3x=a3x=a, the point (a3,a3)\left(\dfrac a3,\dfrac a3\right).

The second derivatives are

fxx=−2yfyy=−2xfxy=a−2x−2yf_{xx}=-2y\qquad f_{yy}=-2x\qquad f_{xy}=a-2x-2y
Pointfxxf_{xx}fyyf_{yy}fxyf_{xy}DD
(0,0)(0,0)0000aa−a2-a^2
(a,0)(a,0)00−2a-2a−a-a−a2-a^2
(0,a)(0,a)−2a-2a00−a-a−a2-a^2
(a3,a3)\left(\tfrac a3,\tfrac a3\right)−2a3-\tfrac{2a}3−2a3-\tfrac{2a}3−a3-\tfrac a3a23\tfrac{a^2}3

The first three have D=−a2<0D=-a^2<0, so they are saddle points.

At (a3,a3)\left(\dfrac a3,\dfrac a3\right) we have D=a23>0D=\dfrac{a^2}{3}>0, and the sign of fxx=−2a3f_{xx}=-\dfrac{2a}{3} depends on aa:

  • If a>0a>0: fxx<0f_{xx}<0, a local maximum.
  • If a<0a<0: fxx>0f_{xx}>0, a local minimum.

The value there is f ⁣(a3,a3)=a3⋅a3⋅a3=a327f\!\left(\tfrac a3,\tfrac a3\right)=\dfrac{a}{3}\cdot\dfrac a3\cdot\dfrac a3=\mathbf{\dfrac{a^3}{27}}.

Example 2. Find the maxima and minima of f(x,y)=x3+y3−3axyf(x,y)=x^3+y^3-3axy, where a≠0a\neq0.

fx=3x2−3ayfy=3y2−3axf_x=3x^2-3ay\qquad f_y=3y^2-3ax

fx=0f_x=0 gives y=x2ay=\dfrac{x^2}{a}. Substituting into fy=0f_y=0:

3x4a2−3ax=3xa2(x3−a3)=0\frac{3x^4}{a^2}-3ax=\frac{3x}{a^2}\left(x^3-a^3\right)=0

So x=0x=0 or x=ax=a, giving the critical points (0,0)(0,0) and (a,a)(a,a).

fxx=6xfyy=6yfxy=−3af_{xx}=6x\qquad f_{yy}=6y\qquad f_{xy}=-3a
Pointfxxf_{xx}fyyf_{yy}fxyf_{xy}DDResult
(0,0)(0,0)0000−3a-3a−9a2-9a^2saddle point
(a,a)(a,a)6a6a6a6a−3a-3a27a227a^2see below

At (a,a)(a,a), D=36a2−9a2=27a2>0D=36a^2-9a^2=27a^2>0, and fxx=6af_{xx}=6a:

  • If a>0a>0: fxx>0f_{xx}>0, a local minimum.
  • If a<0a<0: fxx<0f_{xx}<0, a local maximum.

In both cases the value is

f(a,a)=a3+a3−3a⋅a⋅a=−a3f(a,a)=a^3+a^3-3a\cdot a\cdot a=-a^3

Note on the source. The handwritten page gave the value as a3a^3. The correct value is 2a3−3a3=−a32a^3-3a^3=\mathbf{-a^3}. For a=1a=1, f(1,1)=1+1−3=−1f(1,1)=1+1-3=-1.

Watch out. Do not assume a>0a>0. Write both cases (or clearly say "for a>0a>0"). Remember that DD has a2a^2, which is always positive, so it is the sign of fxxf_{xx} that depends on aa.

Page 8 of 14

Optimisation problems

The idea

Many real questions ask for the smallest cost, the least material or the largest volume. The second-derivative test solves them once the quantity is written as a function of two variables.

Method

  1. Write the quantity to be optimised (the objective), and name the variables.
  2. Use the given condition (a fixed volume, a budget) to remove variables until the objective depends on two variables.
  3. Find the critical points and classify them using DD.
  4. Check that the answer makes sense: dimensions must be positive, and quantities must be in the allowed range.

Examples

Example 1. Open box. A rectangular box, open at the top, has volume 32 ft332\ \text{ft}^3. Find its dimensions if the total surface area is least.

Let xx = length, yy = breadth, zz = height. The volume gives xyz=32xyz=32, so z=32xyz=\dfrac{32}{xy}. The surface area is a base plus four sides (no lid):

S=xy+2yz+2xz=xy+64x+64yS=xy+2yz+2xz=xy+\frac{64}{x}+\frac{64}{y}

(since 2yz=64x2yz=\dfrac{64}{x} and 2xz=64y2xz=\dfrac{64}{y}).

Sx=y−64x2Sy=x−64y2S_x=y-\frac{64}{x^2}\qquad S_y=x-\frac{64}{y^2}

Sx=0S_x=0 gives x2y=64x^2y=64 and Sy=0S_y=0 gives xy2=64xy^2=64. Subtracting, xy(x−y)=0xy(x-y)=0. Since x,y>0x,y>0, we get x=yx=y, so x3=64x^3=64 and

x=y=4z=3216=2x=y=4\qquad z=\frac{32}{16}=2

To classify:

Sxx=128x3=2Syy=128y3=2Sxy=1 ⇒ D=2⋅2−1=3>0, Sxx>0S_{xx}=\frac{128}{x^3}=2\quad S_{yy}=\frac{128}{y^3}=2\quad S_{xy}=1\ \Rightarrow\ D=2\cdot2-1=3>0,\ S_{xx}>0

So the surface area is a minimum at x=4x=4, y=4y=4, z=2z=2. The dimensions are 4×4×2\mathbf{4\times4\times2} feet, and the least surface area is 16+16+16=48 ft216+16+16=48\ \text{ft}^2.

Example 2. Cost of two products. A manufacturer makes xx units of product AA and yy units of product BB at a cost

C(x,y)=x2+y2+4xy+10x+8y+50C(x,y)=x^2+y^2+4xy+10x+8y+50

Find and classify the critical points to decide the minimum cost.

Cx=2x+4y+10Cy=2y+4x+8C_x=2x+4y+10\qquad C_y=2y+4x+8

Putting both equal to 00: from Cy=0C_y=0, y=−2x−4y=-2x-4. Putting this in Cx=0C_x=0: 2x−8x−16+10=02x-8x-16+10=0, so x=−1x=-1 and y=−2y=-2. The critical point is (−1,−2)(-1,-2).

Cxx=2Cyy=2Cxy=4 ⇒ D=4−16=−12<0C_{xx}=2\quad C_{yy}=2\quad C_{xy}=4\ \Rightarrow\ D=4-16=-12<0

D<0D<0, so (−1,−2)(-1,-2) is a saddle point: the cost has no local minimum there.

In real life x,y≥0x,y\ge0, and the critical point (with negative quantities) is not even in the allowed region. For x,y≥0x,y\ge0 every term of CC is non-negative, so the smallest cost is C(0,0)=50C(0,0)=\mathbf{50}, on the boundary. We study boundary cases like this on the next page.

Watch out. Always check that the critical point is valid for the problem. Lengths and quantities cannot be negative. Also, a saddle point means "no optimum here". It does not mean "answer is 00".

Page 9 of 14

Absolute maxima and minima

The idea

The absolute maximum (or minimum) of ff on a region is the largest (smallest) value it takes anywhere in that region. It is different from a local extremum. A local maximum is only the highest point nearby.

Key idea. A continuous function on a closed, bounded region (one that includes its edges, such as a filled triangle or rectangle) always has an absolute maximum and an absolute minimum. They come either at a critical point inside the region, or on the boundary.

So we must check both places.

Method

  1. Inside. Find the critical points (fx=fy=0f_x=f_y=0) and keep only those that are inside or on the region.
  2. Edges. On each edge, put the equation of the edge in ff. This gives a function of one variable. Find where its derivative is 00.
  3. Corners. Take every corner of the region.
  4. Compare. Find ff at all these points. The largest value is the absolute maximum and the smallest value is the absolute minimum.

You do not need the second-derivative test here. You just compare the values.

Examples

Example 1. Find the absolute extrema of f(x,y)=xy−4xf(x,y)=xy-4x on the triangle RR with vertices (0,0)(0,0), (4,0)(4,0), (0,4)(0,4).

{ "boundingBox": [-1, 5, 5, -1], "axis": true, "points": [ { "id": "O", "x": 0, "y": 0, "label": "O(0,0)" }, { "id": "A", "x": 4, "y": 0, "label": "A(4,0)" }, { "id": "B", "x": 0, "y": 4, "label": "B(0,4)" } ], "polygons": [{ "points": ["O", "A", "B"] }], "segments": [ { "from": "O", "to": "A" }, { "from": "O", "to": "B" }, { "from": "A", "to": "B" } ], "circles": [], "functions": [], "title": "The triangular region R" }

Interior. fx=y−4f_x=y-4 and fy=xf_y=x. Both vanish only at (0,4)(0,4), which is a corner of RR, so it is a candidate but not an interior point.

Edge OAOA (y=0y=0): f=−4xf=-4x. Its derivative is the constant −4-4, so there is no critical point. The values run from 00 at OO down to −16-16 at AA.

Edge OBOB (x=0x=0): f=0f=0 everywhere on the edge.

Edge ABAB (x+y=4x+y=4, so y=4−xy=4-x): f=x(4−x)−4x=−x2f=x(4-x)-4x=-x^2, with derivative −2x-2x, which is zero only at x=0x=0, the corner BB.

Candidates:

Pointff
(0,0)(0,0)00
(4,0)(4,0)−16-16
(0,4)(0,4)00

The absolute maximum is 00, attained at (0,0)(0,0), (0,4)(0,4) and in fact along the whole edge OBOB. The absolute minimum is −16-16 at (4,0)(4,0).

Example 2. Find the absolute extrema of f(x,y)=x2−2xy+2yf(x,y)=x^2-2xy+2y on the rectangle D: 0≤x≤3, 0≤y≤2D:\ 0\le x\le3,\ 0\le y\le2.

{ "boundingBox": [-1, 3, 4, -1], "axis": true, "points": [ { "id": "O", "x": 0, "y": 0, "label": "O(0,0)" }, { "id": "A", "x": 3, "y": 0, "label": "A(3,0)" }, { "id": "B", "x": 3, "y": 2, "label": "B(3,2)" }, { "id": "C", "x": 0, "y": 2, "label": "C(0,2)" } ], "polygons": [{ "points": ["O", "A", "B", "C"] }], "segments": [ { "from": "O", "to": "A" }, { "from": "A", "to": "B" }, { "from": "B", "to": "C" }, { "from": "C", "to": "O" } ], "circles": [], "functions": [], "title": "The rectangular region D" }

Interior. fx=2x−2yf_x=2x-2y, fy=−2x+2f_y=-2x+2. fy=0f_y=0 gives x=1x=1, then fx=0f_x=0 gives y=1y=1. The point (1,1)(1,1) lies inside DD, and f(1,1)=1−2+2=1f(1,1)=1-2+2=1.

Edges:

  • OAOA (y=0y=0): f=x2f=x^2, increasing, so no critical point.
  • ABAB (x=3x=3): f=9−6y+2y=9−4yf=9-6y+2y=9-4y, derivative −4≠0-4\neq0, so none.
  • BCBC (y=2y=2): f=x2−4x+4=(x−2)2f=x^2-4x+4=(x-2)^2, derivative 2x−4=02x-4=0 at x=2x=2. The point is (2,2)(2,2).
  • OCOC (x=0x=0): f=2yf=2y, derivative 2≠02\neq0, so none.

Candidates:

Pointff
(1,1)(1,1)11
(2,2)(2,2)00
(0,0)(0,0)00
(3,0)(3,0)99
(0,2)(0,2)44
(3,2)(3,2)11

The absolute maximum is 99 at (3,0)(3,0). The absolute minimum is 00, at (0,0)(0,0) and (2,2)(2,2).

Note on the source. The handwritten table had f(1,1)=−1f(1,1)=-1. The correct value is 1−2+2=11-2+2=1. The conclusions do not change, because 11 lies between the extreme values.

Watch out. Do not forget the corners. This is where the one-variable search on the edges ends, and the corners are often the answer (as with (3,0)(3,0) above). Also, reject any critical point that lies outside the region.

Page 10 of 14

Absolute extrema: more examples

The method is always the same: points inside, then each edge as a one-variable problem, then the corners, and then compare.

Edges made easy. On a horizontal edge y=cy=c or a vertical edge x=cx=c, just put the constant. On a slanting edge, use its equation (such as y=2−2xy=2-2x) to remove one variable.

Example 1. Find the absolute extrema of f(x,y)=x2−3y2−2x+6yf(x,y)=x^2-3y^2-2x+6y on the square with vertices (0,0)(0,0), (0,2)(0,2), (2,2)(2,2), (2,0)(2,0).

{ "boundingBox": [-1, 3, 3, -1], "axis": true, "points": [ { "id": "O", "x": 0, "y": 0, "label": "O(0,0)" }, { "id": "A", "x": 2, "y": 0, "label": "A(2,0)" }, { "id": "B", "x": 2, "y": 2, "label": "B(2,2)" }, { "id": "C", "x": 0, "y": 2, "label": "C(0,2)" } ], "polygons": [{ "points": ["O", "A", "B", "C"] }], "segments": [ { "from": "O", "to": "A" }, { "from": "A", "to": "B" }, { "from": "B", "to": "C" }, { "from": "C", "to": "O" } ], "circles": [], "functions": [], "title": "The square region" }

Interior. fx=2x−2f_x=2x-2, fy=−6y+6f_y=-6y+6, so the critical point is (1,1)(1,1), with f=1−3−2+6=2f=1-3-2+6=2.

Edges:

  • OAOA (y=0y=0): f=x2−2xf=x^2-2x, derivative 2x−2=02x-2=0 at x=1x=1. Point (1,0)(1,0), f=−1f=-1.
  • ABAB (x=2x=2): f=−3y2+6yf=-3y^2+6y, derivative −6y+6=0-6y+6=0 at y=1y=1. Point (2,1)(2,1), f=3f=3.
  • CBCB (y=2y=2): f=x2−2xf=x^2-2x, so x=1x=1. Point (1,2)(1,2), f=−1f=-1.
  • OCOC (x=0x=0): f=−3y2+6yf=-3y^2+6y, so y=1y=1. Point (0,1)(0,1), f=3f=3.

Corners: f(0,0)=0f(0,0)=0, f(2,0)=0f(2,0)=0, f(2,2)=4−12−4+12=0f(2,2)=4-12-4+12=0, f(0,2)=−12+12=0f(0,2)=-12+12=0.

The absolute maximum is 33, at (2,1)(2,1) and (0,1)(0,1). The absolute minimum is −1-1, at (1,0)(1,0) and (1,2)(1,2).

Example 2. Find the absolute extrema of f(x,y)=x2+y2f(x,y)=x^2+y^2 on the closed triangular plate bounded by x=0x=0, y=0y=0 and y+2x=2y+2x=2 in the first quadrant.

The vertices are (0,0)(0,0), (1,0)(1,0), (0,2)(0,2).

{ "boundingBox": [-0.5, 2.5, 1.5, -0.5], "axis": true, "points": [ { "id": "O", "x": 0, "y": 0, "label": "O(0,0)" }, { "id": "A", "x": 1, "y": 0, "label": "A(1,0)" }, { "id": "B", "x": 0, "y": 2, "label": "B(0,2)" } ], "polygons": [{ "points": ["O", "A", "B"] }], "segments": [ { "from": "O", "to": "A" }, { "from": "O", "to": "B" }, { "from": "A", "to": "B" } ], "circles": [], "functions": [], "title": "The plate bounded by x = 0, y = 0 and y + 2x = 2" }

Interior. fx=2xf_x=2x, fy=2yf_y=2y: the only critical point is (0,0)(0,0), a corner.

Edge OAOA (y=0y=0): f=x2f=x^2, increasing. Edge OBOB (x=0x=0): f=y2f=y^2, increasing. No critical points.

Edge ABAB (y=2−2xy=2-2x):

f=x2+(2−2x)2=5x2−8x+4f′=10x−8=0 ⇒ x=45, y=25f=x^2+(2-2x)^2=5x^2-8x+4\qquad f'=10x-8=0\ \Rightarrow\ x=\tfrac45,\ y=\tfrac25
Pointff
(0,0)(0,0)00
(1,0)(1,0)11
(0,2)(0,2)44
(45,25)\left(\tfrac45,\tfrac25\right)1625+425=45\tfrac{16}{25}+\tfrac{4}{25}=\tfrac45

The absolute maximum is 44 at (0,2)(0,2). The absolute minimum is 00 at (0,0)(0,0).

Note on the source. The handwritten conclusion said the maximum 44 is at both (0,2)(0,2) and (45,25)\left(\tfrac45,\tfrac25\right). But f ⁣(45,25)=45f\!\left(\tfrac45,\tfrac25\right)=\tfrac45, not 44, so the maximum is at (0,2)(0,2) only. (The point (45,25)\left(\tfrac45,\tfrac25\right) is the point of that edge that is closest to the origin.)

Example 3. Find the absolute extrema of f(x,y)=x2−xy+y2+1f(x,y)=x^2-xy+y^2+1 on the closed triangular plate in the first quadrant bounded by x=0x=0, y=4y=4 and y=xy=x.

The vertices are (0,0)(0,0), (0,4)(0,4), (4,4)(4,4).

{ "boundingBox": [-1, 5, 5, -1], "axis": true, "points": [ { "id": "O", "x": 0, "y": 0, "label": "O(0,0)" }, { "id": "B", "x": 0, "y": 4, "label": "B(0,4)" }, { "id": "A", "x": 4, "y": 4, "label": "A(4,4)" } ], "polygons": [{ "points": ["O", "B", "A"] }], "segments": [ { "from": "O", "to": "B" }, { "from": "B", "to": "A" }, { "from": "O", "to": "A" } ], "circles": [], "functions": [], "title": "The plate bounded by x = 0, y = 4 and y = x" }

Interior. fx=2x−yf_x=2x-y and fy=−x+2yf_y=-x+2y. Solving gives x=y=0x=y=0, the corner (0,0)(0,0), with f=1f=1.

Edges:

  • OBOB (x=0x=0): f=y2+1f=y^2+1, increasing, no critical point.
  • BABA (y=4y=4): f=x2−4x+17f=x^2-4x+17, derivative 2x−4=02x-4=0 at x=2x=2. Point (2,4)(2,4), f=13f=13.
  • OAOA (y=xy=x): f=x2+1f=x^2+1, increasing, no critical point.
Pointff
(0,0)(0,0)11
(0,4)(0,4)1717
(4,4)(4,4)1717
(2,4)(2,4)1313

The absolute maximum is 1717, at (0,4)(0,4) and (4,4)(4,4). The absolute minimum is 11 at (0,0)(0,0).

Example 4. Find the absolute extrema of f(x,y)=2x2−4x+y2−4y+1f(x,y)=2x^2-4x+y^2-4y+1 on the closed triangular plate bounded by x=0x=0, y=2y=2 and y=2xy=2x.

The vertices are (0,0)(0,0), (0,2)(0,2), (1,2)(1,2).

{ "boundingBox": [-0.5, 2.5, 1.6, -0.5], "axis": true, "points": [ { "id": "O", "x": 0, "y": 0, "label": "O(0,0)" }, { "id": "B", "x": 0, "y": 2, "label": "B(0,2)" }, { "id": "A", "x": 1, "y": 2, "label": "A(1,2)" } ], "polygons": [{ "points": ["O", "B", "A"] }], "segments": [ { "from": "O", "to": "B" }, { "from": "B", "to": "A" }, { "from": "O", "to": "A" } ], "circles": [], "functions": [], "title": "The plate bounded by x = 0, y = 2 and y = 2x" }

Interior. fx=4x−4f_x=4x-4 and fy=2y−4f_y=2y-4 give (1,2)(1,2), which is the corner AA.

Edges:

  • OBOB (x=0x=0): f=y2−4y+1f=y^2-4y+1, derivative 2y−4=02y-4=0 at y=2y=2, the corner BB.
  • BABA (y=2y=2): f=2x2−4x−3f=2x^2-4x-3, derivative 4x−4=04x-4=0 at x=1x=1, the corner AA.
  • OAOA (y=2xy=2x): f=6x2−12x+1f=6x^2-12x+1, derivative 12x−12=012x-12=0 at x=1x=1, again the corner AA.

Every critical point on the edges is a corner, so only the corners matter:

Pointff
(0,0)(0,0)11
(0,2)(0,2)−3-3
(1,2)(1,2)−5-5

The absolute maximum is 11 at (0,0)(0,0). The absolute minimum is −5-5 at (1,2)(1,2).

Watch out. When a critical point comes on a corner (as in Examples 2 to 4), it is not a separate extra point. It is just that corner. Find ff at every corner, whether or not a critical point was found there.

Page 11 of 14

The gradient

The idea

For a function f(x,y)f(x,y) there are two partial derivatives, fxf_x and fyf_y. The gradient puts them together in a single vector:

∇f=∂f∂x ı^+∂f∂y ȷ^=(fx, fy)\nabla f=\frac{\partial f}{\partial x}\,\hat\imath+\frac{\partial f}{\partial y}\,\hat\jmath=\left(f_x,\ f_y\right)

The symbol ∇\nabla is read "del". In three variables there is a third component:

∇f=∂f∂x ı^+∂f∂y ȷ^+∂f∂z k^=(fx, fy, fz)\nabla f=\frac{\partial f}{\partial x}\,\hat\imath+\frac{\partial f}{\partial y}\,\hat\jmath+\frac{\partial f}{\partial z}\,\hat k=\left(f_x,\ f_y,\ f_z\right)

Here ı^,ȷ^,k^\hat\imath,\hat\jmath,\hat k are the unit vectors along the xx, yy, zz axes.

Meaning. At each point, ∇f\nabla f is a vector that points in the direction in which ff increases fastest, and its length tells how fast. It is also perpendicular to the level curve of ff through that point.

Method

  1. Differentiate ff with respect to each variable (partial derivatives, as in Module 2).
  2. Write the results as a vector.
  3. If a point is given, then put it in each component.

Examples

Example 1. f(x,y)=y−xf(x,y)=y-x at (2,1)(2,1).

∇f=(−1, 1) ⇒ ∇f(2,1)=−ı^+ȷ^\nabla f=(-1,\ 1)\ \Rightarrow\ \nabla f(2,1)=\mathbf{-\hat\imath+\hat\jmath}

Example 2. f(x,y)=ln⁡(x2+y2)f(x,y)=\ln(x^2+y^2) at (1,1)(1,1).

∇f=(2xx2+y2, 2yx2+y2) ⇒ ∇f(1,1)=(22,22)=ı^+ȷ^\nabla f=\left(\frac{2x}{x^2+y^2},\ \frac{2y}{x^2+y^2}\right)\ \Rightarrow\ \nabla f(1,1)=\left(\frac22,\frac22\right)=\mathbf{\hat\imath+\hat\jmath}

Example 3. f(x,y)=2x+3yf(x,y)=\sqrt{2x+3y} at (−1,2)(-1,2).

∇f=(222x+3y, 322x+3y)=(12x+3y, 322x+3y)\nabla f=\left(\frac{2}{2\sqrt{2x+3y}},\ \frac{3}{2\sqrt{2x+3y}}\right)=\left(\frac{1}{\sqrt{2x+3y}},\ \frac{3}{2\sqrt{2x+3y}}\right)

At (−1,2)(-1,2): 2x+3y=−2+6=42x+3y=-2+6=4 and 4=2\sqrt4=2, so

∇f(−1,2)=12ı^+34ȷ^\nabla f(-1,2)=\mathbf{\frac12\hat\imath+\frac34\hat\jmath}

Example 4. f(x,y)=tan⁡−1xyf(x,y)=\tan^{-1}\dfrac{\sqrt x}{y} at (4,−2)(4,-2).

Use ddutan⁡−1u=11+u2\dfrac{d}{du}\tan^{-1}u=\dfrac1{1+u^2} with u=xyu=\dfrac{\sqrt x}y, so 1+u2=y2+xy21+u^2=\dfrac{y^2+x}{y^2}:

fx=y2y2+x⋅12yx=y2x (y2+x)fy=y2y2+x⋅(−xy2)=−xy2+xf_x=\frac{y^2}{y^2+x}\cdot\frac1{2y\sqrt x}=\frac{y}{2\sqrt x\,(y^2+x)}\qquad f_y=\frac{y^2}{y^2+x}\cdot\left(-\frac{\sqrt x}{y^2}\right)=-\frac{\sqrt x}{y^2+x}

At (4,−2)(4,-2): y2+x=8y^2+x=8 and x=2\sqrt x=2:

fx=−22⋅2⋅8=−116fy=−28=−14⇒∇f(4,−2)=−116ı^−14ȷ^f_x=\frac{-2}{2\cdot2\cdot8}=-\frac1{16}\qquad f_y=-\frac28=-\frac14\qquad\Rightarrow\qquad\nabla f(4,-2)=\mathbf{-\frac1{16}\hat\imath-\frac14\hat\jmath}

Example 5. f(x,y,z)=x2+y2−2z2+zln⁡xf(x,y,z)=x^2+y^2-2z^2+z\ln x at (1,1,1)(1,1,1).

∇f=(2x+zx,  2y,  −4z+ln⁡x) ⇒ ∇f(1,1,1)=(2+1, 2, −4+0)=3ı^+2ȷ^−4k^\nabla f=\left(2x+\frac zx,\ \ 2y,\ \ -4z+\ln x\right)\ \Rightarrow\ \nabla f(1,1,1)=(2+1,\ 2,\ -4+0)=\mathbf{3\hat\imath+2\hat\jmath-4\hat k}

Example 6. f(x,y,z)=log⁡(x2+y2+z2)f(x,y,z)=\log(x^2+y^2+z^2) at (1,2,1)(1,2,1).

∇f=1x2+y2+z2(2x, 2y, 2z)\nabla f=\frac{1}{x^2+y^2+z^2}\left(2x,\ 2y,\ 2z\right)

At (1,2,1)(1,2,1) the denominator is 1+4+1=61+4+1=6:

∇f(1,2,1)=16(2,4,2)=13ı^+23ȷ^+13k^\nabla f(1,2,1)=\frac16(2,4,2)=\mathbf{\frac13\hat\imath+\frac23\hat\jmath+\frac13\hat k}

Watch out. The gradient is a vector. Write it as aı^+bȷ^a\hat\imath+b\hat\jmath (or as (a,b)(a,b)), not as a single number. Put the point after differentiating. Also, do not forget the chain-rule factors (the 22 and 33 inside the root in Example 3).

Page 12 of 14

Directional derivatives

The idea

fxf_x and fyf_y give the rate of change of ff when you move along the xx-axis or the yy-axis. The directional derivative gives the rate of change when you move in any direction.

Directional derivative. The rate of change of ff at a point in the direction of the unit vector u^\hat u is

Du^f=∇f⋅u^D_{\hat u}f=\nabla f\cdot\hat u

For u^=(u1,u2)\hat u=(u_1,u_2) this is fxu1+fyu2f_xu_1+f_yu_2, and in three variables fxu1+fyu2+fzu3f_xu_1+f_yu_2+f_zu_3.

The sign has the usual meaning: positive means ff is increasing in that direction, and negative means it is decreasing.

Vectors you need

  • Dot product. For a⃗=(a1,a2,a3)\vec a=(a_1,a_2,a_3) and b⃗=(b1,b2,b3)\vec b=(b_1,b_2,b_3):  a⃗⋅b⃗=a1b1+a2b2+a3b3\ \vec a\cdot\vec b=a_1b_1+a_2b_2+a_3b_3.
  • Vector between points. The vector from PP to QQ is PQ→=Q−P\overrightarrow{PQ}=Q-P. For P(1,2,3)P(1,2,3) and Q(3,4,5)Q(3,4,5): PQ→=(2,2,2)\overrightarrow{PQ}=(2,2,2).
  • Length. ∣r⃗∣=x2+y2+z2|\vec r|=\sqrt{x^2+y^2+z^2} for r⃗=(x,y,z)\vec r=(x,y,z).
  • Unit vector. a^=a⃗∣a⃗∣\hat a=\dfrac{\vec a}{|\vec a|} has length 11 and the same direction as a⃗\vec a.

Method

  1. Find ∇f\nabla f and find its value at the point.
  2. If the direction is given as a vector v⃗\vec v (or as "towards a point QQ", so v⃗=PQ→\vec v=\overrightarrow{PQ}), change it into a unit vector u^=v⃗/∣v⃗∣\hat u=\vec v/|\vec v|.
  3. Take the dot product ∇f⋅u^\nabla f\cdot\hat u.

The most common mistake. The direction vector must be a unit vector. If you are given (1,1)(1,1) or (2,3)(2,3), first divide by its length. The formula ∇f⋅u^\nabla f\cdot\hat u is correct only for a vector of length 11.

Examples

Example 1. f(x,y)=x2+y2f(x,y)=x^2+y^2 at (1,1)(1,1), in the direction u^=(12,12)\hat u=\left(\dfrac1{\sqrt2},\dfrac1{\sqrt2}\right).

This u^\hat u already has length 11. ∇f=(2x,2y)\nabla f=(2x,2y), so ∇f(1,1)=(2,2)\nabla f(1,1)=(2,2):

Du^f=2⋅12+2⋅12=2+2=22D_{\hat u}f=2\cdot\frac1{\sqrt2}+2\cdot\frac1{\sqrt2}=\sqrt2+\sqrt2=\mathbf{2\sqrt2}

Example 2. f(x,y)=x3−3xy+y3f(x,y)=x^3-3xy+y^3 at (1,2)(1,2), in the direction of v⃗=(2,3)\vec v=(2,3).

∇f=(3x2−3y, 3y2−3x)\nabla f=(3x^2-3y,\ 3y^2-3x), so ∇f(1,2)=(3−6, 12−3)=(−3, 9)\nabla f(1,2)=(3-6,\ 12-3)=(-3,\ 9). The length is ∣v⃗∣=4+9=13|\vec v|=\sqrt{4+9}=\sqrt{13}, so u^=(2,3)13\hat u=\dfrac{(2,3)}{\sqrt{13}}:

Du^f=(−3)(2)+(9)(3)13=−6+2713=2113D_{\hat u}f=\frac{(-3)(2)+(9)(3)}{\sqrt{13}}=\frac{-6+27}{\sqrt{13}}=\mathbf{\frac{21}{\sqrt{13}}}

Example 3. f(x,y)=x2y+3xy2f(x,y)=x^2y+3xy^2 at (1,2)(1,2), in the direction of v⃗=(1,1)\vec v=(1,1).

∇f=(2xy+3y2, x2+6xy)\nabla f=(2xy+3y^2,\ x^2+6xy), so ∇f(1,2)=(4+12, 1+12)=(16,13)\nabla f(1,2)=(4+12,\ 1+12)=(16,13). The vector (1,1)(1,1) has length 2\sqrt2, so u^=(12,12)\hat u=\left(\dfrac1{\sqrt2},\dfrac1{\sqrt2}\right):

Du^f=16+132=292≈20.5D_{\hat u}f=\frac{16+13}{\sqrt2}=\mathbf{\frac{29}{\sqrt2}}\approx20.5

Note on the source. The handwritten page took the dot product with (1,1)(1,1) directly and wrote 2929. That vector is not a unit vector, so 2929 is 2\sqrt2 times too large. The correct answer is 292\dfrac{29}{\sqrt2}.

Example 4. f(x,y)=exsin⁡yf(x,y)=e^x\sin y at (0,π2)\left(0,\dfrac\pi2\right), in the direction of the unit vector (0,1)(0,1).

∇f=(exsin⁡y, excos⁡y)\nabla f=(e^x\sin y,\ e^x\cos y), so ∇f ⁣(0,π2)=(1, 0)\nabla f\!\left(0,\tfrac\pi2\right)=(1,\ 0):

Du^f=(1)(0)+(0)(1)=0D_{\hat u}f=(1)(0)+(0)(1)=\mathbf0

In the yy-direction the function is flat at that point.

Example 5. A hill. The height of a hill is h(x,y)=100−0.01x2−0.02y2h(x,y)=100-0.01x^2-0.02y^2. A hiker at (50,40)(50,40) looks towards the point (60,50)(60,50). How steep is the hill in that direction?

∇h=(−0.02x, −0.04y) ⇒ ∇h(50,40)=(−1, −1.6)\nabla h=(-0.02x,\ -0.04y)\ \Rightarrow\ \nabla h(50,40)=(-1,\ -1.6)

The direction of travel is PQ→=(60−50, 50−40)=(10,10)\overrightarrow{PQ}=(60-50,\ 50-40)=(10,10), with length 10210\sqrt2, so u^=(12,12)\hat u=\left(\dfrac1{\sqrt2},\dfrac1{\sqrt2}\right):

Du^h=−1−1.62=−2.62≈−1.84D_{\hat u}h=\frac{-1-1.6}{\sqrt2}=-\frac{2.6}{\sqrt2}\approx\mathbf{-1.84}

The negative sign means the ground is going down in that direction, by about 1.841.84 units of height for each unit of horizontal distance.

Watch out. (1) Make the direction a unit vector. (2) Find ∇f\nabla f at the given point before taking the dot product. (3) For "towards a point QQ", the direction is Q−PQ-P, not P−QP-Q.

Page 13 of 14

Steepest ascent and descent

The idea

At a point, the directional derivative depends on which way you go. Which direction gives the largest value, and what is that value? The dot product gives the answer. For the angle α\alpha between ∇f\nabla f and u^\hat u:

Du^f=∇f⋅u^=∣∇f∣ ∣u^∣cos⁡α=∣∇f∣cos⁡αD_{\hat u}f=\nabla f\cdot\hat u=|\nabla f|\,|\hat u|\cos\alpha=|\nabla f|\cos\alpha

This is largest when cos⁡α=1\cos\alpha=1 (the directions are the same) and smallest when cos⁡α=−1\cos\alpha=-1 (opposite directions).

Properties of the gradient. At a point where ∇f≠0⃗\nabla f\neq\vec0:

  • Fastest increase is in the direction of ∇f\nabla f, and the rate is ∣∇f∣|\nabla f|, the maximum value of the directional derivative.
  • Fastest decrease is in the direction of −∇f-\nabla f, and the rate is −∣∇f∣-|\nabla f|.
  • In a direction perpendicular to ∇f\nabla f the rate of change is 00 (you are moving along a level curve).

For a hill, ∇h\nabla h points straight up the slope, and −∇h-\nabla h points in the direction in which water would flow down.

Method

  1. Find ∇f\nabla f at the point.
  2. Maximum rate: ∣∇f∣=fx2+fy2|\nabla f|=\sqrt{f_x^2+f_y^2}. Direction of fastest increase: ∇f∣∇f∣\dfrac{\nabla f}{|\nabla f|}.
  3. Direction of fastest decrease: −∇f∣∇f∣-\dfrac{\nabla f}{|\nabla f|}.

Examples

Example 1. For f(x,y)=x2−3xy+y2f(x,y)=x^2-3xy+y^2 at (1,−1)(1,-1), find the maximum rate of change, the direction of fastest increase and of fastest decrease, and the directional derivative in the direction ı^−ȷ^\hat\imath-\hat\jmath.

∇f=(2x−3y, 2y−3x) ⇒ ∇f(1,−1)=(2+3, −2−3)=(5, −5)\nabla f=(2x-3y,\ 2y-3x)\ \Rightarrow\ \nabla f(1,-1)=(2+3,\ -2-3)=(5,\ -5) ∣∇f∣=25+25=50=52|\nabla f|=\sqrt{25+25}=\sqrt{50}=\mathbf{5\sqrt2}
  • Fastest increase: the direction of ∇f\nabla f, that is u^=(1,−1)2\hat u=\dfrac{(1,-1)}{\sqrt2}.
  • Fastest decrease: the direction of −∇f=(−5,5)-\nabla f=(-5,5), that is (−1,1)2\dfrac{(-1,1)}{\sqrt2}.

For the direction ı^−ȷ^\hat\imath-\hat\jmath, the unit vector is u^=(1,−1)2\hat u=\dfrac{(1,-1)}{\sqrt2}, which is exactly the direction of ∇f\nabla f. So

Du^f=(5,−5)⋅(1,−1)2=5+52=102=52D_{\hat u}f=(5,-5)\cdot\frac{(1,-1)}{\sqrt2}=\frac{5+5}{\sqrt2}=\frac{10}{\sqrt2}=\mathbf{5\sqrt2}

This is equal to ∣∇f∣|\nabla f|, as it should be when we move in the direction of the gradient.

Example 2. Find the directional derivative of f(x,y)=x ey+cos⁡(xy)f(x,y)=x\,e^y+\cos(xy) at (2,0)(2,0) in the direction of v⃗=3ı^−4ȷ^\vec v=3\hat\imath-4\hat\jmath.

∇f=(ey−ysin⁡(xy),  x ey−xsin⁡(xy))\nabla f=\left(e^y-y\sin(xy),\ \ x\,e^y-x\sin(xy)\right)

At (2,0)(2,0):  ∇f=(1−0, 2−0)=(1,2)\ \nabla f=(1-0,\ 2-0)=(1,2).

The length of v⃗\vec v is 9+16=5\sqrt{9+16}=5, so u^=(3,−4)5\hat u=\dfrac{(3,-4)}{5}:

Du^f=(1)(3)+(2)(−4)5=−55=−1D_{\hat u}f=\frac{(1)(3)+(2)(-4)}{5}=\frac{-5}{5}=\mathbf{-1}

So ff is decreasing at rate 11 in that direction. This is less than ∣∇f∣=5|\nabla f|=\sqrt5, the largest possible rate at this point, as it should be.

Watch out. "Direction of fastest increase" means the unit vector ∇f/∣∇f∣\nabla f/|\nabla f| (or simply the direction of ∇f\nabla f). "Maximum rate" means the number ∣∇f∣|\nabla f|. These are different answers to different questions. Give the one that is asked.

Page 14 of 14

Practice questions and formula sheet

Practice questions

Try these without looking at the answers. The answers are given below.

A. Chain rule

  1. Find dwdt\dfrac{dw}{dt} for w=xy+yz+zxw=xy+yz+zx with x=tx=t, y=t2y=t^2, z=t3z=t^3.
  2. If u=f(x2−y2, y2−z2, z2−x2)u=f(x^2-y^2,\ y^2-z^2,\ z^2-x^2), show that 1x∂u∂x+1y∂u∂y+1z∂u∂z=0\dfrac1x\dfrac{\partial u}{\partial x}+\dfrac1y\dfrac{\partial u}{\partial y}+\dfrac1z\dfrac{\partial u}{\partial z}=0.

B. Local extrema

  1. Find and classify the critical points of f(x,y)=x2+xy+y2−3x−6yf(x,y)=x^2+xy+y^2-3x-6y.
  2. Find and classify the critical points of f(x,y)=x3−3x+y2f(x,y)=x^3-3x+y^2.
  3. Three positive numbers add up to 3030. Find the largest possible product.

C. Absolute extrema

  1. Find the absolute extrema of f(x,y)=x2+y2−2x−4yf(x,y)=x^2+y^2-2x-4y on the square 0≤x≤30\le x\le3, 0≤y≤30\le y\le3.
  2. Find the absolute extrema of f(x,y)=xyf(x,y)=xy on the triangle with vertices (0,0)(0,0), (2,0)(2,0), (0,2)(0,2).

D. Gradient and directional derivatives

  1. Find ∇f\nabla f at (2,1)(2,1) for f(x,y)=x2y−y3f(x,y)=x^2y-y^3.
  2. Find the directional derivative of f(x,y)=x2−xy+y2f(x,y)=x^2-xy+y^2 at (1,1)(1,1) in the direction towards the point (4,5)(4,5).
  3. Find the directional derivative of g(x,y,z)=xyzg(x,y,z)=xyz at (1,1,2)(1,1,2) in the direction of v⃗=(1,2,2)\vec v=(1,2,2).
  4. For f(x,y)=excos⁡yf(x,y)=e^x\cos y at (0,π4)\left(0,\dfrac\pi4\right), find the greatest rate of increase and the direction in which it occurs.

Answers

  1. dwdt=3t2+4t3+5t4\dfrac{dw}{dt}=3t^2+4t^3+5t^4. (Check: w=t3+t4+t5w=t^3+t^4+t^5.)
  2. With r=x2−y2r=x^2-y^2, s=y2−z2s=y^2-z^2, t=z2−x2t=z^2-x^2: ux=2x(ur−ut)u_x=2x(u_r-u_t), uy=2y(−ur+us)u_y=2y(-u_r+u_s), uz=2z(−us+ut)u_z=2z(-u_s+u_t). Dividing by x,y,zx,y,z and adding gives 2[(ur−ut)+(−ur+us)+(−us+ut)]=02[(u_r-u_t)+(-u_r+u_s)+(-u_s+u_t)]=0.
  3. fx=2x+y−3f_x=2x+y-3, fy=x+2y−6f_y=x+2y-6 give the point (0,3)(0,3). D=2⋅2−1=3>0D=2\cdot2-1=3>0, fxx=2>0f_{xx}=2>0: local minimum, value f(0,3)=9−18=−9f(0,3)=9-18=-9.
  4. fx=3x2−3=0f_x=3x^2-3=0 gives x=±1x=\pm1, and fy=2y=0f_y=2y=0 gives y=0y=0. D=fxxfyy=6x⋅2=12xD=f_{xx}f_{yy}=6x\cdot2=12x. At (1,0)(1,0): D=12>0D=12>0, fxx=6>0f_{xx}=6>0: local minimum, value −2-2. At (−1,0)(-1,0): D=−12<0D=-12<0: saddle point.
  5. Maximise xyzxyz with z=30−x−yz=30-x-y, that is f=xy(30−x−y)f=xy(30-x-y). This is Example 1 on the parameter page with a=30a=30: the maximum is at x=y=z=10x=y=z=10, with product a327=1000\dfrac{a^3}{27}=\mathbf{1000}.
  6. Interior critical point (1,2)(1,2), f=1+4−2−8=−5f=1+4-2-8=-5. Edges: y=0y=0 gives x2−2xx^2-2x, point (1,0)(1,0), f=−1f=-1; x=3x=3 gives y2−4y+3y^2-4y+3, point (3,2)(3,2), f=−1f=-1; y=3y=3 gives x2−2x−3x^2-2x-3, point (1,3)(1,3), f=−4f=-4; x=0x=0 gives y2−4yy^2-4y, point (0,2)(0,2), f=−4f=-4. Corners: f(0,0)=0f(0,0)=0, f(3,0)=3f(3,0)=3, f(3,3)=0f(3,3)=0, f(0,3)=−3f(0,3)=-3. Absolute maximum 33 at (3,0)(3,0); absolute minimum −5-5 at (1,2)(1,2).
  7. fx=yf_x=y, fy=xf_y=x: critical point (0,0)(0,0) (a corner). On the axes f=0f=0. On x+y=2x+y=2: f=x(2−x)f=x(2-x), maximum at x=1x=1, point (1,1)(1,1), value 11. Absolute maximum 11 at (1,1)(1,1); absolute minimum 00 (at (0,0)(0,0) and all along both axes).
  8. ∇f=(2xy, x2−3y2)\nabla f=(2xy,\ x^2-3y^2), so ∇f(2,1)=(4, 1)=4ı^+ȷ^\nabla f(2,1)=(4,\ 1)=4\hat\imath+\hat\jmath.
  9. ∇f=(2x−y, 2y−x)=(1,1)\nabla f=(2x-y,\ 2y-x)=(1,1) at (1,1)(1,1). The direction is (4−1,5−1)=(3,4)(4-1,5-1)=(3,4), length 55, so u^=(35,45)\hat u=\left(\tfrac35,\tfrac45\right). Du^f=3+45=75D_{\hat u}f=\dfrac{3+4}{5}=\dfrac75.
  10. ∇g=(yz, xz, xy)=(2,2,1)\nabla g=(yz,\ xz,\ xy)=(2,2,1) at (1,1,2)(1,1,2). ∣v⃗∣=1+4+4=3|\vec v|=\sqrt{1+4+4}=3. Du^g=2⋅1+2⋅2+1⋅23=83D_{\hat u}g=\dfrac{2\cdot1+2\cdot2+1\cdot2}{3}=\dfrac83.
  11. ∇f=(excos⁡y, −exsin⁡y)=(22, −22)\nabla f=(e^x\cos y,\ -e^x\sin y)=\left(\tfrac{\sqrt2}{2},\ -\tfrac{\sqrt2}{2}\right) at (0,π4)\left(0,\tfrac\pi4\right). The greatest rate is ∣∇f∣=12+12=1|\nabla f|=\sqrt{\tfrac12+\tfrac12}=\mathbf1, in the direction 12(1,−1)\dfrac{1}{\sqrt2}(1,-1).

Study tip. For absolute extrema (6 and 7), write the points in a table as you go. It is easy to forget a corner when the working is spread over many edges.


Formula sheet

Chain rule

SituationFormula
w=f(x,y,z)w=f(x,y,z), all depend on ttdwdt=wxdxdt+wydydt+wzdzdt\dfrac{dw}{dt}=w_x\dfrac{dx}{dt}+w_y\dfrac{dy}{dt}+w_z\dfrac{dz}{dt}
x,y,zx,y,z depend on u,v,mu,v,m∂w∂u=wx∂x∂u+wy∂y∂u+wz∂z∂u\dfrac{\partial w}{\partial u}=w_x\dfrac{\partial x}{\partial u}+w_y\dfrac{\partial y}{\partial u}+w_z\dfrac{\partial z}{\partial u}, same for vv, mm
Unknown f(r,s,t)f(r,s,t)name r,s,tr,s,t; chain rule; the unknowns cancel
Tree rulemultiply along each path, add the paths

Local extrema

Critical pointfx=0f_x=0 and fy=0f_y=0
HessianD=fxxfyy−(fxy)2D=f_{xx}f_{yy}-(f_{xy})^2
D>0D>0, fxx>0f_{xx}>0local minimum
D>0D>0, fxx<0f_{xx}<0local maximum
D<0D<0saddle point
D=0D=0test fails
Optimisationeliminate variables with the constraint, then find and classify critical points

Absolute extrema on a closed region

  1. Critical points inside the region.
  2. Each edge: put its equation, and find where the one-variable derivative is 00.
  3. All corners.
  4. Compare ff at every point: the largest is the maximum and the smallest is the minimum.

Gradient and directional derivative

Gradient∇f=(fx, fy)\nabla f=(f_x,\ f_y), or (fx, fy, fz)(f_x,\ f_y,\ f_z) in three variables
Direction vectorPQ→=Q−P\overrightarrow{PQ}=Q-P
Unit vector$\hat u=\dfrac{\vec v}{
Directional derivativeDu^f=∇f⋅u^D_{\hat u}f=\nabla f\cdot\hat u (u^\hat u must be a unit vector)
Fastest increasedirection ∇f\nabla f, rate $
Fastest decreasedirection −∇f-\nabla f, rate $-
No changedirection perpendicular to ∇f\nabla f

You’ve reached the end of S1 CSE Maths · Module 3.

Source: ktunotes.in · GAMAT101, Module 3. Reorganised and rewritten from the class notes, with every worked example re-checked. Check the original material if a step looks unclear.