---
title: Tangent Planes, Linear Approximation, and the Chain Rule
module: Partial Derivatives
moduleNumber: 11
lessonNumber: 3
order: 1103
summary: >
  Near a point, a smooth surface looks like its tangent plane, and the plane's
  equation is built from the two partial derivatives. That linearization defines
  the total differential and the meaning of differentiability in two variables.
  The chain rule then propagates derivatives through composed functions, tracked
  by a tree diagram, and yields clean formulas for implicit differentiation.
topics: [Partial Derivatives]
draft: false
sources:
  - book: Stewart
    ref: "Ch. 14 — Partial Derivatives; §14.4 Tangent Planes and Linear Approximations"
  - book: Stewart
    ref: "Ch. 14; §14.5 The Chain Rule"
---

Zoom in on a point of a curve whose function is differentiable, and the curve
straightens into its tangent line. Zoom in on a point of a smooth surface, and it
flattens into a plane. That plane is the best linear approximation to the surface,
and its slopes in the two coordinate directions are the partial derivatives
already in hand.

## The tangent plane

Let $S$ be the surface $z = f(x, y)$ with $f$ having continuous first partials,
and let $P = (x_0, y_0, z_0)$ be a point on it. The plane $y = y_0$ cuts $S$ in a
curve $C_1$ with tangent line $T_1$ of slope $f_x(x_0, y_0)$; the plane $x = x_0$
cuts $S$ in $C_2$ with tangent $T_2$ of slope $f_y(x_0, y_0)$.

> **Definition (Tangent plane).** The tangent plane to $S$ at $P$ is the plane
> through $P$ containing both tangent lines $T_1$ and $T_2$. It is the plane that
> most closely approximates $S$ near $P$; every tangent line at $P$ to a curve
> lying on $S$ lies in it.

Any plane through $P$ has the form $z - z_0 = a(x - x_0) + b(y - y_0)$. Setting
$y = y_0$ leaves $z - z_0 = a(x - x_0)$, a line of slope $a$ that must be $T_1$,
so $a = f_x(x_0, y_0)$. Setting $x = x_0$ forces $b = f_y(x_0, y_0)$.

> **Theorem (Equation of the tangent plane).** If $f$ has continuous partial
> derivatives, the tangent plane to $z = f(x, y)$ at $P = (x_0, y_0, z_0)$ is
> $$
> z - z_0 = f_x(x_0, y_0)\,(x - x_0) + f_y(x_0, y_0)\,(y - y_0).
> $$

Compare the single-variable tangent line $y - y_0 = f'(x_0)(x - x_0)$: the plane
carries one slope term per input.

> **Worked example.** Find the tangent plane to the elliptic paraboloid
> $z = 2x^2 + y^2$ at $(1, 1, 3)$.
>
> With $f_x = 4x$ and $f_y = 2y$, evaluate $f_x(1, 1) = 4$ and $f_y(1, 1) = 2$.
> The tangent plane is
> $$
> z - 3 = 4(x - 1) + 2(y - 1), \qquad\text{i.e.}\qquad z = 4x + 2y - 3.
> $$

$$
% caption: The tangent plane at $P$ touches the surface and shares both trace
% tangents $T_1$ and $T_2$; near $P$ the surface and plane are nearly identical.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  % surface: a bowl outline
  \draw[black, thick] (-2.2,2.2) .. controls (-1.0,-0.2) and (1.0,-0.2) .. (2.2,2.2);
  \draw[black, thick] (-2.2,2.2) .. controls (-0.9,2.9) and (0.9,2.9) .. (2.2,2.2);
  \draw[black] (0,0.35) ellipse (2.05 and 0.5);
  % tangent plane (a tilted parallelogram) touching near the base
  \draw[acc, thick, fill=acc!8]
    (-2.0,0.9) -- (1.4,0.35) -- (2.4,1.35) -- (-1.0,1.9) -- cycle;
  % point of tangency
  \fill[black] (0.2,1.12) circle (1.7pt);
  \node[anchor=south, font=\footnotesize] at (0.35,1.2) {$P$};
  % trace tangents
  \draw[acc, thick] (-1.4,0.75) -- (1.7,0.7);
  \node[acc, font=\footnotesize] at (1.85,0.75) {$T_1$};
  \draw[acc, thick] (-0.7,1.85) -- (0.9,0.55);
  \node[acc, font=\footnotesize] at (1.0,0.45) {$T_2$};
