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.
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
After this limit produces the function \(f_x\), differentiate that function with respect to \(y\):
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:
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:
Now differentiate this result with respect to \(y\), holding \(x\) fixed:
Check by reversing the order: First differentiate the original function with respect to \(y\):
Then differentiate with respect to \(x\):
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}\):
Now differentiate each term with respect to \(y\). In the first term, \(2x\) is constant; in the second, \((x+1)^{-2}\) is constant:
Check by reversing the order: Differentiate \(g\) with respect to \(y\) first:
Now differentiate with respect to \(x\):
The results agree. At \((1,0)\), which lies in the domain, substitution gives
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:
Now differentiate with respect to \(y\). Apply the product rule to each product, treating the factor involving only \(x\) as constant:
Check by reversing the order: First differentiate with respect to \(y\):
Then differentiate with respect to \(x\):
The expressions match. At \((0,0)\),
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:
Differentiate this result with respect to \(y\). The parenthesized expression depends only on \(x\), so it is held fixed:
Check by reversing the order: First differentiate with respect to \(y\):
Differentiate this with respect to \(x\), applying the product rule to \((x^2+1)\cos x\):
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.
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:
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.
For \(f_{xy}\), take the \(x\)-partial first and the \(y\)-partial second. For \(f_{yx}\), reverse those steps.
Hold every other variable fixed, and apply the relevant power, product, or quotient rule.
Do not return to the original function for the second step; differentiate the first partial you just found.
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.
- For \(f(x,y)=x^3y^2+2xy\), compute \(f_{xy}\) and \(f_{yx}\).
- For \(g(x,y)=\frac{x}{y+1}\), state its domain and compute \(g_{xy}\).
- For \(h(x,y)=e^y\cos x\), compute both mixed partials.
- In computing \(f_{xy}\), which variable is held fixed during the first differentiation?
- Why is it incorrect to discard a product merely because one factor has derivative zero with respect to the current variable?