---
title: Partial Derivatives
module: Partial Derivatives
moduleNumber: 11
lessonNumber: 2
order: 1102
summary: >
  A partial derivative holds every variable but one fixed and differentiates in
  the ordinary sense. Geometrically it is the slope of a trace curve cut from the
  surface by a coordinate plane. The freeze-and-differentiate rule computes the
  two first partials; the four second partials follow, and the two mixed ones
  agree under Clairaut's Theorem when they are continuous.
topics: [Partial Derivatives]
draft: false
sources:
  - book: Stewart
    ref: "Ch. 14 — Partial Derivatives; §14.3 Partial Derivatives"
---

The [derivative](/calculus/derivatives/the-derivative-and-rates-of-change) of a
one-variable function measures how the output responds to a change in its single
input. A function of two variables has two inputs, and each can change on its
own. The partial derivative isolates one of them: hold the other fixed, and the
problem collapses to ordinary single-variable differentiation.

## Definition

Fix $y = b$. Then $g(x) = f(x, b)$ is a function of the one variable $x$, and its
derivative at $x = a$ measures how $f$ responds to a change in $x$ alone while $y$
stays at $b$.

> **Definition (First partial derivatives).** The partial derivatives of $f$ at
> $(a, b)$ are
> $$
> f_x(a, b) = \lim_{h \to 0} \frac{f(a + h, b) - f(a, b)}{h},
> \qquad
> f_y(a, b) = \lim_{h \to 0} \frac{f(a, b + h) - f(a, b)}{h},
> $$
> when the limits exist. Letting $(a, b)$ vary turns $f_x$ and $f_y$ into new
> functions of two variables.

Each is an ordinary derivative in disguise: $f_x(a, b) = g'(a)$ where
$g(x) = f(x, b)$, and $f_y(a, b) = G'(b)$ where $G(y) = f(a, y)$. The numerator
in $f_x$ moves only the first slot; the numerator in $f_y$ moves only the second.

This gives the computational rule, using only single-variable differentiation.

> **Rule (Freeze and differentiate).** To find $f_x$, treat $y$ as a constant and
> differentiate $f(x, y)$ with respect to $x$. To find $f_y$, treat $x$ as a
> constant and differentiate with respect to $y$.

> **Worked example.** Find $f_x$ and $f_y$ for $f(x, y) = x^3 + x^2 y^3 - 2y^2$,
> and evaluate at $(2, 1)$.
>
> Treating $y$ as constant, the term $-2y^2$ drops out of $f_x$; treating $x$ as
> constant, the term $x^3$ drops out of $f_y$:
> $$
> f_x = 3x^2 + 2xy^3,
> \qquad
> f_y = 3x^2 y^2 - 4y.
> $$
> At $(2, 1)$: $f_x(2, 1) = 12 + 4 = 16$ and $f_y(2, 1) = 12 - 4 = 8$.

## Notation

Several notations coexist; all mean the same thing. For $z = f(x, y)$,

$$
f_x = \frac{\partial f}{\partial x} = \frac{\partial z}{\partial x} = \partial_x f = D_1 f,
\qquad
f_y = \frac{\partial f}{\partial y} = \frac{\partial z}{\partial y} = \partial_y f = D_2 f.
$$

The rounded $\partial$ distinguishes a partial derivative from the straight $d$
of a single-variable derivative. Unlike $\d y/\d x$, the symbol
$\partial z / \partial x$ is not a genuine ratio of differentials; it is one
indivisible piece of notation, and the closest analogue of a ratio is the
[total differential](/calculus/partial-derivatives/tangent-planes-and-the-chain-rule).

## Geometric interpretation

The graph of $z = f(x, y)$ is a surface $S$. Fix $y = b$: the vertical plane
$y = b$ meets $S$ in a curve $C_1$, namely $z = f(x, b) = g(x)$. The slope of the
tangent to $C_1$ at the point $P = (a, b, f(a, b))$ is exactly $g'(a) = f_x(a, b)$.
Symmetrically, the plane $x = a$ cuts $S$ in a curve $C_2$ whose tangent has slope
$f_y(a, b)$.

