# Second and Higer Order Partial Derivatives

Calculations of the first, second and higher order partial derivatives are presented with examples and their solutions including detailed steps of computations. Clairaut's theorem on the equality of mixed partials under certain continuity conditions is verified through examples.
The second and higher order partial derivatives are essentially the derivatives of functions of many variables taken multiple times with respect to one or more variables.

## First-Order Partial Derivatives

Given a function $$f(x, y)$$, the first-order partial derivatives are:
With respect to $$x$$: $$\dfrac{\partial f}{\partial x}$$
With respect to $$y$$: $$\dfrac{\partial f}{\partial y}$$

## Second-Order Partial Derivatives

Once we have the first-order derivatives, we can differentiate them again to get second-order derivatives, which are:
With respect to $$x$$ twice: $$\dfrac{\partial^2 f}{\partial x^2}$$
With respect to $$y$$ twice: $$\dfrac{\partial^2 f}{\partial y^2}$$
With respect to $$x$$ and then $$y$$: $$\dfrac{\partial^2 f}{\partial y \partial x}$$
With respect to $$y$$ and then $$x$$: $$\dfrac{\partial^2 f}{\partial x \partial y}$$

## Higher-Order Partial Derivatives

Similarly, we can continue taking derivatives to obtain higher-order partial derivatives. For example, the third-order partial derivative of $$f$$ with respect to $$x$$ twice and then $$y$$ once would be denoted as $$\dfrac{\partial^3 f}{\partial y \partial x^2}$$.

## Examples with Solutions

### Example 1

Calculate the first and second order partial derivatives of $f(x, y) = x^2y + 3xy^2$

### Solution to Example 1 with Detailed Steps

