AP Calculus AB · Topic 2.8 · Reading guide, about 4 min

Differentiating a product of two functions

The product rule (fg)' = f'g + fg', why it is not a product of derivatives, and how to use it with formulas and tables.

In one minute

When two functions that both depend on xx are multiplied, such as x2exx^2e^x or xsin⁡xx\sin x, you cannot differentiate the factors separately and multiply. The product rule gives the correct derivative: (fg)′=f′g+fg′(fg)'=f'g+fg'.

The rule is short but it is the first one where a tempting shortcut gives a wrong answer, so the skill is partly habit: write down ff, gg, f′f' and g′g' before you combine anything.

Key terms

Product rule
ddx[f(x)g(x)]=f′(x)g(x)+f(x)g′(x)\frac{d}{dx}[f(x)g(x)]=f'(x)g(x)+f(x)g'(x): derivative of the first times the second, plus the first times the derivative of the second.
Factor
One of the two functions being multiplied; in x3ln⁡xx^3\ln x the factors are x3x^3 and ln⁡x\ln x.
Product of derivatives
The expression f′g′f'g', which is not the derivative of fgfg; assuming it is, is the standard error here.
Three-factor product
(fgh)′=f′gh+fg′h+fgh′(fgh)'=f'gh+fg'h+fgh': differentiate one factor at a time and leave the others alone.
Value table
A table listing ff, gg, f′f' and g′g' at particular inputs, so the product rule becomes arithmetic.
Expanding first
Multiplying out a polynomial product before differentiating; a legitimate alternative and a way to check your answer.
Tangent to a product
The line at x=ax=a with slope (fg)′(a)(fg)'(a) through the point (a,f(a)g(a))(a,f(a)g(a)).

Why the derivative of a product is not the product of derivatives

Test the shortcut on something you can check. Let f(x)=xf(x)=x and g(x)=xg(x)=x. The product is x2x^2, whose derivative is 2x2x. The shortcut gives f′g′=1⋅1=1f'g'=1\cdot 1=1, which is wrong. The product rule gives f′g+fg′=1⋅x+x⋅1=2xf'g+fg'=1\cdot x+x\cdot 1=2x, which is right.

Here is the idea behind the rule. Picture a rectangle with sides ff and gg, so the area is fgfg. If both sides grow a little, the area gains a strip along the ff side and a strip along the gg side. The strip of width Δf\Delta f adds g Δfg\,\Delta f, and the strip of height Δg\Delta g adds f Δgf\,\Delta g. The tiny corner piece Δf Δg\Delta f\,\Delta g is so small that it vanishes in the limit. Dividing by the change in xx gives gf′+fg′g f'+f g'.

Using the rule step by step

A reliable layout is a four-line setup. Name the first factor ff and the second gg, then write f′f' and g′g' underneath. Only then substitute into f′g+fg′f'g+fg'. The order of the terms does not matter because addition commutes, but each term keeps one original function and one derivative.

Many products can be handled two ways. For a polynomial product, expanding first is often faster and it provides a check. For anything involving sin⁡x\sin x, exe^x or ln⁡x\ln x, the product rule is usually the natural route. Simplify the final answer only as far as the question needs; when asked for a number, substitute instead of simplifying.

Product rule on common pairs
Productf' g + f g'Result
xsin⁡xx\sin x1⋅sin⁡x+xcos⁡x1\cdot\sin x+x\cos xsin⁡x+xcos⁡x\sin x+x\cos x
x2exx^2e^x2x⋅ex+x2ex2x\cdot e^x+x^2e^xex(x2+2x)e^x(x^2+2x)
x3ln⁡xx^3\ln x3x2ln⁡x+x3⋅1x3x^2\ln x+x^3\cdot\frac1x3x2ln⁡x+x23x^2\ln x+x^2
excos⁡xe^x\cos xexcos⁡x+ex(−sin⁡x)e^x\cos x+e^x(-\sin x)ex(cos⁡x−sin⁡x)e^x(\cos x-\sin x)

A fully worked example

Problem: let y=(x2+3x)(4x−5)y=(x^2+3x)(4x-5). Find y′y' and the tangent line at x=1x=1.

Setup: f=x2+3xf=x^2+3x, so f′=2x+3f'=2x+3. And g=4x−5g=4x-5, so g′=4g'=4.

