Tutorials › Calculus III › Mixed-Partial Computation Workshop

Computing Partial Derivatives · Tutorial 325 of 999

Mixed-Partial Computation Workshop

Learn to compute mixed second partials carefully by differentiating in each order, keeping track of fixed variables, and checking your results.

Beginner 10 min read

What You'll Learn

  • Read the order of differentiation in mixed-partial notation
  • Compute mixed second partials of polynomials one derivative at a time
  • Apply the quotient rule to rational expressions on their domains
  • Differentiate products of exponential and trigonometric factors
  • Check a mixed partial by computing it in the opposite order
  • Identify common errors involving fixed variables and product rules

Why Mixed-Partial Computation Needs Care

A mixed second partial derivative is obtained by differentiating a function with respect to one variable and then differentiating the result with respect to another. Each step is a one-variable differentiation: while differentiating with respect to one variable, the other variables are held fixed.

The calculations often use familiar rules, but the order matters when organizing the work. One must first interpret the notation, then compute the first partial, and only then differentiate that result. Keeping these stages visible helps prevent errors with product rules, quotient rules, and factors that do not depend on the current variable.

Definition: For a function \(f(x,y)\), define \(f_{xy}\) to mean \((f_x)_y\): first differentiate \(f\) with respect to \(x\), then differentiate the result with respect to \(y\). Define \(f_{yx}\) to mean \((f_y)_x\): first differentiate with respect to \(y\), then with respect to \(x\). The derivatives must exist at the point in question for these values to be defined.

This notation records the order of the operations. In the examples below, the functions have continuous second partial derivatives on their domains, so the two orders agree. In general, equality of \(f_{xy}\) and \(f_{yx}\) is not automatic; it requires suitable hypotheses. The practical check of computing both orders is useful, but matching answers in an example is not by itself a proof of a general equality.

Why the Two Differentiation Steps Work

The definition of a partial derivative makes the order precise. At an interior point where the relevant limits exist, the first step is

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

After this limit produces the function \(f_x\), differentiate that function with respect to \(y\):

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

Thus, the definition itself requires two successive operations. The \(x\)-difference quotient is formed while \(y\) stays fixed; then the resulting function is differentiated while \(x\) stays fixed. Reversing the order starts with a different first limit:

$$ f_{yx}(x,y) = \lim_{h\to 0} \frac{f_y(x+h,y)-f_y(x,y)}{h}. $$

This explains the reliable computational procedure: find the first partial indicated by the notation, simplify it, and take the second partial of that result. The usual one-variable differentiation rules apply at each step, with all other variables treated as constants.

Worked Example: A Polynomial in Two Variables

Worked Example: A Polynomial in Two Variables

Let \(f(x,y)=3x^2y^3-4xy+5x^3+7y^2\). Compute both mixed second partials.

First compute \(f_{xy}\): Differentiate with respect to \(x\). In this step, each power of \(y\) is constant:

$$ f_x = 6xy^3-4y+15x^2+0 = 6xy^3-4y+15x^2. $$

Now differentiate this result with respect to \(y\), holding \(x\) fixed:

$$ f_{xy} = 18xy^2-4+0 = 18xy^2-4. $$

Check by reversing the order: First differentiate the original function with respect to \(y\):

$$ f_y = 9x^2y^2-4x+0+14y = 9x^2y^2-4x+14y. $$

Then differentiate with respect to \(x\):

$$ f_{yx} = 18xy^2-4+0 = 18xy^2-4. $$

Both orders give \(18xy^2-4\). For example, at \((1,2)\), the value is \(18(1)(2^2)-4=72-4=68\). Substituting into either computed expression gives \(68\), as required.

For a polynomial, terms that do not depend on the variable currently being used have derivative zero. Writing those zero contributions at least once can make it easier to see that no term was overlooked.

Worked Example: A Rational Expression

Worked Example: A Rational Expression

Let \(g(x,y)=\frac{x^2}{y+2}+\frac{y}{x+1}\). The function is defined where \(x\ne -1\) and \(y\ne -2\). Compute both mixed partials on this domain.

First compute \(g_{xy}\): With respect to \(x\), the factor \(1/(y+2)\) is constant. Differentiate the second term as \(y(x+1)^{-1}\):

$$ g_x = \frac{2x}{y+2} -\frac{y}{(x+1)^2}. $$

Now differentiate each term with respect to \(y\). In the first term, \(2x\) is constant; in the second, \((x+1)^{-2}\) is constant:

$$ g_{xy} = -\frac{2x}{(y+2)^2} -\frac{1}{(x+1)^2}. $$

Check by reversing the order: Differentiate \(g\) with respect to \(y\) first:

$$ g_y = -\frac{x^2}{(y+2)^2} +\frac{1}{x+1}. $$

Now differentiate with respect to \(x\):

$$ g_{yx} = -\frac{2x}{(y+2)^2} -\frac{1}{(x+1)^2}. $$

The results agree. At \((1,0)\), which lies in the domain, substitution gives