\end{tikzpicture}
$$

## Linear approximation

Solving the plane equation for $z$ names the linear function whose graph is the
tangent plane.

> **Definition (Linearization).** The linearization of $f$ at $(a, b)$ is
> $$
> L(x, y) = f(a, b) + f_x(a, b)\,(x - a) + f_y(a, b)\,(y - b).
> $$
> The **linear approximation** (or tangent-plane approximation) is
> $f(x, y) \approx L(x, y)$ for $(x, y)$ near $(a, b)$.

> **Worked example.** Use the linearization of $f(x, y) = 2x^2 + y^2$ at
> $(1, 1)$ to approximate $f(1.1, 0.95)$.
>
> The tangent plane above gives $L(x, y) = 4x + 2y - 3$, so
> $$
> L(1.1, 0.95) = 4(1.1) + 2(0.95) - 3 = 3.3.
> $$
> The true value is $f(1.1, 0.95) = 2(1.21) + 0.9025 = 3.3225$, an error of about
> $0.7\%$ from a formula that needs only the value and two slopes at $(1, 1)$.

## Differentiability

Having partial derivatives at a point is weaker than the surface being smooth
there: a function can possess $f_x$ and $f_y$ at $(a, b)$ yet fail to have a
tangent plane, because the partials only probe two directions. Differentiability
demands that the linear approximation be genuinely good in every direction.

Write the increment $\Delta z = f(a + \Delta x, b + \Delta y) - f(a, b)$ for the
actual change in $f$.

> **Definition (Differentiable).** $f$ is differentiable at $(a, b)$ if the
> increment can be written
> $$
> \Delta z = f_x(a, b)\,\Delta x + f_y(a, b)\,\Delta y
>            + \varepsilon_1\,\Delta x + \varepsilon_2\,\Delta y,
> $$
> where $\varepsilon_1, \varepsilon_2 \to 0$ as $(\Delta x, \Delta y) \to (0, 0)$.

The leading two terms are the tangent-plane change; the $\varepsilon$-terms are
the leftover, which must vanish faster than the step. A differentiable function is
one whose tangent plane approximates the surface well near the point of tangency.
The definition is awkward to check directly, so the working criterion is a
sufficient condition.

> **Theorem (Continuous partials imply differentiability).** If $f_x$ and $f_y$
> exist near $(a, b)$ and are continuous at $(a, b)$, then $f$ is differentiable
> at $(a, b)$.

Every function assembled from polynomials, roots, exponentials, logarithms, and
trigonometric functions by the usual operations has continuous partials on its
domain, so it is differentiable there. For $f(x, y) = x e^{xy}$, both
$f_x = e^{xy}(1 + xy)$ and $f_y = x^2 e^{xy}$ are continuous, so $f$ is
differentiable everywhere; at $(1, 0)$ the linearization is $L(x, y) = x + y$.

## Differentials

For $z = f(x, y)$ the **differentials** $\d x$ and $\d y$ are independent variables,
free to take any value. The **total differential** $\d z$ is defined by

$$
\d z = f_x(x, y)\,\d x + f_y(x, y)\,\d y = \frac{\partial z}{\partial x}\,\d x + \frac{\partial z}{\partial y}\,\d y.
$$

Setting $\d x = \Delta x$ and $\d y = \Delta y$, the differential $\d z$ is the change
in height along the **tangent plane**, while $\Delta z$ is the change in height
along the **surface**. For a differentiable function the two agree closely when
$\d x, \d y$ are small, and $\d z$ is the estimate used in error propagation.

