Lecture 10     

Chain Rule

APMA E2000

Drew Youngren dcy2@columbia.edu

$\gdef\RR{\mathbb{R}}$ $\gdef\vec{\mathbf}$ $\gdef\bv#1{\begin{bmatrix} #1 \end{bmatrix}}$ $\gdef\proj{\operatorname{proj}}$ $\gdef\comp{\operatorname{comp}}$

Announcements

  • No quiz this week
  • Recitation 6 this week
  • HW6 due next Tuesday

1-minute review

Linearization

The linearization of a differentiable function $f(x,y)$ about a point $(a,b)$ is the linear function \[ L(x,y) = f(a,b) + f_x(a,b)(x-a) + f_y(a,b)(y-b) \] $ \approx f(x,y)$. Its graph is tangent to the graph of $f$.

Error

\[ f(x,y) \approx f(a,b) + f_x(a,b)(x-a) + f_y(a,b)(y-b) \]

Error

\[ f(x,y) - f(a,b) \approx f_x(a,b)(x-a) + f_y(a,b)(y-b) \]

Error

\[ \Delta f \approx f_x(a,b)\Delta x + f_y(a,b)\Delta y \]

Error

\[ df = f_x(a,b) dx + f_y(a,b)dy \]

This differential of $f$ estimates the error of $f$. That is, it approximates how much the output will change for given changes of the input.

Example

Theorem

If all partial derivatives of a function of several variables $f$ exist and are continuous in a neighborhood of a position $\vec a$, then $f(\vec x)$ is differentiable at $\vec a$.

Non-example

\[ f(x,y) = \frac{xy}{\sqrt{x^2 + y^2}} \]

The Chain Rule

Photo credit: Joe Paradiso

1-D Chain Rule

\[ \frac{d}{dx} (f\circ g)(x) = f'(g(x))g'(x) \]

\[ \frac{d}{dx} f(g(x)) = \frac{df}{du} \frac{du}{dx} \] where $u = g(x)$.

Main problem

A smooth curve $\left\langle x(t), y(t) \right\rangle$ moves through a domain of a differentiable function $f(x,y)$. What is $\frac{df}{dt} \Big\vert_{t = t_0}$?

Hint: Replace $f$ with $L$.

Let $L(x,y)$ be the linearization of $f$ around $\left\langle a, b \right\rangle = \left\langle x(t_0), y(t_0) \right\rangle$.

\[ \frac{df}{dt} \Big\vert_{t = t_0} = \frac{dL }{dt} \Big\vert_{t = t_0} L(x(t), y(t)) = \]

\[ \frac{d}{dt} \Big\vert_{t_0}(f(a, b) + f_x(a,b)(x(t) - a) + f_y(a,b)(y(t) - b)) \]

\[ = f_x(a,b) x'(t_0) + f_y(a,b) y'(t_0) \]

Multivariable Chain Rule

If $f(x_1, \ldots, x_n)$ is a differentiable function and each $x_i$ depends smoothly on $t$, then \[ \frac{df}{dt} = \sum_{i=1}^n \frac{\partial f}{\partial x_i} \frac{d x_i}{dt} \]

Notation

We write \[\nabla f = \left\langle \frac{\partial f}{\partial x_1}, \ldots, \frac{\partial f}{\partial x_n} \right\rangle \]

Thus, the chain rule becomes \[ \frac{d}{dt} f ( \vec x(t)) = \nabla f(\vec x(t)) \cdot \vec x'(t) \]

Other Forms

Other cases can be handled by extrapolating from the case above. \[\frac{\partial}{\partial t} f(x(s,t),y(s,t),z(s,t)) =\]\[ \frac{\partial f}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial t} +\frac{\partial f}{\partial z}\frac{\partial z}{\partial t} \]

Examples

Elevation change

A particle circles the $z$-axis every second at a distance of 1 unit. If it is confined to the surface $z=xy$, find the maximum of $\frac{dz}{dt}$.

Solution.

$z = xy$ and $\left\langle x(t), y(t) \right\rangle = \left\langle \cos(2 \pi t), \sin (2 \pi t) \right\rangle $. \[\frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt} \]

\[ = y (-2\pi\sin (2\pi t)) + x(2\pi \cos(2\pi t)) \] \[ = -2\pi\sin^2 (2\pi t) + 2\pi \cos^2(2\pi t) \] \[ = 2\pi \cos(4\pi t) \] which has a maximum of $2\pi$.

Related Rates

The base radius of a right cone is increasing at a rate of 1 cm/min, and its height is decreasing at 2cm/min. When the base has radius 4 cm and the height is 8 cm, is the volume increasing or decreasing?