$$ g_{xy}(1,0) = -\frac{2(1)}{(0+2)^2} -\frac{1}{(1+1)^2} = -\frac{2}{4}-\frac{1}{4} = -\frac{3}{4}. $$

The expression for \(g_{yx}\) gives the same value at that point. The domain restrictions matter: the displayed derivative formulas are not defined where either original denominator is zero.

Worked Example: Products of Exponential and Trigonometric Factors

Worked Example: Products of Exponential and Trigonometric Factors

Let \(h(x,y)=e^x\sin y+\cos x\,e^{2y}\). Compute both mixed partials.

First compute \(h_{xy}\): Differentiate with respect to \(x\). The factors involving \(y\) are constant in this step:

$$ h_x = e^x\sin y-\sin x\,e^{2y}. $$

Now differentiate with respect to \(y\). Apply the product rule to each product, treating the factor involving only \(x\) as constant:

$$ h_{xy} = e^x\cos y-2\sin x\,e^{2y}. $$

Check by reversing the order: First differentiate with respect to \(y\):

$$ h_y = e^x\cos y+2\cos x\,e^{2y}. $$

Then differentiate with respect to \(x\):

$$ h_{yx} = e^x\cos y-2\sin x\,e^{2y}. $$

The expressions match. At \((0,0)\),

$$ h_{xy}(0,0) = e^0\cos 0-2\sin 0\,e^0 = 1-0 = 1. $$

Substitution into \(h_{yx}\) also gives \(1\). This calculation shows why it helps to leave each product visible: the derivative of \(\sin y\) contributes \(\cos y\), while differentiating \(e^{2y}\) contributes the factor \(2\).

Worked Example: A Product Rule in Both Orders

Worked Example: A Product Rule in Both Orders

Let \(p(x,y)=(x^2+1)e^y\cos x\). This example has a product of factors depending on \(x\), multiplied by an exponential factor depending on \(y\). Compute the mixed partials.

First compute \(p_{xy}\): Differentiate with respect to \(x\). The factor \(e^y\) is constant, while \((x^2+1)\cos x\) requires the product rule:

$$ p_x = e^y\bigl(2x\cos x-(x^2+1)\sin x\bigr). $$

Differentiate this result with respect to \(y\). The parenthesized expression depends only on \(x\), so it is held fixed:

$$ p_{xy} = e^y\bigl(2x\cos x-(x^2+1)\sin x\bigr). $$

Check by reversing the order: First differentiate with respect to \(y\):

$$ p_y = (x^2+1)e^y\cos x. $$

Differentiate this with respect to \(x\), applying the product rule to \((x^2+1)\cos x\):

$$ p_{yx} = e^y\bigl(2x\cos x-(x^2+1)\sin x\bigr). $$

The two orders agree. At \((0,0)\), the value is \(e^0(0-(1)\cdot 0)=0\), and the expression for \(p_{yx}\) gives the same value.

A Common Mistake: Dropping a Product Factor

Consider \(q(x,y)=e^x\sin y\). A common error when computing \(q_{xy}\) is to notice that \(e^x\) has derivative zero with respect to \(y\), then conclude that the derivative of the whole product is zero. That conclusion incorrectly treats the derivative of one factor as the derivative of the product.

$$ \text{Incorrect:}\qquad \frac{\partial}{\partial y}(e^x\sin y)=0. $$

The product rule gives two terms. Since \(e^x\) is constant with respect to \(y\), its derivative contributes zero, but the derivative of \(\sin y\) does not:

$$ \frac{\partial}{\partial y}(e^x\sin y) = 0\cdot \sin y+e^x\cos y = e^x\cos y. $$

In particular, \(q_x=e^x\sin y\), so the corrected mixed partial is \(q_{xy}=e^x\cos y\). The factor held constant remains in the product; only its own derivative is zero.

A Reliable Computation Routine

Use the same short sequence for each problem. It makes the order explicit and provides a built-in check.

1
Read the subscripts.
For \(f_{xy}\), take the \(x\)-partial first and the \(y\)-partial second. For \(f_{yx}\), reverse those steps.
2
Differentiate one variable at a time.
Hold every other variable fixed, and apply the relevant power, product, or quotient rule.
3
Differentiate the first result.
Do not return to the original function for the second step; differentiate the first partial you just found.
4
Check the work.
Compute the other order when useful, compare the expressions, and substitute a point only after the formulas are established.

Mixed partials are useful in studying how a function's rate of change in one direction varies as another coordinate changes. At this stage, the essential skill is reliable computation: preserve the order, retain factors that are constant rather than zero, and respect the domain of the function.

Check Your Understanding

For each question, write the first partial before taking the second derivative.

  1. For \(f(x,y)=x^3y^2+2xy\), compute \(f_{xy}\) and \(f_{yx}\).
  2. For \(g(x,y)=\frac{x}{y+1}\), state its domain and compute \(g_{xy}\).
  3. For \(h(x,y)=e^y\cos x\), compute both mixed partials.
  4. In computing \(f_{xy}\), which variable is held fixed during the first differentiation?
  5. Why is it incorrect to discard a product merely because one factor has derivative zero with respect to the current variable?