$$
% caption: $\Delta z$ is the true change along the surface; $dz$ is the change
% along the tangent plane. Their difference is the higher-order leftover.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  \definecolor{red}{HTML}{C0392B}
  % base axis for the step
  \draw[black] (0,0) -- (4.6,0);
  \draw[black, dashed] (0,0) -- (0,3.0);
  \draw[black, dashed] (4.0,0) -- (4.0,3.0);
  \node[anchor=north, font=\footnotesize] at (0,0) {($a$, $b$)};
  \node[anchor=north, font=\footnotesize] at (4.0,0) {($a{+}dx$, $b{+}dy$)};
  % surface curve
  \draw[black, thick] (0,1.0) .. controls (2.0,1.4) and (3.0,2.6) .. (4.0,2.95);
  \node[black, font=\footnotesize] at (1.0,1.55) {surface};
  % tangent line (plane trace)
  \draw[acc, thick] (0,1.0) -- (4.6,2.5);
  \node[acc, font=\footnotesize, anchor=west] at (4.35,2.45) {tangent plane};
  % start point
  \fill[black] (0,1.0) circle (1.7pt);
  % dz bracket (tangent) and Delta z bracket (surface)
  \draw[acc, thick] (4.0,1.0) -- (4.0,2.3);
  \node[acc, anchor=west, font=\footnotesize] at (4.05,1.65) {$dz$};
  \draw[red, thick] (4.28,1.0) -- (4.28,2.95);
  \node[red, anchor=west, font=\footnotesize] at (4.33,1.98) {true rise};
\end{tikzpicture}
$$

> **Worked example.** A cylinder is measured as $r = 5$ cm and $h = 20$ cm, each
> to within $0.1$ cm. Estimate the resulting error in the volume $V = \pi r^2 h$.
>
> With $V_r = 2\pi r h$ and $V_h = \pi r^2$, the total differential is
> $$
> \d V = 2\pi r h\,\d r + \pi r^2\,\d h = 200\pi\,\d r + 25\pi\,\d h.
> $$
> Taking $|\d r|, |\d h| \le 0.1$ gives the maximum error
> $$
> \d V = 200\pi(0.1) + 25\pi(0.1) = 22.5\pi \approx 70.7\ \text{cm}^3,
> $$
> a small fraction of $V = 500\pi \approx 1571\ \text{cm}^3$.

## The chain rule

The one-variable chain rule differentiates a composition: if $y = f(x)$ and
$x = g(t)$, then $\dfrac{\d y}{\d t} = \dfrac{\d y}{\d x}\dfrac{\d x}{\d t}$. With several
intermediate variables, the rule becomes a sum with one term per intermediate
route.

> **Theorem (Chain Rule, one parameter).** If $z = f(x, y)$ is differentiable and
> $x = g(t)$, $y = h(t)$ are differentiable, then $z$ is a differentiable function
> of $t$ and
> $$
> \frac{\d z}{\d t} = \frac{\partial f}{\partial x}\frac{\d x}{\d t}
>               + \frac{\partial f}{\partial y}\frac{\d y}{\d t}.
> $$

