← M408M Week 12: Tangent Planes and the Chain Rule
M408M · Week 12 Stewart §14.4–14.5

Tangent Planes and the Chain Rule

Outline

  1. 1Tangent planes
  2. 2Linear approximation and differentials
  3. 3The Chain Rule
  4. 4Implicit differentiation with the Chain Rule
  5. 5Exercises
§14.4 · Tangent planes

The tangent plane

The tangent plane to $z=f(x,y)$ at $P(x_0,y_0,z_0)$ is the plane that contains the two tangent lines $T_1$ and $T_2$ from §14.3.

$$z-z_0=f_x(x_0,y_0)\,(x-x_0)+f_y(x_0,y_0)\,(y-y_0)$$

Why these coefficients

Any non-vertical plane through $P$ is $z-z_0=a(x-x_0)+b(y-y_0)$.

Why does every non-vertical plane have this form?

A plane through $P$ with normal $\langle A,B,C\rangle$ is $A(x-x_0)+B(y-y_0)+C(z-z_0)=0$.

Non-vertical means $C\neq0$: a vertical plane such as $x=1$ contains vertical lines, so $\mathbf n\perp\langle0,0,1\rangle$ and $C=0$.

Divide by $C$ and set $a=-\tfrac{A}{C}$, $b=-\tfrac{B}{C}$:

$$z-z_0=-\tfrac{A}{C}(x-x_0)-\tfrac{B}{C}(y-y_0)=a(x-x_0)+b(y-y_0)$$

Conversely, any $a,b$ give a plane with normal $\langle a,b,-1\rangle$. Vertical planes are not of the form $z=\dots$, and a tangent plane to $z=f(x,y)$ never is.

Set $y=y_0$: the plane meets $y=y_0$ in the line $z-z_0=a(x-x_0)$. This must be $T_1$, whose slope is $f_x$. So $a=f_x(x_0,y_0)$.

Set $x=x_0$: the line $z-z_0=b(y-y_0)$ must be $T_2$, so $b=f_y(x_0,y_0)$.

Example: $f(x,y)=4-x^2-2y^2$ at $P(1,1,1)$

From week 11: $f_x(1,1)=-2$, $f_y(1,1)=-4$.

$$z-1=-2(x-1)-4(y-1)\iff z=7-2x-4y$$

Near $P$ the surface stays close to the plane · drag to rotate

§14.4 · Linear approximation and differentials

Linear approximation and differentials

Near $(a,b)$ the tangent plane stays close to the surface, so its height and its changes approximate those of $f$.

Linearization: the height of the tangent plane

$$f(x,y)\approx L(x,y)=f(a,b)+f_x(a,b)\,(x-a)+f_y(a,b)\,(y-b)$$

Use it for $(x,y)$ near $(a,b)$. Far from $(a,b)$ the error can be large.

Differentials

Move from $(a,b)$ by $dx=\Delta x$ and $dy=\Delta y$:

$dz=f_x\,dx+f_y\,dy$ is the change in height of the tangent plane.

$\Delta z=f(a+\Delta x,\,b+\Delta y)-f(a,b)$ is the change in height of the surface.

For $(x,y)$ near $(a,b)$, $\Delta z\approx dz$.

Example: $f(x,y)=4-x^2-2y^2$, from $(1,1)$ to $(0.9,\,0.95)$

$L(x,y)=1-2(x-1)-4(y-1)$ gives $f(0.9,\,0.95)\approx1.4$. The exact value is $1.385$.

$dz=(-2)(-0.1)+(-4)(-0.05)=0.4$ and $\Delta z=1.385-1=0.385$.

Differentiability: $f$ is differentiable at $(a,b)$ when $L$ approximates $f$ well near $(a,b)$.

Theorem 8: if $f_x$ and $f_y$ exist near $(a,b)$ and are continuous at $(a,b)$, then $f$ is differentiable at $(a,b)$.