1. First-Order Partial Derivatives
a. Differentiate $$f$$ with respect to $$x$$: $\dfrac{\partial f}{\partial x} = \dfrac{\partial}{\partial x}(x^2y) + \dfrac{\partial}{\partial x}(3xy^2) \\\\ = 2xy + 3y^2$ b. Differentiate $$f$$ with respect to $$y$$: $\dfrac{\partial f}{\partial y} = \dfrac{\partial}{\partial y}(x^2y) + \dfrac{\partial}{\partial y}(3xy^2) \\\\ = x^2 + 6xy$ 2. Second-Order Partial Derivatives
a. Differentiate $$\dfrac{\partial f}{\partial x}$$ with respect to $$x$$: $\dfrac{\partial^2 f}{\partial x^2} = \dfrac{\partial}{\partial x} \left(\dfrac{\partial f}{\partial x} \right) \\\\ =\dfrac{\partial}{\partial x}(2xy + 3y^2) = 2y$ b. Differentiate $$\dfrac{\partial f}{\partial y}$$ with respect to $$y$$: $\dfrac{\partial^2 f}{\partial y^2} = \dfrac{\partial}{\partial y} \left(\dfrac{\partial f}{\partial y} \right) \\\\ = \dfrac{\partial}{\partial y}(x^2 + 6xy) = 6x$ c. Differentiate $$\dfrac{\partial f}{\partial x}$$ with respect to $$y$$: $\dfrac{\partial^2 f}{\partial x \partial y} = \dfrac{\partial }{\partial y} \left(\dfrac{\partial f}{\partial x}\right) \\\\= \dfrac{\partial}{\partial y}(2xy + 3y^2) = 2x + 6y$ d. Differentiate $$\dfrac{\partial f}{\partial y}$$ with respect to $$x$$ (should give the same result as step 3 due to symmetry, if the function's mixed partials are continuous): $\dfrac{\partial^2 f}{\partial y \partial x} = \dfrac{\partial }{\partial x} \left(\dfrac{\partial f}{\partial y}\right) \\\\ =\dfrac{\partial}{\partial x}(x^2 + 6xy) = 2x + 6y$ Notice that $$\dfrac{\partial^2 f}{\partial y \partial x} = \dfrac{\partial^2 f}{\partial x \partial y}$$, which illustrates Clairaut's theorem on the equality of mixed partials under certain continuity conditions.

### Example 2

Calculate the first and second order partial derivatives of the function $g(x, y) = e^{xy} + \sin(x)y^2$ .

### Solution to Example 2 with Detailed Steps

1. First-Order Partial Derivatives
a. Differentiate $$g$$ with respect to $$x$$: $\dfrac{\partial g}{\partial x} = \dfrac{\partial}{\partial x}(e^{xy}) + \dfrac{\partial}{\partial x}(\sin(x)y^2) \\\\= ye^{xy} + \cos(x)y^2$ b. Differentiate $$g$$ with respect to $$y$$: $\dfrac{\partial g}{\partial y} = \dfrac{\partial}{\partial y}(e^{xy}) + \dfrac{\partial}{\partial y}(\sin(x)y^2) \\\\= xe^{xy} + 2y\sin(x)$ 2. Second-Order Partial Derivatives
a. Differentiate $$\dfrac{\partial g}{\partial x}$$ with respect to $$x$$: $\dfrac{\partial^2 g}{\partial x^2} = \dfrac{\partial}{\partial x} \left(\dfrac{\partial g}{\partial x}\right) \\\\=\dfrac{\partial}{\partial x}(ye^{xy} + \cos(x)y^2) \\\\= y^2e^{xy} - y^2\sin(x)$ This step involves applying the product rule for differentiation to both terms separately.
b. Differentiate $$\dfrac{\partial g}{\partial y}$$ with respect to $$y$$: $\dfrac{\partial^2 g}{\partial y^2} = \dfrac{\partial}{\partial y} \left(\dfrac{\partial g}{\partial y}\right) \\\\ = \dfrac{\partial}{\partial y}(xe^{xy} + 2y\sin(x)) \\\\= x^2e^{xy} + 2\sin(x)$ Again, the product rule is applied, this time focusing on how the exponential term and the sine term change with respect to $$y$$.
c. Differentiate $$\dfrac{\partial g}{\partial x}$$ with respect to $$y$$: $\dfrac{\partial^2 g}{\partial x \partial y} = \dfrac{\partial }{\partial y} \left(\dfrac{\partial g}{\partial x}\right) \\\\ = \dfrac{\partial}{\partial y}(ye^{xy} + \cos(x)y^2) \\\\= e^{xy} + xye^{xy} + 2y\cos(x)$ d. Differentiate $$\dfrac{\partial g}{\partial y}$$ with respect to $$x$$ (again, the result is the same as step 3 due to symmetry and the continuity of the mixed partials): $\dfrac{\partial^2 g}{\partial y \partial x} = \dfrac{\partial }{\partial x} \left(\dfrac{\partial g}{\partial y}\right) \\\\ = \dfrac{\partial}{\partial x}(xe^{xy} + 2y\sin(x)) \\\\= e^{xy} + xye^{xy} + 2y\cos(x)$ The equality $$\dfrac{\partial^2 g}{\partial y \partial x} = \dfrac{\partial^2 g}{\partial x \partial y}$$ illustrates Clairaut's theorem on the equality of mixed partials under certain continuity conditions.

### Example 3

Calculate the first-order, the second-order, and two third-order partial derivatives $$\dfrac{\partial^3 f}{\partial y \partial x^2}$$ and $$\dfrac{\partial^3 f}{\partial x \partial y \partial x}$$ of function $$f$$ defined by $f(x, y) = x^3y^2 + x^2e^y$.

### Solution to Example 3 with Detailed Steps

1. First-Order Partial Derivatives
a. With respect to $$x$$: $\dfrac{\partial f}{\partial x} = \dfrac{\partial}{\partial x}(x^3y^2) + \dfrac{\partial}{\partial x}(x^2e^y) \\\\= 3x^2y^2 + 2xe^y$ b. With respect to $$y$$ $\dfrac{\partial f}{\partial y} = \dfrac{\partial}{\partial y}(x^3y^2) + \dfrac{\partial}{\partial y}(x^2e^y) \\\\= 2x^3y + x^2e^y$ 2. Second-Order Partial Derivatives
a. With respect to $$x$$ twice: $\dfrac{\partial^2 f}{\partial x^2} = \dfrac{\partial}{\partial x} \left(\dfrac{\partial f}{\partial x}\right) \\\\ = \dfrac{\partial}{\partial x}(3x^2y^2 + 2xe^y) \\\\= 6xy^2 + 2e^y$ b. With respect to $$y$$ twice: $\dfrac{\partial^2 f}{\partial y^2} = \dfrac{\partial}{\partial y} \left(\dfrac{\partial f}{\partial y}\right) \\\\ = \dfrac{\partial}{\partial y}(2x^3y + x^2e^y) \\\\= 2x^3 + x^2e^y$ c. With respect to $$x$$ then $$y$$: $\dfrac{\partial^2 f}{\partial y \partial x} = \dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right) \\\\ = \dfrac{\partial}{\partial y}(3x^2y^2 + 2xe^y) \\\\ = 6x^2y + 2xe^y$ d. With respect to $$y$$ then $$x$$: $\dfrac{\partial^2 f}{\partial x \partial y} = \dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right)\\\\ = \dfrac{\partial}{\partial x}(2x^3y + x^2e^y) \\\\= 6x^2y + 2xe^y$ In this example we also have the equality $$\dfrac{\partial^2 f}{\partial y \partial x} = \dfrac{\partial^2 f}{\partial x \partial y}$$, which illustrates Clairaut's theorem on the equality of mixed partials under certain continuity conditions.
3. Third-Order Partial Derivatives
a. With respect to $$x$$ twice, then $$y$$: $\dfrac{\partial^3 f}{\partial y \partial x^2} = \dfrac{\partial}{\partial y} \left(\dfrac{\partial^2 f}{\partial x^2} \right) \\\\ = \dfrac{\partial}{\partial y}(6xy^2 + 2e^y) = 12 x y + 2 e^y$ b. With respect to $$x$$, then $$y$$, then $$x$$ again : $\dfrac{\partial^3 f}{\partial x \partial y \partial x} = \dfrac{\partial}{\partial x} \left(\dfrac{\partial^2 f}{\partial x \partial y} \right) \\\\ = \dfrac{\partial}{\partial x}(6x^2y + 2xe^y) = 12xy + 2e^y$

