Tutorials › Calculus III › Product-Rule Errors in Partial Differentiation

Computing Partial Derivatives · Tutorial 324 of 999

Product-Rule Errors in Partial Differentiation

Use the product rule carefully for partial derivatives, then check first, pure second, and mixed derivative calculations.

Beginner 9 min read

What You'll Learn

  • Apply the product rule to a product of functions when taking a partial derivative.
  • Identify which factor derivatives vanish when the other variables are held fixed.
  • Derive the product formula for a pure second partial.
  • Track all four terms in a mixed second partial of a product.
  • Check calculations by expanding a product and differentiating the result.

Why Product-Rule Errors Are Easy to Make

A product can conceal several terms that become visible only after differentiation. When taking a partial derivative, it is tempting to differentiate the factor that appears to depend most strongly on the chosen variable and leave the other factor untouched. That usually omits a term. Repeating the product rule for a second partial creates still more terms, so omitted terms and sign errors become more likely.

The remedy is systematic: identify both factors, differentiate each factor with respect to the chosen variable, and write both product-rule terms before simplifying. For a second partial, apply that procedure again to every term. Holding other variables fixed still matters, but it does not remove the product rule.

Key rule: If \(f(x,y)=u(x,y)v(x,y)\), then differentiating with respect to \(x\) gives one term from differentiating \(u\) and one from differentiating \(v\). Neither term may be discarded unless it is zero.

The First Partial of a Product

Let \(u\) and \(v\) be functions of \(x\) and \(y\), and suppose their relevant partial derivatives exist. When taking a partial derivative with respect to \(x\), treat \(y\) as fixed and apply the ordinary product rule to the resulting one-variable dependence on \(x\).

Product rule for a first partial: For \(f=uv\), $$ f_x=u_xv+uv_x, \qquad f_y=u_yv+uv_y. $$ Each formula includes a term for differentiating each factor. A term may be zero if that factor is independent of the variable of differentiation.

For instance, if \(v\) depends only on \(y\), then \(v_x=0\), so \(f_x=u_xv\). This is not a special product rule: it is the usual rule with one term equal to zero. In general, do not assume a factor is constant merely because it is not the factor you intend to differentiate first.

Worked Example: A First Partial with Two Nonzero Terms

Find \(f_x\) for \(f(x,y)=(x^2+1)(3y-x)\). Set \(u=x^2+1\) and \(v=3y-x\). With \(y\) held fixed, \(u_x=2x\) and \(v_x=-1\). Therefore,

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

To check, expand the original product first: \(f=3x^2y-x^3+3y-x\). Differentiating this expression with respect to \(x\), holding \(y\) fixed, gives \(6xy-3x^2-1\), as above. In particular, the \(-1\) comes from differentiating the second factor; omitting that factor's derivative would give an incorrect result.

Pure Second Partials: Apply the Rule Again

A pure second partial differentiates twice with respect to the same variable. To compute \(f_{xx}\), differentiate the first-partial formula \(f_x=u_xv+uv_x\) once more with respect to \(x\). Each of its two terms is itself a product, so each must be differentiated by the product rule.

$$ \begin{aligned} f_{xx} &=(u_xv+uv_x)_x\\ &=u_{xx}v+u_xv_x+u_xv_x+uv_{xx}\\ &=u_{xx}v+2u_xv_x+uv_{xx}. \end{aligned} $$

The middle term appears twice: once from differentiating \(v\) in \(u_xv\), and once from differentiating \(u\) in \(uv_x\). Combining these two identical terms gives the coefficient \(2\). The corresponding formula for the other variable is \(f_{yy}=u_{yy}v+2u_yv_y+uv_{yy}\), provided the indicated derivatives exist.

Useful check: In a pure second partial of a product, the formula has three contributions: the second derivative of the first factor, twice the product of the first derivatives, and the second derivative of the second factor.

Worked Example: A Pure Second Partial

Let \(g(x,y)=(x^2+y)(xy+1)\). Find \(g_{xx}\). Set \(u=x^2+y\), \(v=xy+1\). Their relevant derivatives are \(u_x=2x\), \(u_{xx}=2\), \(v_x=y\), and \(v_{xx}=0\). Substitution into the pure second-partial formula gives

$$ \begin{aligned} g_{xx} &=u_{xx}v+2u_xv_x+uv_{xx}\\ &=2(xy+1)+2(2x)(y)+(x^2+y)(0)\\ &=2xy+2+4xy\\ &=6xy+2. \end{aligned} $$