$$
% caption: Tree diagram for $z=f(x,y)$ with $x,y$ each a function of $t$. Sum the
% two paths from $z$ to $t$, each a partial of $z$ times a derivative of $x$ or $y$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small,
  v/.style={circle, draw, minimum size=7mm, inner sep=0pt, font=\footnotesize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[v, draw=acc] (z) at (0,2.2) {$z$};
  \node[v] (x) at (-1.4,0.8) {$x$};
  \node[v] (y) at (1.4,0.8) {$y$};
  \node[v] (t1) at (-1.4,-0.7) {$t$};
  \node[v] (t2) at (1.4,-0.7) {$t$};
  \draw[acc, thick] (z) -- (x) node[midway, above left, font=\footnotesize] {$z_x$};
  \draw[acc, thick] (z) -- (y) node[midway, above right, font=\footnotesize] {$z_y$};
  \draw[black] (x) -- (t1) node[midway, left, font=\footnotesize] {$x_t$};
  \draw[black] (y) -- (t2) node[midway, right, font=\footnotesize] {$y_t$};
\end{tikzpicture}
$$

> **Worked example.** For $z = x^2 y + 3xy^4$ with $x = \sin 2t$ and $y = \cos t$,
> find $\dfrac{\d z}{\d t}$ at $t = 0$.
>
> The one-parameter rule gives
> $$
> \frac{\d z}{\d t} = (2xy + 3y^4)(2\cos 2t) + (x^2 + 12xy^3)(-\sin t).
> $$
> At $t = 0$: $x = \sin 0 = 0$ and $y = \cos 0 = 1$, so
> $$
> \frac{\d z}{\d t}\bigg|_{t=0} = (0 + 3)(2) + (0 + 0)(0) = 6.
> $$

> **Theorem (Chain Rule, two parameters).** If $z = f(x, y)$ is differentiable and
> $x = g(s, t)$, $y = h(s, t)$ have partial derivatives, then
> $$
> \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},
> \qquad
> \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}.
> $$

Here $s, t$ are the independent variables, $x, y$ the intermediate variables, and
$z$ the dependent variable. Each formula has one term per intermediate variable,
and each term mirrors the one-dimensional chain rule.

The **tree diagram** organizes the bookkeeping. Draw a branch from $z$ to each
variable it depends on, then from each of those to the variables below.
$\partial z / \partial s$ is the sum, over every path from $z$ down to $s$, of the
product of the derivatives along that path.

