Skip to content
Family Table Math

The Product Rule

How do you differentiate x2sin⁡xx^2 \sin x or xexxe^x? You can’t expand them, and the derivative of a product is not the product of the derivatives. The product rule gives the right answer, and it’s one of the rules you’ll use most for the rest of calculus.

If ff and gg are differentiable, then

ddx[f(x) g(x)]=f′(x) g(x)+f(x) g′(x)\frac{d}{dx}\big[f(x)\,g(x)\big] = f'(x)\,g(x) + f(x)\,g'(x)

In words: derivative of the first times the second, plus the first times the derivative of the second. Some students remember it as "(fg)′=f′g+fg′(fg)' = f'g + fg'".

The order of the two terms doesn’t matter, because they are added.

Think of u=f(x)u = f(x) and v=g(x)v = g(x) as the sides of a rectangle with area uvuv. When xx changes a little, uu grows by Δu\Delta u and vv grows by Δv\Delta v.

A rectangle with sides u and v and area uv. When u grows by Δu and v grows by Δv, the area grows by a strip of area v times Δu on the right, a strip of area u times Δv on top, and a tiny corner of area Δu times Δv. area uv vΔu uΔv ΔuΔv u Δu v Δv
The extra area is v Δu+u Δv+Δu Δvv\,\Delta u + u\,\Delta v + \Delta u\,\Delta v. The tiny corner becomes negligible.

Divide the extra area by Δx\Delta x and let Δx→0\Delta x \to 0. The two strips become v dudx+u dvdxv\,\dfrac{du}{dx} + u\,\dfrac{dv}{dx}, and the corner piece Δu⋅ΔvΔx\Delta u \cdot \dfrac{\Delta v}{\Delta x} goes to 00 (since Δu→0\Delta u \to 0). That’s the product rule.

For a product of three functions, take turns differentiating one factor at a time:

(fgh)′=f′gh+fg′h+fgh′(fgh)' = f'gh + fg'h + fgh'

AP questions often give values instead of formulas. If h(x)=f(x)g(x)h(x) = f(x)g(x), then h′(a)=f′(a)g(a)+f(a)g′(a)h'(a) = f'(a)g(a) + f(a)g'(a), so you just need the four numbers f(a)f(a), f′(a)f'(a), g(a)g(a), and g′(a)g'(a).

Differentiate y=x2sin⁡xy = x^2 \sin x.

Solution. Let f=x2f = x^2 (so f′=2xf' = 2x) and g=sin⁡xg = \sin x (so g′=cos⁡xg' = \cos x):

dydx=2xsin⁡x+x2cos⁡x\frac{dy}{dx} = 2x\sin x + x^2\cos x

Example 2: Two polynomials, checked by expanding

Section titled “Example 2: Two polynomials, checked by expanding”

Find f′(x)f'(x) for f(x)=(3x2−1)(x3+2x)f(x) = (3x^2 - 1)(x^3 + 2x).

Solution. With the product rule:

f′(x)=(6x)(x3+2x)+(3x2−1)(3x2+2)=6x4+12x2+9x4+6x2−3x2−2=15x4+15x2−2\begin{aligned} f'(x) &= (6x)(x^3 + 2x) + (3x^2 - 1)(3x^2 + 2) \\ &= 6x^4 + 12x^2 + 9x^4 + 6x^2 - 3x^2 - 2 \\ &= 15x^4 + 15x^2 - 2 \end{aligned}

Check by expanding first: f(x)=3x5+6x3−x3−2x=3x5+5x3−2xf(x) = 3x^5 + 6x^3 - x^3 - 2x = 3x^5 + 5x^3 - 2x, so f′(x)=15x4+15x2−2f'(x) = 15x^4 + 15x^2 - 2. Same answer.

Let h(x)=f(x)g(x)h(x) = f(x)g(x), where f(3)=2f(3) = 2, f′(3)=−1f'(3) = -1, g(3)=5g(3) = 5, and g′(3)=4g'(3) = 4. Find h′(3)h'(3).

Solution.

h′(3)=f′(3)g(3)+f(3)g′(3)=(−1)(5)+(2)(4)=−5+8=3h'(3) = f'(3)g(3) + f(3)g'(3) = (-1)(5) + (2)(4) = -5 + 8 = 3

Example 4: Tangent line and horizontal tangent

Section titled “Example 4: Tangent line and horizontal tangent”

Let y=xexy = xe^x.

  • (a) Find the tangent line at x=1x = 1.
  • (b) Where is the tangent line horizontal?

Solution. By the product rule:

y′=(1)ex+xex=ex(1+x)y' = (1)e^x + x e^x = e^x(1 + x)

(a) At x=1x = 1: the point is (1,e)(1, e) and the slope is e(2)=2ee(2) = 2e.

y−e=2e(x−1)ory=2ex−ey - e = 2e(x - 1) \quad\text{or}\quad y = 2ex - e

(b) ex(1+x)=0e^x(1 + x) = 0. Since exe^x is never 00, we need 1+x=01 + x = 0, so x=−1x = -1. The point is (−1,−1e)\left(-1, -\dfrac{1}{e}\right).

Multiplying the derivatives. ddx[x2sin⁡x]\dfrac{d}{dx}\big[x^2 \sin x\big] is not 2xcos⁡x2x\cos x. Always two terms: f′g+fg′f'g + fg'.

Forgetting a term. Write the structure first, ”( )( ) + ( )( )”, then fill in the blanks. This also helps with three factors, which need three terms.