Check by expanding before differentiating: \(g=x^3y+x^2+xy^2+y\). Then \(g_x=3x^2y+2x+y^2\), and differentiating again with respect to \(x\) gives \(g_{xx}=6xy+2\). At \((1,2)\), the result is \(6(1)(2)+2=14\). Directly, the formula's terms there are \(2(3)+2(2)(1)(2)+0=6+8=14\).

Mixed Second Partials: Keep Every Contribution

A mixed second partial differentiates with respect to two different variables. Starting with \(f_x=u_xv+uv_x\) and differentiating with respect to \(y\) gives

$$ \begin{aligned} f_{xy} &=(u_xv+uv_x)_y\\ &=u_{xy}v+u_xv_y+u_yv_x+uv_{xy}. \end{aligned} $$

There are four contributions because each of the two terms in \(f_x\) produces two terms when differentiated with respect to \(y\). This formula requires the displayed derivatives to exist. It is a direct repeated product-rule calculation; it does not assume that the order of differentiation can be reversed.

Worked Example: Checking All Terms in a Mixed Partial

Let \(h(x,y)=(x-y)(x^2+y^2)\). Find \(h_{xy}\). Write \(u=x-y\) and \(v=x^2+y^2\). The derivatives needed for the formula are \(u_x=1\), \(u_y=-1\), \(u_{xy}=0\), \(v_x=2x\), \(v_y=2y\), and \(v_{xy}=0\). Thus

$$ \begin{aligned} h_{xy} &=u_{xy}v+u_xv_y+u_yv_x+uv_{xy}\\ &=0(x^2+y^2)+(1)(2y)+(-1)(2x)+(x-y)(0)\\ &=2y-2x. \end{aligned} $$

Check by expansion: \(h=x^3-x^2y+xy^2-y^3\). First \(h_x=3x^2-2xy+y^2\); then differentiating with respect to \(y\) gives \(h_{xy}=-2x+2y\), matching the product calculation. At \((2,1)\), both forms give \(-4+2=-2\).

A Common Mistake: Differentiating Only One Factor

Consider \(q(x,y)=(x^2+1)(y+2x)\). A common incorrect calculation is

$$ q_x \overset{\text{wrong}}{=} 2x(y+2x). $$

This differentiates the first factor but silently treats the second as constant with respect to \(x\). Yet \(y+2x\) depends on \(x\), and its partial derivative is \(2\). The missing contribution is \((x^2+1)(2)\). The correct calculation is

$$ \begin{aligned} q_x &=2x(y+2x)+(x^2+1)(2)\\ &=2xy+4x^2+2x^2+2\\ &=2xy+6x^2+2. \end{aligned} $$

Expansion confirms the correction: \(q=x^2y+2x^3+y+2x\), so \(q_x=2xy+6x^2+2\). The wrong result is missing \(2x^2+2\). A reliable habit is to write both product-rule terms before deciding whether either one vanishes.

How to Audit a Product Derivative

When a result seems unexpectedly short, inspect it before moving on. The following sequence helps locate the most common errors:

1
Name the factors.
Write \(f=uv\), so it is clear which two expressions the product rule applies to.
2
Record both factor derivatives.
Compute \(u_x\) and \(v_x\), or the corresponding derivatives for the variable being used. Holding another variable fixed does not mean holding the chosen variable fixed.
3
Write every product-rule term.
For a first partial, start with \(u_xv+uv_x\). For a second partial, differentiate each term in the first-partial formula.
4
Check signs and simplify.
In particular, preserve negative derivatives such as \((3y-x)_x=-1\).
5
Verify when practical.
Expanding the product and differentiating the expanded expression provides an independent check for polynomial examples.

Why the Systematic Method Matters

Product-rule errors are not merely bookkeeping problems. A missing term in a first partial changes the input to every later calculation that uses that derivative. In a second partial, forgetting one of the two middle contributions can lose the factor of \(2\); in a mixed partial, dropping either cross term can alter the result even when the pure second partials are correct.

The formulas do not say that every displayed contribution must be nonzero. They say that each contribution must be considered. If a factor is independent of the variable of differentiation, its derivative is zero, and the corresponding term disappears for a reason that can be stated and checked. Writing the full formula first makes that distinction visible and helps prevent accidental omissions.

Check Your Understanding

For each question, show the product-rule terms before simplifying.

  1. If \(p(x,y)=(x+y)(x^2-y)\), what is \(p_x\)?
  2. For \(f=uv\), which three contributions appear in \(f_{yy}\)?
  3. Why does the term \(2u_xv_x\) appear in \(f_{xx}\)?
  4. For \(r(x,y)=(x+1)(y^2+x)\), calculate \(r_x\), and identify the term that would be missing if only the first factor were differentiated.
  5. What independent check can be used for a polynomial product derivative?