> **Interpretation.** $f_x(a, b)$ is the slope of the surface in the
> $x$-direction at $P$; $f_y(a, b)$ is the slope in the $y$-direction. Each is the
> rate of change of $z$ as one variable moves and the other is held.

$$
% caption: The plane $y=b$ slices the surface in the trace $C_1$; viewed head-on,
% the slope of its tangent at $P$ is the partial derivative $f_x(a,b)$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  % the cutting plane y=b, shown head-on as a panel
  \draw[black, fill=acc!6] (-0.4,-0.4) rectangle (5.4,3.4);
  \node[black, font=\footnotesize, anchor=north east] at (5.3,3.3) {plane $y=b$};
  % axes inside the panel
  \draw[->, black] (0,0) -- (5.0,0) node[right, font=\footnotesize] {$x$};
  \draw[->, black] (0,0) -- (0,3.1) node[above, font=\footnotesize] {$z$};
  % trace curve C1: z = f(x,b)
  \draw[acc, very thick] (0.3,0.5) .. controls (1.6,2.4) and (3.0,1.6) .. (4.7,2.9);
  \node[acc, font=\footnotesize, anchor=south east] at (1.15,1.7) {$C_1$};
  % point P and tangent line (slope f_x)
  \coordinate (P) at (2.5,1.75);
  \fill[black] (P) circle (1.7pt);
  \node[anchor=north west, font=\footnotesize] at (2.55,1.7) {$P$};
  % tangent through P (gentle positive slope)
  \draw[acc, thick, dashed] (1.4,1.42) -- (3.7,2.12);
  \node[acc, font=\footnotesize, anchor=north west] at (3.1,1.75) {slope $= f_x$};
  % foot of P marking x=a
  \draw[black, dashed] (2.5,0) -- (P);
  \node[anchor=north, font=\footnotesize] at (2.5,0) {$a$};
\end{tikzpicture}
$$

A heat-index table illustrates the two partials. If $I = f(T, H)$ is the heat
index (perceived temperature) as a function of actual temperature $T$ and
relative humidity $H$, then $f_T(96, 70)$ is the rate at which perceived
temperature rises per degree of actual temperature at fixed humidity, and
$f_H(96, 70)$ is its rate of rise per percentage point of humidity at fixed
temperature. Estimated from a table by symmetric difference quotients,
$f_T(96, 70) \approx 3.75$ and $f_H(96, 70) \approx 0.9$.[^heat]

$$
% caption: The two first partials are slopes in orthogonal directions at the
% same point: $f_x$ along the $x$-axis, $f_y$ along the $y$-axis.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  \definecolor{red}{HTML}{C0392B}
  % small patch of domain (top view) with the point
  \draw[black] (-2.4,0) -- (2.4,0) node[right, font=\footnotesize] {$x$};
  \draw[black] (0,-1.9) -- (0,2.1) node[above, font=\footnotesize] {$y$};
  \fill[black] (0,0) circle (1.7pt);
  \node[anchor=north east, font=\footnotesize] at (-0.05,-0.05) {($a$, $b$)};
  % f_x direction
  \draw[->, acc, very thick] (0,0) -- (1.9,0);
  \node[acc, anchor=south, font=\footnotesize] at (1.5,0.08) {$x$-direction: $f_x$};
  % f_y direction
  \draw[->, red, very thick] (0,0) -- (0,1.7);
  \node[red, anchor=west, font=\footnotesize] at (0.1,1.35) {$y$-direction: $f_y$};
\end{tikzpicture}
$$

## Functions of more variables

Partial derivatives extend to any number of inputs: differentiate with respect to
one variable, holding all others fixed. For $f(x, y, z)$,
$$
f_z(x, y, z) = \lim_{h \to 0} \frac{f(x, y, z + h) - f(x, y, z)}{h},
$$
and $f_x, f_y$ are defined the same way. Nothing about the freeze-and-differentiate
rule changes; there are simply more variables to hold constant.