Apply the rule: y′=(2x+3)(4x−5)+(x2+3x)(4)y'=(2x+3)(4x-5)+(x^2+3x)(4). Multiply the first part: (2x+3)(4x−5)=8x2−10x+12x−15=8x2+2x−15(2x+3)(4x-5)=8x^2-10x+12x-15=8x^2+2x-15. Multiply the second part: 4x2+12x4x^2+12x. Add: y′=12x2+14x−15y'=12x^2+14x-15.

Check by expanding first: (x2+3x)(4x−5)=4x3−5x2+12x2−15x=4x3+7x2−15x(x^2+3x)(4x-5)=4x^3-5x^2+12x^2-15x=4x^3+7x^2-15x. Its derivative is 12x2+14x−1512x^2+14x-15, which matches.

Tangent line at x=1x=1: the slope is y′(1)=12+14−15=11y'(1)=12+14-15=11, and the point is y(1)=(1+3)(4−5)=4(−1)=−4y(1)=(1+3)(4-5)=4(-1)=-4. Using the rule directly at x=1x=1 confirms the slope: f′(1)g(1)+f(1)g′(1)=5(−1)+4(4)=−5+16=11f'(1)g(1)+f(1)g'(1)=5(-1)+4(4)=-5+16=11. So the tangent line is y+4=11(x−1)y+4=11(x-1).

A second example with a transcendental factor: for y=x3ln⁡xy=x^3\ln x, the rule gives y′=3x2ln⁡x+x2y'=3x^2\ln x+x^2. At x=ex=e this is 3e2(1)+e2=4e23e^2(1)+e^2=4e^2, because ln⁡e=1\ln e=1.

Tables, graphs and unknown values

On the exam you often get numbers instead of formulas. Suppose f(2)=3f(2)=3, f′(2)=−1f'(2)=-1, g(2)=5g(2)=5 and g′(2)=4g'(2)=4. Then (fg)′(2)=f′(2)g(2)+f(2)g′(2)=(−1)(5)+(3)(4)=−5+12=7(fg)'(2)=f'(2)g(2)+f(2)g'(2)=(-1)(5)+(3)(4)=-5+12=7. The mistaken shortcut would give (−1)(4)=−4(-1)(4)=-4, a common trap.

With a graph, read each value and each slope from the picture. The values f(a)f(a) and g(a)g(a) are heights, and f′(a)f'(a) and g′(a)g'(a) are the slopes of the tangent lines. Be careful to use the slopes at the same input aa for both functions.

Remember that a constant multiple is not a product of two changing functions. For 5x25x^2 use linearity; for 5x⋅x25x\cdot x^2 you could use either approach, but expanding to 5x35x^3 is simpler.

How it connects

  • Back to 2.6: linearity covers a constant times a function; the product rule covers two functions that both vary.
  • Back to 2.7: products such as xsin⁡xx\sin x and x2exx^2e^x combine the new trig, exponential and log derivatives with powers.
  • Forward to 2.9: the quotient rule has a similar structure with a subtraction and a squared denominator.
  • Forward to 3.1: the chain rule often appears inside a product, for example x e3xx\,e^{3x}.
  • Forward to 3.6: second derivatives of products need the rule applied twice.

Common mistakes

  • Multiplying the derivatives. (fg)′(fg)' is not f′g′f'g'. Test it on x⋅xx\cdot x if you doubt it.
  • Overlooking a hidden product. A term such as xsin⁡xx\sin x is a product even though no parentheses show it. Look for two varying factors multiplied together.
  • Differentiating only one factor. Both terms are required: each factor takes a turn at being differentiated.
  • Arithmetic slips when evaluating. Write ff, f′f', gg and g′g' at the point before substituting, and do not confuse f(2)f(2) with f′(2)f'(2).

How it shows up on the exam

  • Formula derivatives with a polynomial times a trig, exponential or log function, often followed by a tangent line or a horizontal tangent.
  • Table or graph questions that supply ff, gg, f′f' and g′g' at one input and ask for a product derivative.
  • Multiple-choice items where one wrong option is built from the shortcut f′g′f'g', so a student who multiplies the derivatives lands on a listed answer.

Check yourself

  1. Use x⋅x2x\cdot x^2 to show that f′g′f'g' is not (fg)′(fg)'.
  2. What is the derivative of exsin⁡xe^x\sin x, and what is its value at x=0x=0?
  3. When would you expand a product first instead of using the rule?
  4. How would you find the derivative of xexcos⁡xxe^x\cos x?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.