Higher-Order Partial Derivatives — Theory
1. What is a partial derivative?
A partial derivative measures how a multivariable function changes when one variable changes
and the other variables are held constant.
\[
f_x=\frac{\partial f}{\partial x},
\qquad
f_y=\frac{\partial f}{\partial y}.
\]
For a function \(f(x,y)\), \(f_x\) means differentiate with respect to \(x\) while treating
\(y\) as constant. Similarly, \(f_y\) means differentiate with respect to \(y\) while treating
\(x\) as constant.
2. Higher-order partial derivatives
Higher-order partial derivatives are found by differentiating more than once.
\[
f_{xx}
=
\frac{\partial}{\partial x}
\left(
\frac{\partial f}{\partial x}
\right),
\qquad
f_{xy}
=
\frac{\partial}{\partial y}
\left(
\frac{\partial f}{\partial x}
\right).
\]
The subscript tells the order of differentiation. For example, \(f_{xxy}\) means:
\[
f_{xxy}
=
\frac{\partial}{\partial y}
\left(
\frac{\partial}{\partial x}
\left(
\frac{\partial f}{\partial x}
\right)
\right).
\]
3. Second-order partial derivatives
For a function \(f(x,y)\), the second-order partial derivatives are:
\[
f_{xx},\qquad f_{xy},\qquad f_{yx},\qquad f_{yy}.
\]
The derivatives \(f_{xx}\) and \(f_{yy}\) are unmixed second partials. The derivatives
\(f_{xy}\) and \(f_{yx}\) are mixed second partials.
4. The Hessian matrix
The Hessian matrix collects all second-order partial derivatives in matrix form.
For a function \(f(x,y)\),
\[
H_f
=
\begin{bmatrix}
f_{xx} & f_{xy}\\
f_{yx} & f_{yy}
\end{bmatrix}.
\]
For a function \(f(x,y,z)\), the Hessian is:
\[
H_f
=
\begin{bmatrix}
f_{xx} & f_{xy} & f_{xz}\\
f_{yx} & f_{yy} & f_{yz}\\
f_{zx} & f_{zy} & f_{zz}
\end{bmatrix}.
\]
The Hessian is important in optimization because it helps classify critical points.
5. Clairaut’s theorem
Clairaut’s theorem gives a condition under which mixed partial derivatives are equal.
If \(f_{xy}\) and \(f_{yx}\) are continuous near a point, then
\[
f_{xy}=f_{yx}.
\]
For higher-order derivatives, the same idea applies. If the relevant derivatives are continuous,
then mixed partials with the same variables but in different orders are equal.
\[
f_{xxy}=f_{xyx}=f_{yxx}.
\]
6. Example: \(f(x,y)=e^{xy}\)
Start with
\[
f(x,y)=e^{xy}.
\]
First partial derivatives:
\[
f_x=ye^{xy},
\qquad
f_y=xe^{xy}.
\]
Second partial derivatives:
\[
f_{xx}=y^2e^{xy},
\qquad
f_{yy}=x^2e^{xy}.
\]
For the mixed partial:
\[
f_{xy}
=
\frac{\partial}{\partial y}
\left(ye^{xy}\right)
=
e^{xy}+xye^{xy}.
\]
Also,
\[
f_{yx}
=
\frac{\partial}{\partial x}
\left(xe^{xy}\right)
=
e^{xy}+xye^{xy}.
\]
Therefore,
\[
f_{xy}=f_{yx}.
\]
7. Third-order partial derivatives
Third-order partial derivatives are found by differentiating three times. Examples include:
\[
f_{xxx},\qquad
f_{xxy},\qquad
f_{xyy},\qquad
f_{yyy}.
\]
Under continuity assumptions, mixed third partials with the same variables are equal:
\[
f_{xxy}=f_{xyx}=f_{yxx},
\qquad
f_{xyy}=f_{yxy}=f_{yyx}.
\]
8. Derivative words
This calculator uses a derivative word to show the order of differentiation.
10. Why the continuity condition matters
Clairaut’s theorem is not just an algebraic rule. It requires continuity of the relevant mixed
partial derivatives near the point. In most standard calculus examples involving polynomials,
exponentials, logarithms on their domains, and trigonometric functions, this condition is satisfied.
For unusual piecewise functions, mixed partials may fail to be equal at some points.
That is why a calculator can check equality numerically, but the theorem itself depends on
mathematical assumptions about continuity.
11. Common mistakes
- Forgetting which variables are constants: when differentiating with respect to \(x\), treat \(y\) and \(z\) as constants.
- Mixing up derivative order: \(f_{xy}\) means differentiate with respect to \(x\), then \(y\).
- Assuming mixed partials always agree: equality requires continuity assumptions.
- Confusing the Hessian with the gradient: the gradient contains first partials, while the Hessian contains second partials.
- Using a graph as a proof: the graph helps visualize behavior, but equality of mixed partials is a theorem-based statement.
- Evaluating at a point outside the domain: logarithms, square roots, and fractions can have restricted domains.