Using the product rule when a constant is involved. For 5x35x^3, you can use the product rule, but the constant multiple rule is much faster: 15x215x^2. Save the product rule for when both factors contain xx.

Mixing up values in a table problem. In f′(3)g(3)+f(3)g′(3)f'(3)g(3) + f(3)g'(3), each term has exactly one derivative. Circle the four numbers you need before you substitute.

Over-simplifying and making errors. On the AP exam, an unsimplified correct derivative is fine. Simplify only when you need to, such as when solving y′=0y' = 0 (where factoring, like ex(1+x)e^x(1 + x), is the key step).

1. (Warm-up) Differentiate y=x3exy = x^3 e^x.

Solutiondydx=3x2ex+x3ex=x2ex(3+x)\frac{dy}{dx} = 3x^2 e^x + x^3 e^x = x^2 e^x(3 + x)

2. (Warm-up) Find f′(x)f'(x) for f(x)=xcos⁡xf(x) = x\cos x.

Solutionf′(x)=(1)cos⁡x+x(−sin⁡x)=cos⁡x−xsin⁡xf'(x) = (1)\cos x + x(-\sin x) = \cos x - x\sin x

3. (Warm-up) Let p(x)=f(x)g(x)p(x) = f(x)g(x), where f(1)=4f(1) = 4, f′(1)=2f'(1) = 2, g(1)=−3g(1) = -3, and g′(1)=5g'(1) = 5. Find p′(1)p'(1).

Solutionp′(1)=f′(1)g(1)+f(1)g′(1)=(2)(−3)+(4)(5)=−6+20=14p'(1) = f'(1)g(1) + f(1)g'(1) = (2)(-3) + (4)(5) = -6 + 20 = 14

4. (Core) Find dydx\dfrac{dy}{dx} for y=x ln⁡xy = \sqrt{x}\,\ln x.

Solution

ddx[x]=12x\dfrac{d}{dx}\big[\sqrt{x}\big] = \dfrac{1}{2\sqrt{x}} and ddx[ln⁡x]=1x\dfrac{d}{dx}[\ln x] = \dfrac{1}{x}:

dydx=12xln⁡x+x⋅1x=ln⁡x2x+1x\frac{dy}{dx} = \frac{1}{2\sqrt{x}}\ln x + \sqrt{x}\cdot\frac{1}{x} = \frac{\ln x}{2\sqrt{x}} + \frac{1}{\sqrt{x}}

(Using xx=1x\dfrac{\sqrt{x}}{x} = \dfrac{1}{\sqrt{x}}.)

5. (Core) Find dydx\dfrac{dy}{dx} for y=sin⁡xcos⁡xy = \sin x \cos x.

Solutiondydx=(cos⁡x)(cos⁡x)+(sin⁡x)(−sin⁡x)=cos⁡2x−sin⁡2x\frac{dy}{dx} = (\cos x)(\cos x) + (\sin x)(-\sin x) = \cos^2 x - \sin^2 x

6. (Core) Find the equation of the tangent line to f(x)=(x2+1)(x−3)f(x) = (x^2 + 1)(x - 3) at x=2x = 2.

Solution

Point: f(2)=(5)(−1)=−5f(2) = (5)(-1) = -5.

Slope: f′(x)=2x(x−3)+(x2+1)(1)f'(x) = 2x(x - 3) + (x^2 + 1)(1), so f′(2)=4(−1)+5=1f'(2) = 4(-1) + 5 = 1.

y−(−5)=1(x−2)ory=x−7y - (-5) = 1(x - 2) \quad\text{or}\quad y = x - 7

7. (Core) Find the points where the graph of y=x2exy = x^2 e^x has a horizontal tangent.

Solutiony′=2xex+x2ex=xex(2+x)y' = 2xe^x + x^2 e^x = xe^x(2 + x)

ex≠0e^x \ne 0, so y′=0y' = 0 when x=0x = 0 or x=−2x = -2.

The points are (0,0)(0, 0) and (−2,4e2)\left(-2, \dfrac{4}{e^2}\right).

8. (Challenge) Differentiate y=xexsin⁡xy = xe^x \sin x.

Solution

Use the three-factor rule with f=xf = x, g=exg = e^x, h=sin⁡xh = \sin x:

dydx=(1)exsin⁡x+xexsin⁡x+xexcos⁡x=ex(sin⁡x+xsin⁡x+xcos⁡x)\frac{dy}{dx} = (1)e^x\sin x + x e^x \sin x + x e^x \cos x = e^x\big(\sin x + x\sin x + x\cos x\big)

9. (Challenge) A bakery’s weekly revenue is R(t)=P(t) N(t)R(t) = P(t)\,N(t), where P(t)P(t) is the price of a loaf in dollars and N(t)N(t) is the number of loaves sold per week, tt weeks after opening. At t=4t = 4: P=12P = 12, P′=−0.50P' = -0.50 dollars per week, N=300N = 300, and N′=20N' = 20 loaves per week, per week (sales are growing by 2020 loaves a week, every week). Find R′(4)R'(4) and explain what it means.

SolutionR′(4)=P′(4)N(4)+P(4)N′(4)=(−0.50)(300)+(12)(20)=−150+240=90R'(4) = P'(4)N(4) + P(4)N'(4) = (-0.50)(300) + (12)(20) = -150 + 240 = 90

At t=4t = 4 weeks, the bakery’s weekly revenue is increasing at $90 per week. The price drop alone would lower revenue by $150 per week, but the growth in sales adds $240 per week.