Solution.

$V = \frac\pi3 r^2 h$ and thus \[ \frac{dV}{dt} = \frac{\partial V}{\partial r}\frac{dr}{dt} + \frac{\partial V}{\partial h}\frac{dh}{dt} \] \[ = \frac23 \pi r h \frac{dr}{dt} + \frac13 \pi r^2 \frac{dh}{dt} \] \[ = \frac23 \pi (4) (8) (1) + \frac13 \pi 4^2 (-2) = \frac{32 \pi}{3} > 0 \]

Polar Coordinates

Suppose $f(x,y)$ has continuous derivatives of all order. Express $\frac{\partial^2 f}{\partial r\partial \theta}$ in terms of the partial derivatives of $f$.

$r$ and $\theta$ are the usual polar coordinates.

Solution.

\[\frac{\partial f}{\partial r} = f_x \frac{\partial x}{\partial r} + f_y \frac{\partial y}{\partial r} = f_x \cos \theta + f_y \sin \theta \]

\[\frac{\partial^2 f}{\partial \theta \partial r } = \left(f_{xx} \frac{\partial x}{\partial \theta} + f_{xy} \frac{\partial y}{\partial \theta}\right)\cos \theta - f_x \sin \theta \]\[+ \left(f_{yx} \frac{\partial x}{\partial \theta} + f_{yy} \frac{\partial y}{\partial \theta}\right)\sin \theta + f_y \cos \theta \] \[ = (f_{yy} - f_{xx})r\sin\theta \cos \theta + f_{xy} r \cos (2\theta) + f_y \cos \theta - f_x \sin\theta \]

Chain chain chain

Suppose \[ \begin{align*} z &= z(x,y) \\ x &= x(u,v) \\ y &= y(u,v) \\ u &= u(s,t) \\ v &= v(s,t) \\ \end{align*}\] are all differentiable. Find an expression for $\frac{\partial z}{\partial s}$.

Solution.

\[ \begin{align*} \frac{\partial z}{\partial s} =& \frac{\partial z}{\partial x}\frac{\partial x}{\partial u}\frac{\partial u}{\partial s} + \frac{\partial z}{\partial x}\frac{\partial x}{\partial v}\frac{\partial v}{\partial s} \\ &+ \frac{\partial z}{\partial y}\frac{\partial y}{\partial u}\frac{\partial u}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial v}\frac{\partial v}{\partial s} \\ \end{align*} \]

Implicit Differentiation

Implicit Relationships

Every implicit relationship among variables $x$ and $y$ can be expressed as a level set \[ F(x,y) = c. \]

Examples
  • The circle $y = \pm\sqrt{R^2 - x^2}$ $ x^2 + y^2 = R^2$
  • Something else $\cos(xy) + x - 1 = e^{-x}y$ $\cos(xy) + x - e^{-x}y = 1$
Main Problem
Given $y$ implicitly defined as a function of $x$ via $F(x,y) = c$, find an expression for $\frac{dy}{dx}$ in terms of derivatives of $F$.
\[ \frac{d}{dx}F(x,y) = 0\]
WARNING Mind your $d$'s and $\partial$'s.
\[ \frac{d}{dx}F(x,y(x)) = 0 \]
\[ \frac{\partial F}{\partial x}\frac{dx}{dx} + \frac{\partial F}{\partial y}\frac{dy}{dx} = 0\]
\[ \frac{dy}{dx} = -\frac{F_x}{F_y} \]
Example

Find the slope of the tangent line to \[ x \sin(y) - \frac12 = \sqrt{2} - 2\cos(xy)\] at the point $\left(\frac12,\frac\pi2\right)$.

Solution.

\[F(x,y) = x \sin y + 2\cos(xy) = \frac12 + \sqrt 2 \] \[ \frac{dy}{dx} = \left.-\frac{F_x}{F_y} \right\rvert_{(1/2,\pi/2)} = \left.-\frac{\sin y -2\sin(xy)y}{x\cos y -2 \sin(xy)x}\right\rvert_{(1/2,\pi/2)} \] \[ = - \frac{1 - \frac{\pi}{\sqrt2}}{-\frac{1}{\sqrt2}} = \sqrt2 - \pi \]

Learning Outcomes

You should be able to...
  • Sketch a dependence tree for compositions.
  • Select the correct form of the chain rule for arbitrary compositions of scalar fields.
  • Compute higher order derivatives via the chain rule.
  • Implicitly find rates of change by reexpressing relations between quantities as level sets.