Tangent Planes and the Chain Rule
Outline
- 1Tangent planes
- 2Linear approximation and differentials
- 3The Chain Rule
- 4Implicit differentiation with the Chain Rule
- 5Exercises
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.
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}$:
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$.
Near $P$ the surface stays close to the plane · drag to rotate
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
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)$.
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$.
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.
At $t=\tfrac{\pi}{4}$: $x=y=\sin t=\cos t=\tfrac{\sqrt2}{2}$.
Height $z$ above the moving point, and $z$ against $t$ with slope $z'(t)$ · drag to rotate
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$.
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.
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)$
- Point. $x=1^2=1$, $\;y=(1)(2)=2$.
- Outer derivatives. $z_x=2xy=4$, $\;z_y=x^2=1$.
- Inner derivatives.
$$x_s=2s=2,\quad x_t=0,\quad y_s=t=2,\quad y_t=s=1$$
- 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
One term for each intermediate variable.
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$.
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$:
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$:
Method 2 (formula). $F=z^3+xyz+x^2-7$. Treat $x,y,z$ as independent, so no $z_x$ appears:
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$.
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
- 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.
- Implicit differentiation. Find $z_x$ and $z_y$, and evaluate them at $P$.
- Inner derivatives. Find $x_s$, $x_t$, $y_s$, $y_t$ at the given $(s,t)$.
- 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)$
- 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)$.
- Implicit differentiation (previous slide): $z_x=-1$, $\;z_y=-\tfrac25$ at $P$.
- Inner derivatives.
$$x_s=2s=2,\quad x_t=1,\quad y_s=0,\quad y_t=1$$
- 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$$
Practice: tangent planes and the Chain Rule
Exercise 1 · Tangent plane and linear approximation
- Find an equation of the tangent plane to $z=f(x,y)$ at the point $(1,1,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)$.
Suppose that $\;x=s+t^2,\quad y=st.$
- Use implicit differentiation to find formulas for $z_x$ and $z_y$. Evaluate both at $P$.
- Use the Chain Rule to find $z_s$ and $z_t$ at $(s,t)=(1,1)$.
Solution 1: $f(x,y)=\sqrt{x^2+3y}$ at $(1,1,2)$
(a) Tangent plane
- $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}}$$
- $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}}$$
- 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$.
- 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
- 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)$$
- Changes. $x-1=1.1-1=0.1$ and $y-1=0.96-1=-0.04$.
- 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$$
- 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 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)
- Write $F=0$. $F(x,y,z)=xz^2+y^2z+xy-5$.
- 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$$
- 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)$
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)$
- 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).
- 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}$$
- 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$$
Summary: key formulas and methods
| Concept | Formula / 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 Rule | Check that the given $(s,t)$ corresponds to $P$; find $z_x,z_y$ at $P$; then apply Case 2 |