§14.5 · Chain Rule, Case 1

Chain Rule: $x$ and $y$ depend on $t$

If $z=f(x,y)$ and the point $(x,y)=(x(t),y(t))$ moves along a curve, then $z$ is a function of $t$.

$$\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}\qquad\text{or}\qquad z'(t)=z_x\,x'(t)+z_y\,y'(t)$$

Why

From §14.4, $\Delta z\approx f_x\,\Delta x+f_y\,\Delta y$. Divide by $\Delta t$ and let $\Delta t\to 0$.

Each term is (rate of $z$ in one variable) $\times$ (rate of that variable in $t$).

Example: $z=4-x^2-2y^2$, $\;x=\cos t$, $\;y=\sin t$, at $t=\tfrac{\pi}{4}$

$z$ is the height of the surface above a point that moves on the unit circle.

$$z'(t)=\underbrace{(-2x)}_{z_x}\underbrace{(-\sin t)}_{x'(t)}+\underbrace{(-4y)}_{z_y}\underbrace{(\cos t)}_{y'(t)}$$

At $t=\tfrac{\pi}{4}$: $x=y=\sin t=\cos t=\tfrac{\sqrt2}{2}$.

$$z'\big(\tfrac{\pi}{4}\big)=(-\sqrt2)\Big(-\tfrac{\sqrt2}{2}\Big)+(-2\sqrt2)\Big(\tfrac{\sqrt2}{2}\Big)=1-2=-1$$

Height $z$ above the moving point, and $z$ against $t$ with slope $z'(t)$ · drag to rotate

§14.5 · Chain Rule, Case 2

Chain Rule: $x$ and $y$ depend on $s$ and $t$

If $z=f(x,y)$ with $x=x(s,t)$ and $y=y(s,t)$, then $z$ is a function of $s$ and $t$.

$$\begin{aligned}\frac{\partial z}{\partial s}&=\frac{\partial z}{\partial x}\frac{\partial x}{\partial s}+\frac{\partial z}{\partial y}\frac{\partial y}{\partial s}&&\text{or}\qquad z_s=z_x\,x_s+z_y\,y_s\\[10pt]\frac{\partial z}{\partial t}&=\frac{\partial z}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial z}{\partial y}\frac{\partial y}{\partial t}&&\text{or}\qquad z_t=z_x\,x_t+z_y\,y_t\end{aligned}$$

Three kinds of variables

$z$
dependent variable
$x,\ y$
intermediate variables
$s,\ t$
independent variables

$\partial z/\partial s$ is Case 1 with $t$ held fixed: one term for each intermediate variable.

Using the tree diagram

Write a partial derivative on each branch. For $\partial z/\partial s$: multiply along each path from $z$ down to $s$, then add the products.

§14.5 · Chain Rule, Case 2

Case 2 example and the general version

Evaluate $x$ and $y$ at the given $(s,t)$ first. Then every factor is a number.

Example: $z=x^2y$, $\;x=s^2$, $\;y=st$, at $(s,t)=(1,2)$

  1. Point. $x=1^2=1$, $\;y=(1)(2)=2$.
  2. Outer derivatives. $z_x=2xy=4$, $\;z_y=x^2=1$.
  3. Inner derivatives.
    $$x_s=2s=2,\quad x_t=0,\quad y_s=t=2,\quad y_t=s=1$$
  4. Chain Rule.
    $$z_s=(4)(2)+(1)(2)=10,\qquad z_t=(4)(0)+(1)(1)=1$$

Check by substitution: $z=(s^2)^2(st)=s^5t$, so $z_s=5s^4t=10$ and $z_t=s^5=1$ at $(1,2)$.

General version

If $u$ depends on $x_1,\dots,x_n$ and each $x_j$ depends on $t_1,\dots,t_m$, then