> **Worked example.** Find all three first partials of
> $f(x, y, z) = e^{xy}\ln z$.
>
> Holding two variables fixed each time:
> $$
> f_x = y e^{xy}\ln z,
> \qquad
> f_y = x e^{xy}\ln z,
> \qquad
> f_z = \frac{e^{xy}}{z}.
> $$
> For $f_x$ and $f_y$ the factor $\ln z$ is a constant multiplier; for $f_z$ the
> factor $e^{xy}$ is constant and $\dfrac{\d}{\d z}\ln z = 1/z$.

## Higher-order partial derivatives

Because $f_x$ and $f_y$ are themselves functions of $x$ and $y$, they can be
differentiated again. This produces four **second partial derivatives**.

| Symbol | Meaning | Also written |
| --- | --- | --- |
| $f_{xx}$ | differentiate by $x$, then $x$ | $\partial^2 f / \partial x^2$ |
| $f_{xy}$ | differentiate by $x$, then $y$ | $\partial^2 f / \partial y\, \partial x$ |
| $f_{yx}$ | differentiate by $y$, then $x$ | $\partial^2 f / \partial x\, \partial y$ |
| $f_{yy}$ | differentiate by $y$, then $y$ | $\partial^2 f / \partial y^2$ |

The two with distinct subscripts, $f_{xy}$ and $f_{yx}$, are the **mixed**
partials. Note the order convention: $f_{xy} = (f_x)_y$ means differentiate by $x$
first, then $y$ — the subscript order and the $\partial$-notation order run
opposite to each other.

> **Worked example.** Compute all four second partials of
> $f(x, y) = x^3 + x^2 y^3 - 2y^2$.
>
> Starting from $f_x = 3x^2 + 2xy^3$ and $f_y = 3x^2 y^2 - 4y$,
> $$
> f_{xx} = 6x + 2y^3,
> \qquad
> f_{yy} = 6x^2 y - 4,
> $$
> $$
> f_{xy} = \frac{\partial}{\partial y}\bigl(3x^2 + 2xy^3\bigr) = 6xy^2,
> \qquad
> f_{yx} = \frac{\partial}{\partial x}\bigl(3x^2 y^2 - 4y\bigr) = 6xy^2.
> $$
> The two mixed partials came out equal, which is no accident.

## Clairaut's Theorem

> **Theorem (Clairaut).** Suppose $f$ is defined on a disk $D$ containing
> $(a, b)$, and both mixed partials $f_{xy}$ and $f_{yx}$ are continuous on $D$.
> Then
> $$
> f_{xy}(a, b) = f_{yx}(a, b).
> $$

When the mixed partials are continuous — the case for every polynomial, rational,
exponential, trigonometric, or logarithmic combination away from singularities —
the order of differentiation does not matter. This cuts the four second partials
effectively to three, and the saving compounds: for third-order and higher
derivatives, any two orderings with the same tally of $x$'s and $y$'s agree, so
$f_{xyy} = f_{yxy} = f_{yyx}$ whenever these are continuous.

