Why Products Require Attention to the Chosen Variable
A product of two functions of \(x\) and \(y\) can change when either variable changes. But a partial derivative asks about change in only one direction at a time: for \(\frac{\partial}{\partial x}\), hold \(y\) fixed; for \(\frac{\partial}{\partial y}\), hold \(x\) fixed. Consequently, a factor that varies in one partial derivative may be constant in the other.
The product rule still applies, but it must be applied separately for each chosen variable. The key is to identify how each factor changes while the other variable is held fixed.
Why the Rule Works
Fix a value of \(y\). As a function of \(x\), the product \(f(x,y)g(x,y)\) is an ordinary product of two one-variable functions. The ordinary product rule therefore gives its derivative with respect to \(x\). The same reasoning, fixing \(x\), gives the rule for the partial derivative with respect to \(y\).
The difference quotient makes the \(x\)-case explicit. Add and subtract \(f(x,y)g(x+h,y)\) in the numerator. For \(h\ne 0\), this gives:
If \(f_x\) and \(g_x\) exist at \((x,y)\), then the corresponding difference quotients tend to \(f_x(x,y)\) and \(g_x(x,y)\). Also, existence of \(f_x(x,y)\) implies \(f(x+h,y)\) tends to \(f(x,y)\) as \(h\) tends to zero. Taking the limit thus gives:
For the \(y\)-partial, fix \(x\) and let \(y\) vary in the same argument. The result is \(f_yg+fg_y\). This reasoning requires the relevant partial derivatives to exist; it does not assume that both factors vary with respect to both variables.
A Reliable Calculation Method
For a product \(F(x,y)=f(x,y)g(x,y)\), write down the rule for the particular variable before simplifying. Then compute the two partial derivatives of the factors with that variable held in mind. A factor independent of the chosen variable has partial derivative zero, but it remains in the other term of the product rule.
For an \(x\)-partial, hold \(y\) constant; for a \(y\)-partial, hold \(x\) constant.
Find both factor derivatives with respect to the chosen variable.
Use the derivative of the first factor times the second, plus the first factor times the derivative of the second.
Confirm that the factors held constant were treated as constants, and verify by viewing the expression as a one-variable product.
Worked Examples
Worked Example: Differentiate \(x^2y\sin x\)
Let \(F(x,y)=x^2y\sin x\). Regard it as the product \(f(x,y)g(x,y)\), where \(f(x,y)=x^2y\) and \(g(x,y)=\sin x\).
For the \(x\)-partial, \(y\) is constant. Therefore \(f_x=2xy\) and \(g_x=\cos x\). Applying the product rule gives:
For the \(y\)-partial, \(x\) is constant. Thus \(f_y=x^2\) and \(g_y=0\), since \(\sin x\) does not change as \(y\) changes. Hence:
To check, fix \(y=2\) and differentiate the one-variable function \(2x^2\sin x\). Its derivative is \(4x\sin x+2x^2\cos x\), which agrees with \(F_x\) after setting \(y=2\). Fixing \(x\) instead, the original expression is \(x^2\sin x\) times \(y\), whose derivative with respect to \(y\) is \(x^2\sin x\), as found above.
Worked Example: Differentiate \((x+y)e^y\)
Let \(G(x,y)=(x+y)e^y\), with factors \(f(x,y)=x+y\) and \(g(x,y)=e^y\).
For the \(x\)-partial, \(y\) is fixed. The derivatives of the factors are \(f_x=1\) and \(g_x=0\), because \(e^y\) is constant with respect to \(x\). Therefore:
For the \(y\)-partial, both factors vary: \(f_y=1\) and \(g_y=e^y\). Applying the rule gives:
For a check, fix \(x=1\). The expression becomes \((1+y)e^y\). Its ordinary derivative is \(e^y+(1+y)e^y=(y+2)e^y\). Setting \(x=1\) in the formula for \(G_y\) also gives \((y+2)e^y\). For the \(x\)-partial, fixing \(y\) makes \(e^y\) constant, so differentiating \((x+y)e^y\) with respect to \(x\) gives \(e^y\), as required.
Worked Example: Differentiate a Product of Two Polynomials
Let \(H(x,y)=(x^2+3y)(2x-y)\). Both factors depend on the variables, but their derivatives differ depending on which variable is chosen. Set \(f=x^2+3y\) and \(g=2x-y\).
For \(x\), with \(y\) fixed, \(f_x=2x\) and \(g_x=2\). Thus:
For \(y\), with \(x\) fixed, \(f_y=3\) and \(g_y=-1\). Therefore:
Check by expanding the original product: \(H=2x^3-x^2y+6xy-3y^2\). Differentiating this expanded expression with respect to \(x\), holding \(y\) fixed, gives \(6x^2-2xy+6y\). Differentiating with respect to \(y\), holding \(x\) fixed, gives \(-x^2+6x-6y\). Both agree with the product-rule results.
Common Mistake: Differentiating the Wrong Factor
A frequent error is to differentiate a factor with respect to a variable that is being held constant, or to use the derivative of the wrong factor. For instance, for \(x^2y\sin x\), an incorrect attempt at the \(x\)-partial might be:
The first term comes from differentiating \(x^2\), but the second term incorrectly differentiates \(y\) as if it changed with \(x\), and also omits the derivative of \(\sin x\). In an \(x\)-partial, \(y\) is fixed, so the factor \(y\) stays in the term arising from differentiating \(x^2\). The sine factor also varies with \(x\). The correct calculation is:
Grouping the expression into two factors does not change this principle. You may choose convenient factors, but the product rule must account for the derivative of each chosen factor with respect to the same variable.
Why This Skill Matters
Products of functions of several variables appear whenever an expression combines quantities that may depend on more than one coordinate. The product rule provides a systematic way to track how the whole expression changes in each coordinate direction. It also makes clear that the two partial derivatives of the same product need not have parallel calculations: one factor may be constant in the \(x\)-direction but variable in the \(y\)-direction.
Before simplifying a result, it is useful to inspect each product-rule term. In \(f_xg+fg_x\), the first term records the change in \(f\) while \(g\) remains as a factor; the second records the change in \(g\) while \(f\) remains as a factor. The \(y\)-partial has the same structure, with \(y\)-derivatives in place of \(x\)-derivatives. Keeping that structure visible reduces errors and makes the result easier to check.
Check Your Understanding
For each question, identify which factors vary with the chosen variable before applying the product rule.
- For \(P(x,y)=xy^2\cos x\), find \(P_x\) and \(P_y\).
- For \(Q(x,y)=(2x-y)e^x\), find \(Q_x\). Which factor has zero \(y\)-partial?
- For \(R(x,y)=(x+y)(x-y)\), find both first partial derivatives using the product rule.
- Explain why \(e^y\) has zero partial derivative with respect to \(x\), even though it is not a constant function of both variables.
- Expand \((x+2y)(3x-y)\), then use the expanded form to check its \(y\)-partial obtained by the product rule.