$$\frac{\partial u}{\partial t_i}=\frac{\partial u}{\partial x_1}\frac{\partial x_1}{\partial t_i}+\frac{\partial u}{\partial x_2}\frac{\partial x_2}{\partial t_i}+\cdots+\frac{\partial u}{\partial x_n}\frac{\partial x_n}{\partial t_i}$$

One term for each intermediate variable.

§14.5 · Implicit differentiation

Implicit differentiation with the Chain Rule

If $F(x,y,z)=0$ defines $z=z(x,y)$, then $F\big(x,y,z(x,y)\big)=0$ for all $(x,y)$ near the point.

Why the Chain Rule applies: shown for $\partial/\partial x$

$z$ depends on $x$ and $y$, so $F\big(x,y,z(x,y)\big)$ is a composite function: Case 2 with intermediate variables $x,y,z$.

Fx Fy Fz 1 0 zx F x y z x x x

Add one term for each path from $F$ down to $x$. The left side is $0$ for every $(x,y)$, so its derivative is $0$:

$${\color{#268bd2}F_x\cdot1}+F_y\cdot0+{\color{#cb4b16}F_z\,z_x}=0$$
$$z_x=-\frac{F_x}{F_z},\qquad z_y=-\frac{F_y}{F_z}\qquad(F_z\neq0)$$

For $z_y$, follow the paths down to $y$ instead. The factors are $0$, $1$, $z_y$, so $F_y+F_z\,z_y=0$.

Example: $z^3+xyz+x^2=7$ at $P(2,1,1)$. Find $z_x$ two ways

Method 1 (week 11). Differentiate both sides in $x$, with $z=z(x,y)$. The product rule on $xyz$ gives $yz+xy\,z_x$:

$${\color{#cb4b16}3z^2z_x}+{\color{#268bd2}yz}+{\color{#cb4b16}xy\,z_x}+{\color{#268bd2}2x}=0\;\Longrightarrow\;z_x=-\frac{\color{#268bd2}yz+2x}{\color{#cb4b16}3z^2+xy}=-\frac55=-1$$

Method 2 (formula). $F=z^3+xyz+x^2-7$. Treat $x,y,z$ as independent, so no $z_x$ appears:

$$F_x={\color{#268bd2}yz+2x},\quad F_z={\color{#cb4b16}3z^2+xy}\;\Longrightarrow\;z_x=-\frac{F_x}{F_z}=-\frac55=-1$$

Why they agree. In Method 1 the Chain Rule splits each term into a part with $z$ held constant and a part times $z_x$. The blue parts add up to $F_x$ and the orange coefficients add up to $F_z$, so the Method 1 equation is $F_x+F_z\,z_x=0$ written out.

$z_y$ works the same way: both methods give $z_y=-xz/(3z^2+xy)$, which is $-2/5$ at $P$.

§14.5 · Implicit differentiation

Combining implicit differentiation and the Chain Rule

An equation defines $z=z(x,y)$, and $x,y$ depend on $s,t$. To find $z_s$ and $z_t$, we need $z_x$ and $z_y$ first.

Method

  1. Check the point. Compute $x(s,t)$ and $y(s,t)$: the given $(s,t)$ should correspond to $P$. Then $z_x$ and $z_y$ in the Chain Rule are evaluated at $P$.

    Problems usually give an $(s,t)$ that corresponds to $P$, so this is an extra safety check. If it does not, find $z$ at the new point from the equation and evaluate $z_x$, $z_y$ there.

  2. Implicit differentiation. Find $z_x$ and $z_y$, and evaluate them at $P$.
  3. Inner derivatives. Find $x_s$, $x_t$, $y_s$, $y_t$ at the given $(s,t)$.
  4. Chain Rule.
    $$z_s=z_x\,x_s+z_y\,y_s$$
    $$z_t=z_x\,x_t+z_y\,y_t$$

Example: $z^3+xyz+x^2=7$ near $P(2,1,1)$, with $x=s^2+t$, $\;y=t$, at $(s,t)=(1,1)$

  1. Check the point. $x(1,1)=1^2+1=2$, $\;y(1,1)=1$. So the given $(s,t)=(1,1)$ corresponds to $P(2,1,1)$.
  2. Implicit differentiation (previous slide): $z_x=-1$, $\;z_y=-\tfrac25$ at $P$.
  3. Inner derivatives.
    $$x_s=2s=2,\quad x_t=1,\quad y_s=0,\quad y_t=1$$
  4. Chain Rule.
    $$z_s=z_x\,x_s+z_y\,y_s=(-1)(2)+\Big(-\tfrac25\Big)(0)=-2$$
    $$z_t=z_x\,x_t+z_y\,y_t=(-1)(1)+\Big(-\tfrac25\Big)(1)=-\tfrac75$$
Exercises

Practice: tangent planes and the Chain Rule

Exercise 1 · Tangent plane and linear approximation

$$f(x,y)=\sqrt{x^2+3y}$$
  1. Find an equation of the tangent plane to $z=f(x,y)$ at the point $(1,1,2)$.
  2. Use the linear approximation to estimate $f(1.1,\,0.96)$. Compare with the value from a calculator.

Exercise 2 · Implicit differentiation and the Chain Rule

The surface below defines $z$ implicitly as a function $z=z(x,y)$ near the point $P=(2,1,1)$.

$$xz^2+y^2z+xy=5$$

Suppose that $\;x=s+t^2,\quad y=st.$

  1. Use implicit differentiation to find formulas for $z_x$ and $z_y$. Evaluate both at $P$.
  2. Use the Chain Rule to find $z_s$ and $z_t$ at $(s,t)=(1,1)$.
Solution · Exercise 1

Solution 1: $f(x,y)=\sqrt{x^2+3y}$ at $(1,1,2)$

(a) Tangent plane

  1. $f_x$: hold $y$ constant. Write $f=(x^2+3y)^{1/2}$ and use the chain rule:
    $$f_x=\tfrac12(x^2+3y)^{-1/2}\cdot 2x=\frac{x}{\sqrt{x^2+3y}}$$
  2. $f_y$: hold $x$ constant. The derivative of $x^2+3y$ in $y$ is $3$:
    $$f_y=\tfrac12(x^2+3y)^{-1/2}\cdot 3=\frac{3}{2\sqrt{x^2+3y}}$$
  3. Evaluate at $(1,1)$. $\sqrt{1^2+3(1)}=2$, so $f_x(1,1)=\tfrac12$ and $f_y(1,1)=\tfrac{3}{2\cdot2}=\tfrac34$.
  4. Tangent plane. Use $z-z_0=f_x(x_0,y_0)(x-x_0)+f_y(x_0,y_0)(y-y_0)$:
    $$z-2=\tfrac12(x-1)+\tfrac34(y-1)$$

(b) Linear approximation

  1. Linearization. $(1.1,\,0.96)$ is near $(1,1)$, so use the tangent plane from (a):
    $$f(x,y)\approx L(x,y)=2+\tfrac12(x-1)+\tfrac34(y-1)$$
  2. Changes. $x-1=1.1-1=0.1$ and $y-1=0.96-1=-0.04$.
  3. Substitute.
    $$L(1.1,\,0.96)=2+\tfrac12(0.1)+\tfrac34(-0.04)=2+0.05-0.03$$
    $$f(1.1,\,0.96)\approx 2.02$$
  4. Compare. With a calculator: $(1.1)^2+3(0.96)=1.21+2.88=4.09$, so
    $$f(1.1,\,0.96)=\sqrt{4.09}\approx 2.0224$$
    The error is $2.0224-2.02\approx0.0024$.
Solution · Exercise 2

Solution 2: $xz^2+y^2z+xy=5$ at $P(2,1,1)$, with $x=s+t^2$, $y=st$

(a) $z_x$ and $z_y$ at $P$

Method 1: the formula from the Chain Rule (this week)

  1. Write $F=0$. $F(x,y,z)=xz^2+y^2z+xy-5$.
  2. Partial derivatives of $F$, with $x,y,z$ treated as independent:
    $$F_x=z^2+y,\qquad F_y=2yz+x,\qquad F_z=2xz+y^2$$
  3. Evaluate at $P(2,1,1)$.
    $$\begin{aligned}z_x&=-\frac{F_x}{F_z}=-\frac{z^2+y}{2xz+y^2}=-\frac{1+1}{4+1}=-\frac25\\[4pt]z_y&=-\frac{F_y}{F_z}=-\frac{2yz+x}{2xz+y^2}=-\frac{2+2}{4+1}=-\frac45\end{aligned}$$

Method 2: differentiate the equation (week 11), with $z=z(x,y)$

$$\begin{aligned}\tfrac{\partial}{\partial x}:&\quad z^2+2xz\,z_x+y^2z_x+y=0&&\Longrightarrow\quad z_x=-\frac{z^2+y}{2xz+y^2}\\[4pt]\tfrac{\partial}{\partial y}:&\quad 2xz\,z_y+2yz+y^2z_y+x=0&&\Longrightarrow\quad z_y=-\frac{2yz+x}{2xz+y^2}\end{aligned}$$

These are $-F_x/F_z$ and $-F_y/F_z$ from Method 1, so the values at $P$ are the same.

(b) $z_s$ and $z_t$ at $(s,t)=(1,1)$

  1. Check the point. $x(1,1)=1+1^2=2$, $\;y(1,1)=1$. So $(s,t)=(1,1)$ corresponds to $P$, and we use $z_x$, $z_y$ from (a).
  2. Inner derivatives at $(1,1)$:
    $$\begin{aligned}x_s&=\tfrac{\partial}{\partial s}(s+t^2)=1,&\quad x_t&=\tfrac{\partial}{\partial t}(s+t^2)=2t=2\\[2pt]y_s&=\tfrac{\partial}{\partial s}(st)=t=1,&\quad y_t&=\tfrac{\partial}{\partial t}(st)=s=1\end{aligned}$$
  3. Chain Rule.
    $$z_s=z_x\,x_s+z_y\,y_s=\Big(-\tfrac25\Big)(1)+\Big(-\tfrac45\Big)(1)$$
    $$z_s=-\tfrac25-\tfrac45=-\tfrac65$$
    $$z_t=z_x\,x_t+z_y\,y_t=\Big(-\tfrac25\Big)(2)+\Big(-\tfrac45\Big)(1)$$
    $$z_t=-\tfrac45-\tfrac45=-\tfrac85$$
§14.4–14.5 · Summary

Summary: key formulas and methods

ConceptFormula / Method
Tangent plane at $(x_0,y_0,z_0)$$z-z_0=f_x(x_0,y_0)(x-x_0)+f_y(x_0,y_0)(y-y_0)$; it contains $T_1$ and $T_2$
Linear approximation$f(x,y)\approx L(x,y)=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)$ for $(x,y)$ near $(a,b)$
Differentials$dz=f_x\,dx+f_y\,dy$ is the change in the tangent plane; $\Delta z\approx dz$
Chain Rule, Case 1$z'(t)=z_x\,x'(t)+z_y\,y'(t)$
Chain Rule, Case 2$z_s=z_x\,x_s+z_y\,y_s$, $\;z_t=z_x\,x_t+z_y\,y_t$: one term for each path in the tree diagram
Implicit differentiation$F(x,y,z)=0$: $\;z_x=-F_x/F_z$, $\;z_y=-F_y/F_z$, when $F_z\neq0$
Implicit + Chain RuleCheck that the given $(s,t)$ corresponds to $P$; find $z_x,z_y$ at $P$; then apply Case 2