$$
% caption: Tree diagram for $z=f(x,y)$ with $x,y$ functions of $s,t$. Multiply
% derivatives down each path from $z$ to $s$, then add the paths.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small,
  v/.style={circle, draw, minimum size=7mm, inner sep=0pt, font=\footnotesize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[v, draw=acc] (z) at (0,2.4) {$z$};
  \node[v] (x) at (-1.8,1.0) {$x$};
  \node[v] (y) at (1.8,1.0)  {$y$};
  \node[v] (s1) at (-2.7,-0.5) {$s$};
  \node[v] (t1) at (-0.9,-0.5) {$t$};
  \node[v] (s2) at (0.9,-0.5)  {$s$};
  \node[v] (t2) at (2.7,-0.5)  {$t$};
  \draw[acc, thick] (z) -- (x) node[midway, above left, font=\footnotesize] {$z_x$};
  \draw[acc, thick] (z) -- (y) node[midway, above right, font=\footnotesize] {$z_y$};
  \draw[black] (x) -- (s1) node[midway, left, font=\footnotesize] {$x_s$};
  \draw[black] (x) -- (t1);
  \draw[black] (y) -- (s2);
  \draw[black] (y) -- (t2) node[midway, right, font=\footnotesize] {$y_t$};
\end{tikzpicture}
$$

> **Worked example.** For $z = e^x \sin y$ with $x = st^2$ and $y = s^2 t$, find
> $\dfrac{\partial z}{\partial s}$ and $\dfrac{\partial z}{\partial t}$.
>
> Each partial sums one term per intermediate variable:
> $$
> \frac{\partial z}{\partial s} = (e^x \sin y)(t^2) + (e^x \cos y)(2st),
> $$
> $$
> \frac{\partial z}{\partial t} = (e^x \sin y)(2st) + (e^x \cos y)(s^2).
> $$

The pattern scales without change.

> **Theorem (Chain Rule, general).** If $u$ is a differentiable function of
> $x_1, \dots, x_n$ and each $x_j$ is a differentiable function of
> $t_1, \dots, t_m$, then for each $i$,
> $$
> \frac{\partial u}{\partial t_i} = \sum_{j=1}^{n} \frac{\partial u}{\partial x_j}\frac{\partial x_j}{\partial t_i}.
> $$

## Implicit differentiation

The chain rule sharpens implicit differentiation. Suppose $F(x, y) = 0$ defines
$y$ as a function of $x$. Differentiating both sides with respect to $x$, and
using $\d x/\d x = 1$,
$$
\frac{\partial F}{\partial x}\frac{\d x}{\d x} + \frac{\partial F}{\partial y}\frac{\d y}{\d x} = 0
\;\Longrightarrow\;
\frac{\d y}{\d x} = -\frac{F_x}{F_y}
\quad (F_y \ne 0).
$$

> **Worked example.** Find $\dfrac{\d y}{\d x}$ for the folium of Descartes
> $x^3 + y^3 = 6xy$.
>
> Set $F = x^3 + y^3 - 6xy$. Then $F_x = 3x^2 - 6y$ and $F_y = 3y^2 - 6x$, so
> $$
> \frac{\d y}{\d x} = -\frac{F_x}{F_y} = -\frac{3x^2 - 6y}{3y^2 - 6x}
> = -\frac{x^2 - 2y}{y^2 - 2x}.
> $$

For a surface $F(x, y, z) = 0$ defining $z$ implicitly as $z = f(x, y)$, the same
argument with the three-variable chain rule gives both partials at once.

> **Theorem (Implicit partials).** If $F(x, y, z) = 0$ defines $z$ as a
> differentiable function of $x$ and $y$, and $F_z \ne 0$, then
> $$
> \frac{\partial z}{\partial x} = -\frac{F_x}{F_z},
> \qquad
> \frac{\partial z}{\partial y} = -\frac{F_y}{F_z}.
> $$

$$
% caption: The level surface $F(x,y,z)=0$ defines $z$ as a function of $x,y$
% wherever $F_z\ne 0$; the implicit partials come from the chain rule applied to
% $F=0$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  % a wavy level surface patch
  \draw[acc, thick, fill=acc!8]
    (-2.2,0.3) .. controls (-1.0,1.3) and (1.0,-0.7) .. (2.2,0.3)
    -- (2.6,1.6) .. controls (1.4,0.6) and (-0.6,2.6) .. (-1.8,1.6) -- cycle;
  \node[acc, font=\footnotesize] at (-1.4,0.55) {surface $F=0$};
  % point and vertical (z) direction
  \fill[black] (0.35,0.75) circle (1.7pt);
  \draw[->, black] (0.35,0.75) -- (0.35,2.2) node[above, font=\footnotesize] {$z$};
  \node[anchor=north east, font=\footnotesize] at (0.3,0.7) {($a$, $b$, $c$)};
\end{tikzpicture}
$$

> **Worked example.** Find $\dfrac{\partial z}{\partial x}$ where
> $x^3 + y^3 + z^3 + 6xyz = 1$ defines $z$ implicitly.
>
> Set $F = x^3 + y^3 + z^3 + 6xyz - 1$. Then $F_x = 3x^2 + 6yz$ and
> $F_z = 3z^2 + 6xy$, so
> $$
> \frac{\partial z}{\partial x} = -\frac{F_x}{F_z}
> = -\frac{3x^2 + 6yz}{3z^2 + 6xy} = -\frac{x^2 + 2yz}{z^2 + 2xy}.
> $$
> By symmetry, $\dfrac{\partial z}{\partial y} = -\dfrac{y^2 + 2xz}{z^2 + 2xy}$.

Existence of these functions is underwritten by the Implicit Function Theorem: if
$F(a, b, c) = 0$, $F_z(a, b, c) \ne 0$, and $F_x, F_y, F_z$ are continuous near
$(a, b, c)$, then $F = 0$ does define $z = f(x, y)$ near that point, with the
partials above.[^ift]

Differentiating in an arbitrary direction, rather than along the two axes,
combines both partials into the
[gradient vector](/calculus/partial-derivatives/directional-derivatives-and-the-gradient).

[^ift]: Stewart, §14.5 — the Implicit Function Theorem stated for $F(x, y) = 0$ and $F(x, y, z) = 0$, giving conditions ($F$ continuously differentiable, relevant partial nonzero) under which the implicit function exists and is differentiable.
