Tutorials › Calculus III › Mixed Second Partial Derivatives

Computing Partial Derivatives · Tutorial 315 of 999

Mixed Second Partial Derivatives

Practise finding \(f_{xy}\) and \(f_{yx}\) step by step, while keeping clear which variable is differentiated first.

Beginner 8 min read

What You'll Learn

  • Interpret \(f_{xy}\) and \(f_{yx}\) as two different orders of differentiation.
  • Compute each mixed partial by differentiating a first partial with respect to the other variable.
  • Apply the partial product rule while keeping track of which factors depend on the variable of differentiation.
  • Check mixed partial calculations by differentiating each first partial directly.
  • Distinguish matching results in examples from a general claim that mixed partials are equal.

What Makes a Partial Derivative Mixed?

A first partial derivative describes how a function changes with respect to one variable while the other variable is held fixed. A mixed second partial derivative is found by taking a first partial and differentiating it with respect to the other variable.

The order matters in the notation. By convention, \(f_{xy}\) means first differentiate \(f\) with respect to \(x\), then differentiate the result with respect to \(y\). In \(f_{yx}\), the first differentiation is with respect to \(y\), followed by differentiation with respect to \(x\).

Definition: If the indicated derivatives exist, then \(f_{xy}=(f_x)_y=\frac{\partial}{\partial y}(f_x)\) and \(f_{yx}=(f_y)_x=\frac{\partial}{\partial x}(f_y)\). In derivative-fraction notation, these are \(\frac{\partial^2 f}{\partial y\,\partial x}\) and \(\frac{\partial^2 f}{\partial x\,\partial y}\), respectively.

Thus, the subscript order records the sequence of operations: read \(f_{xy}\) as “differentiate with respect to \(x\), then with respect to \(y\).” The denominator order in the corresponding derivative fraction reflects that same sequence, with the first differentiation nearest to \(f\).

To compute either mixed partial, find the relevant first partial, then differentiate that expression with respect to the remaining variable. Throughout each differentiation, the variable not being differentiated is treated as constant.

A Step-by-Step Method

The procedure is short, but writing out both stages prevents common errors. In particular, do not skip directly to a second derivative without recording which first partial you are differentiating.

1
Choose the order.
For \(f_{xy}\), start with \(f_x\). For \(f_{yx}\), start with \(f_y\).
2
Compute the first partial.
Differentiate with respect to its indicated variable, treating the other variable as constant.
3
Differentiate again.
Differentiate the first partial with respect to the remaining variable.
4
Check the calculation.
Confirm that the second step differentiates the correct first-partial expression, in the stated order.

Worked Polynomial Example

Worked Example: Compute Both Mixed Partials of a Polynomial

Let \(f(x,y)=3x^2y^3-5xy+4y^2\). Find \(f_{xy}\) and \(f_{yx}\).

First find \(f_x\). Treat \(y\) as constant while differentiating with respect to \(x\):

$$ \begin{aligned} f_x &=\frac{\partial}{\partial x}(3x^2y^3-5xy+4y^2)\\ &=6xy^3-5y+0\\ &=6xy^3-5y. \end{aligned} $$

Now differentiate this expression with respect to \(y\), treating \(x\) as constant:

$$ \begin{aligned} f_{xy} &=\frac{\partial}{\partial y}(6xy^3-5y)\\ &=18xy^2-5. \end{aligned} $$

For the other order, first differentiate \(f\) with respect to \(y\), treating \(x\) as constant:

$$ \begin{aligned} f_y &=\frac{\partial}{\partial y}(3x^2y^3-5xy+4y^2)\\ &=9x^2y^2-5x+8y. \end{aligned} $$

Differentiate this result with respect to \(x\):

$$ \begin{aligned} f_{yx} &=\frac{\partial}{\partial x}(9x^2y^2-5x+8y)\\ &=18xy^2-5. \end{aligned} $$

As a numerical check, at \((x,y)=(1,2)\), both expressions give \(18(1)(2^2)-5=72-5=67\). Each result also follows directly by differentiating its displayed first partial, so the order and the variable held constant are explicit at both stages.

Mixed Partials of a Product

When the function is a product, the first partial may require the partial product rule. For a product \(u(x,y)v(x,y)\), differentiating with respect to \(x\) gives \(u_xv+uv_x\), with \(y\) held fixed. Once the first partial is found, differentiate the whole resulting expression with respect to the other variable.

Worked Example: A Product with Separate Variable Factors

Let \(f(x,y)=(x^2+2x)(y^2-3y)\). Compute both mixed partials.

For \(f_x\), the second factor is constant with respect to \(x\), so only the first factor is differentiated:

$$ \begin{aligned} f_x &=(2x+2)(y^2-3y). \end{aligned} $$

Now differentiate with respect to \(y\). The factor \(2x+2\) is constant in this step:

$$ \begin{aligned} f_{xy} &=(2x+2)(2y-3). \end{aligned} $$

For the reverse order, differentiate with respect to \(y\) first. The factor \(x^2+2x\) is constant with respect to \(y\):

$$ \begin{aligned} f_y &=(x^2+2x)(2y-3). \end{aligned} $$

Then differentiate with respect to \(x\), treating \(2y-3\) as constant:

