#math/calculus
First partial derivatives record slope in each coordinate direction. To see how those slopes themselves change—and how the directions interact—we differentiate them again. Because $f_x$ and $f_y$ are functions, this produces
$
f_{xx},\quad f_{xy}=\frac{\partial}{\partial y}f_x,
\quad f_{yx}=\frac{\partial}{\partial x}f_y,
\quad f_{yy}.
$
The order is read from the inside out. For
$
f(x,y)=x^2y+\sin(x-y),
$
$
f_{xy}=2x+\sin(x-y)=f_{yx}.
$
The key result is `equality of mixed partials`: if the second partial derivatives are continuous near a point, then
$
f_{xy}=f_{yx}
$
there. Equality can fail when the regularity assumption fails; existence of both first partials is not enough.
Concretely, $f_{xy}$ means first finding $f_x$, the slope in the $x$-direction, and then differentiating it with respect to $y$. It therefore measures how the $x$-direction slope changes as you move in the $y$-direction. Conversely, $f_{yx}$ measures how the $y$-direction slope changes as you move in the $x$-direction. When the second partials are continuous, these two measurements agree even though they begin with different directional slopes.
![[tikz-mixed-partials-3d.svg]]
%% tikz-source
```latex
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{groupplots}
\usetikzlibrary{arrows.meta,calc}
\begin{document}
\begin{tikzpicture}[>=Stealth]
\begin{groupplot}[
group style={group size=2 by 1,horizontal sep=1.7cm},
width=8.4cm,height=7.2cm,
view={-48}{27},
xmin=-1.35,xmax=1.35,
ymin=-1.35,ymax=1.35,
zmin=-1.85,zmax=1.85,
xlabel={$x$},ylabel={$y$},zlabel={$z$},
axis lines=center,
ticklabel style={font=\scriptsize},
label style={font=\small},
xtick={-1,0,1},ytick={-1,0,1},ztick={-1,0,1},
grid=major,
grid style={black!12},
axis line style={black!55,-Stealth},
clip=false,
colormap={saddleshade}{color(0cm)=(blue!18);color(1cm)=(orange!28)}
]
\nextgroupplot[
title={\Large $f_{xy}$: watch the $x$-slope as $y$ changes},
title style={align=center,yshift=3mm}
]
\addplot3[surf,shader=flat,opacity=.55,draw=black!18,
samples=19,samples y=19,domain=-1.3:1.3,domain y=-1.3:1.3]
{x*y};
% Red traces run in the x-direction; their slopes are f_x=y.
\addplot3[red!75!black,ultra thick,domain=-1.3:1.3,samples=2]
({x},{0},{0});
\addplot3[red!75!black,ultra thick,domain=-1.3:1.3,samples=2]
({x},{1},{x});
\node[fill=white,fill opacity=.88,text opacity=1,rounded corners=1pt,
inner sep=2pt,font=\scriptsize,anchor=north west]
at (axis cs:1.15,0,0) {$y=0:\ f_x=0$};
\node[fill=white,fill opacity=.88,text opacity=1,rounded corners=1pt,
inner sep=2pt,font=\scriptsize,anchor=south west]
at (axis cs:1.0,1,1.0) {$y=1:\ f_x=1$};
% The blue arrow shows the second differentiation direction.
\draw[blue!75!black,ultra thick,->]
(axis cs:-.95,0,-1.65) -- (axis cs:-.95,1,-1.65)
node[midway,fill=white,inner sep=1.5pt,font=\scriptsize,sloped,above]
{move in $+y$};
\node[draw=red!65!black,fill=white,rounded corners=2pt,
font=\small,align=center,inner sep=4pt]
at (rel axis cs:.50,-.13)
{$x$-slope rises from $0$ to $1$\\$\Rightarrow\ f_{xy}=1$};
\nextgroupplot[
title={\Large $f_{yx}$: watch the $y$-slope as $x$ changes},
title style={align=center,yshift=3mm}
]
\addplot3[surf,shader=flat,opacity=.55,draw=black!18,
samples=19,samples y=19,domain=-1.3:1.3,domain y=-1.3:1.3]
{x*y};
% Blue traces run in the y-direction; their slopes are f_y=x.
\addplot3[blue!75!black,ultra thick,domain=-1.3:1.3,samples=2]
({0},{x},{0});
\addplot3[blue!75!black,ultra thick,domain=-1.3:1.3,samples=2]
({1},{x},{x});
\node[fill=white,fill opacity=.88,text opacity=1,rounded corners=1pt,
inner sep=2pt,font=\scriptsize,anchor=north east]
at (axis cs:0,1.15,0) {$x=0:\ f_y=0$};
\node[fill=white,fill opacity=.88,text opacity=1,rounded corners=1pt,
inner sep=2pt,font=\scriptsize,anchor=south west]
at (axis cs:1,1,1) {$x=1:\ f_y=1$};
% The red arrow shows the second differentiation direction.
\draw[red!75!black,ultra thick,->]
(axis cs:0,-.95,-1.65) -- (axis cs:1,-.95,-1.65)
node[midway,fill=white,inner sep=1.5pt,font=\scriptsize,sloped,above]
{move in $+x$};
\node[draw=blue!65!black,fill=white,rounded corners=2pt,
font=\small,align=center,inner sep=4pt]
at (rel axis cs:.50,-.13)
{$y$-slope rises from $0$ to $1$\\$\Rightarrow\ f_{yx}=1$};
\end{groupplot}
\node[draw=green!45!black,very thick,fill=green!7,rounded corners=3pt,
align=center,inner sep=5pt,font=\small]
at ($(group c1r1.south)!0.5!(group c2r1.south)+(0,-1.45cm)$)
{On the same surface $z=xy$:\quad
$f_x=y\Rightarrow f_{xy}=1$,\qquad
$f_y=x\Rightarrow f_{yx}=1$.
\quad Therefore $\boxed{f_{xy}=f_{yx}}$.};
\end{tikzpicture}
\end{document}
```
%%
Second partials describe local bending and appear in differential equations. A harmonic function satisfies Laplace's equation
$
f_{xx}+f_{yy}=0,
$
while a one-dimensional wave $u(x,t)$ satisfies $u_{tt}=c^2u_{xx}$.
Arranged as
$
H_f=
\begin{bmatrix}
f_{xx}&f_{xy}\\
f_{yx}&f_{yy}
\end{bmatrix},
$
they form the Hessian, used in [[16C2 - Hessian and the Second Derivative Test|second-order optimization]]. Thus $f_{xx}$ describes bending in the $x$-direction, $f_{yy}$ describes bending in the $y$-direction, and $f_{xy}=f_{yx}$ describes how the slope in one coordinate direction changes as you move in the other—the local coupling between the two directions.