$$
% caption: Clairaut's Theorem: differentiating by $x$ then $y$ lands on the same
% function as differentiating by $y$ then $x$, when the results are continuous.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small,
  box/.style={draw, minimum width=15mm, minimum height=9mm, font=\footnotesize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[box] (f)  at (0,0)    {$f$};
  \node[box] (fx) at (2.6,1.2)  {$f_x$};
  \node[box] (fy) at (2.6,-1.2) {$f_y$};
  \node[box, draw=acc] (m) at (5.4,0) {$f_{xy}=f_{yx}$};
  \draw[->, black, thick] (f) -- (fx) node[midway, above, font=\footnotesize] {$D_x$};
  \draw[->, black, thick] (f) -- (fy) node[midway, below, font=\footnotesize] {$D_y$};
  \draw[->, black, thick] (fx) -- (m) node[midway, above, font=\footnotesize] {$D_y$};
  \draw[->, black, thick] (fy) -- (m) node[midway, below, font=\footnotesize] {$D_x$};
\end{tikzpicture}
$$

## Partial differential equations

Second partials appear throughout physics as **partial differential equations**,
relations a function must satisfy at every point. Two carry most of classical
field theory.

- **Laplace's equation** $f_{xx} + f_{yy} = 0$. Its solutions, the harmonic
  functions, describe steady-state temperature, electrostatic potential in
  charge-free regions, and incompressible flow.
- **The wave equation** $u_{tt} = c^2 u_{xx}$. It governs a vibrating string, a
  drumhead, sound, and light, relating the acceleration $u_{tt}$ of a
  displacement to its spatial curvature $u_{xx}$ through the wave speed $c$.

> **Worked example.** Show that $f(x, y) = e^x \sin y$ satisfies Laplace's
> equation.
>
> $$
> f_x = e^x \sin y, \quad f_{xx} = e^x \sin y,
> \qquad
> f_y = e^x \cos y, \quad f_{yy} = -e^x \sin y.
> $$
> Then $f_{xx} + f_{yy} = e^x \sin y - e^x \sin y = 0$, so $f$ is harmonic.

> **Worked example.** Show that $u(x, t) = \sin(x - ct)$ satisfies the wave
> equation $u_{tt} = c^2 u_{xx}$.
>
> Differentiate twice in $t$ with $x$ held, then twice in $x$ with $t$ held:
> $$
> u_t = -c\cos(x - ct), \quad u_{tt} = -c^2 \sin(x - ct),
> $$
> $$
> u_x = \cos(x - ct), \quad u_{xx} = -\sin(x - ct).
> $$
> Hence $u_{tt} = c^2 u_{xx}$. Every twice-differentiable $u(x, t) = F(x - ct)$
> works the same way: the profile $F$ travels rigidly to the right at speed $c$.

$$
% caption: A solution $u(x,t)=F(x-ct)$ of the wave equation is a fixed profile
% sliding to the right at speed $c$; the two snapshots are at times $t_1<t_2$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[->, black] (-0.3,0) -- (6.6,0) node[right, font=\footnotesize] {$x$};
  \draw[->, black] (0,-0.3) -- (0,1.6) node[above, font=\footnotesize] {$u$};
  \draw[acc, thick] plot[domain=0:3.6, samples=60] (\x, {1.05*exp(-(\x-1.7)*(\x-1.7)/0.32)});
  \draw[acc!55, thick, dashed] plot[domain=2.4:6.2, samples=60] (\x, {1.05*exp(-(\x-4.2)*(\x-4.2)/0.32)});
  \node[acc, font=\footnotesize, anchor=south] at (1.7,1.06) {$t_1$};
  \node[acc!70, font=\footnotesize, anchor=south] at (4.2,1.06) {$t_2$};
  \draw[->, black] (2.05,1.25) -- (3.85,1.25) node[midway, above, font=\footnotesize] {speed $c$};
\end{tikzpicture}
$$

The sign of a second partial reports curvature in one direction: $f_{xx} > 0$
means the $x$-trace bends upward (concave up), $f_{xx} < 0$ means it bends down.
Combining the two directions is how the [Second Derivatives Test](/calculus/partial-derivatives/optimization-and-lagrange-multipliers)
classifies a critical point as a peak, a valley, or a saddle.

$$
% caption: The sign of $f_{xx}$ is the concavity of the $x$-trace: $f_{xx}>0$
% bends the trace upward, $f_{xx}<0$ bends it downward.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
  \definecolor{acc}{HTML}{4A6FA5}
  \definecolor{wrm}{HTML}{C0392B}
  % concave up
  \draw[acc, thick] (-3.3,1.0) .. controls (-2.3,-0.9) and (-1.3,-0.9) .. (-0.3,1.0);
  \node[acc, font=\footnotesize, anchor=north] at (-1.8,-0.7) {$f_{xx}>0$};
  \node[acc, font=\footnotesize, anchor=south] at (-1.8,1.02) {concave up};
  % concave down
  \draw[wrm, thick] (0.6,-0.9) .. controls (1.6,1.0) and (2.6,1.0) .. (3.6,-0.9);
  \node[wrm, font=\footnotesize, anchor=south] at (2.1,0.9) {$f_{xx}<0$};
  \node[wrm, font=\footnotesize, anchor=north] at (2.1,-0.7) {concave down};
\end{tikzpicture}
$$

[^heat]: Stewart, §14.3 — the heat-index example, with $f_T$ and $f_H$ estimated from a table of values by averaging forward and backward difference quotients.