$$ \begin{aligned} f_{yx} &=(2x+2)(2y-3). \end{aligned} $$

At \((1,2)\), the first factor is \(2(1)+2=4\), and the second is \(2(2)-3=1\), so each mixed partial evaluates to \(4\). The expressions also check directly: differentiating \(f_x\) with respect to \(y\), or \(f_y\) with respect to \(x\), produces the displayed result.

Keeping Track of Both Product Factors

In some products, both factors depend on both variables. Then each partial product rule has two terms. The next example shows why it helps to compute each first partial separately before taking the second derivative.

Worked Example: A Product with Both Variables in Each Factor

Let \(f(x,y)=(x^2+y)(xy+2)\). Find \(f_{xy}\) and \(f_{yx}\).

For the first order, differentiate with respect to \(x\). The first factor has \(x\)-derivative \(2x\), and the second has \(x\)-derivative \(y\):

$$ \begin{aligned} f_x &=2x(xy+2)+(x^2+y)y\\ &=2x^2y+4x+x^2y+y^2\\ &=3x^2y+4x+y^2. \end{aligned} $$

Differentiate the simplified expression with respect to \(y\):

$$ \begin{aligned} f_{xy} &=\frac{\partial}{\partial y}(3x^2y+4x+y^2)\\ &=3x^2+2y. \end{aligned} $$

For the reverse order, the \(y\)-derivatives of the two factors are \(1\) and \(x\):

$$ \begin{aligned} f_y &=1(xy+2)+(x^2+y)x\\ &=xy+2+x^3+xy\\ &=x^3+2xy+2. \end{aligned} $$

Now differentiate with respect to \(x\):

$$ \begin{aligned} f_{yx} &=\frac{\partial}{\partial x}(x^3+2xy+2)\\ &=3x^2+2y. \end{aligned} $$

At \((1,2)\), both results are \(3(1^2)+2(2)=7\). To check the first route, differentiating \(f_x=3x^2y+4x+y^2\) with respect to \(y\) gives \(3x^2+2y\); for the second, differentiating \(f_y=x^3+2xy+2\) with respect to \(x\) gives the same expression.

Why the Two Steps Have This Meaning

The definition of a partial derivative explains why a mixed partial is computed by applying two successive differentiations. When \(f_x\) exists, its value at a point is the limit of a difference quotient in the \(x\)-direction, with \(y\) fixed:

$$ f_x(x,y) = \lim_{h\to 0} \frac{f(x+h,y)-f(x,y)}{h}. $$

For \(f_{xy}\), regard \(f_x(x,y)\) as a function of \(y\), and take its partial derivative with respect to \(y\). The defining quotient is:

$$ f_{xy}(x,y) = \lim_{k\to 0} \frac{f_x(x,y+k)-f_x(x,y)}{k}, $$

provided this limit exists. The inner derivative measures change in \(x\); the outer derivative measures how that \(x\)-derivative changes as \(y\) varies. Reversing the order begins with the corresponding difference quotient for \(f_y\), then differentiates that result with respect to \(x\). These definitions justify the calculation procedure: the first partial must be formed before it is differentiated again.

In the examples, the two orders gave matching formulas. That agreement is something we observed for those particular functions. It is not a rule that can be assumed for every function: whether the orders agree in general requires additional hypotheses and a separate result.

Common Mistake: Differentiating the Wrong Factor

Consider again \(f(x,y)=(x^2+2x)(y^2-3y)\). A common error is to write \(f_x=(2x+2)(2y-3)\), combining the derivative of the first factor with the derivative of the second. This differentiates both factors, even though the requested first derivative is only with respect to \(x\).

$$ \begin{aligned} \text{Incorrect:}\quad f_x&=(2x+2)(2y-3),\\ \text{Correct:}\quad f_x&=(2x+2)(y^2-3y). \end{aligned} $$

When differentiating with respect to \(x\), the entire \(y\)-dependent factor \(y^2-3y\) stays unchanged. The expression \(2y-3\) appears only after taking the next derivative with respect to \(y\). A reliable check is to label each line with the variable being differentiated and state which factor is being held constant.

Why Mixed Partials Are Useful

Mixed partials track how the rate of change in one coordinate direction varies as another coordinate changes. For instance, \(f_x\) describes change in the \(x\)-direction; \(f_{xy}\) describes how that rate itself changes with \(y\). This makes mixed partials useful when describing interactions between variables in a function.

For computation, the key habits are modest but important: write the first partial, preserve all terms that are constant in that step, and take the second derivative in the order specified. Computing both orders separately is especially useful practice; do not infer one simply from the other.

Check Your Understanding

For each question, keep the order of differentiation visible in your working.

  1. For \(f(x,y)=x^3y^2+4xy\), find \(f_{xy}\) and \(f_{yx}\).
  2. For \(g(x,y)=(x+1)(y^2+2y)\), find \(g_x\) and then \(g_{xy}\).
  3. In the notation \(h_{yx}\), which variable is used for the first differentiation?
  4. When finding \(f_x\) for \(f(x,y)=(x^2+y)(xy+2)\), which factors must be differentiated by the partial product rule?
  5. Why do matching mixed-partial formulas in a worked example not by themselves establish a general equality rule?