## Clairaut's Theorem

Clairaut's theorem, also known as the equality of mixed partial derivatives, states that if a function $$f(x, y)$$ has continuous second partial derivatives in an open region containing a point $$(a, b)$$, then the order of differentiation of mixed partial derivatives at that point does not affect the result. In other words: $\dfrac{{\partial^2 f}}{{\partial x \partial y}} = \dfrac{{\partial^2 f}}{{\partial y \partial x}}$ Here's a simple example illustrating Clairaut's theorem:
Consider the function $$f(x, y) = x^2y + y^3$$.
First, let usfind the mixed partial derivatives:
1. Find $$\dfrac{{\partial f}}{{\partial x}}$$: $\dfrac{{\partial f}}{{\partial x}} = 2xy$ 2. Find $$\dfrac{{\partial f}}{{\partial y}}$$: $\dfrac{{\partial f}}{{\partial y}} = x^2 + 3y^2$ Now, let's find the mixed partial derivatives:
1. $$\dfrac{{\partial^2 f}}{{\partial x \partial y}}$$: $\dfrac{{\partial^2 f}}{{\partial x \partial y}} = \dfrac{{\partial}}{{\partial x}} \left( \dfrac{{\partial f}}{{\partial y}} \right) = \dfrac{{\partial}}{{\partial x}} (x^2 + 3y^2) = 2x$ 2. $$\dfrac{{\partial^2 f}}{{\partial y \partial x}}$$: $\dfrac{{\partial^2 f}}{{\partial y \partial x}} = \dfrac{{\partial}}{{\partial y}} \left( \dfrac{{\partial f}}{{\partial x}} \right) = \dfrac{{\partial}}{{\partial y}} (2xy) = 2x$ As per Clairaut's theorem, since both mixed partial derivatives are continuous and equal, we have $$\dfrac{{\partial^2 f}}{{\partial x \partial y}} = \dfrac{{\partial^2 f}}{{\partial y \partial x}}$$.