Math Core

Lesson 2.7 · Differentiation: Definition and Basic Rules

The product rule

You can expand (x+3)(x−5)(x + 3)(x - 5) before differentiating, but you can't expand x2sin⁡xx^2 \sin x or exln⁡xe^x \ln x into simpler terms. To differentiate a product of two functions directly, you need the product rule. It is not the rule most people guess first.

The derivative of a product is not the product of derivatives

Try the tempting shortcut on a simple case. The function x⋅x=x2x \cdot x = x^2 has derivative 2x2x. Multiplying the derivatives of the factors gives 1⋅1=11 \cdot 1 = 1, which is wrong. The correct rule has two terms.

The product rule

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: the derivative of the first times the second, plus the first times the derivative of the second.

Check it on x⋅xx \cdot x: 1⋅x+x⋅1=2x1 \cdot x + x \cdot 1 = 2x. Correct.

Why it works

Picture the product f(x) g(x)f(x)\,g(x) as the area of a rectangle with width f(x)f(x) and height g(x)g(x). When xx increases by hh, the width grows by Δf\Delta f and the height grows by Δg\Delta g. The new area is the old rectangle plus three strips:

Δ(area)=Δf⋅g(x)+f(x)⋅Δg+Δf⋅Δg\Delta(\text{area}) = \Delta f \cdot g(x) + f(x) \cdot \Delta g + \Delta f \cdot \Delta g

Divide by hh and let h→0h \to 0. The first strip gives f′(x) g(x)f'(x)\,g(x) and the second gives f(x) g′(x)f(x)\,g'(x). The tiny corner piece Δf⋅Δgh=Δfh⋅Δg\dfrac{\Delta f \cdot \Delta g}{h} = \dfrac{\Delta f}{h} \cdot \Delta g approaches f′(x)⋅0=0f'(x) \cdot 0 = 0, because gg is continuous (it's differentiable). What survives is exactly the product rule.

Using the rule

A reliable method: name the two factors, find each derivative, then assemble.

Worked example: A power times a trig function

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

Let f=x2f = x^2 and g=sin⁡xg = \sin x. Then f′=2xf' = 2x and g′=cos⁡xg' = \cos x.

dydx=f′g+fg′=2xsin⁡x+x2cos⁡x\frac{dy}{dx} = f'g + fg' = 2x\sin x + x^2 \cos x

Worked example: Exponential times logarithm

Differentiate y=exln⁡xy = e^x \ln x.

With f=exf = e^x and g=ln⁡xg = \ln x, you have f′=exf' = e^x and g′=1xg' = \dfrac{1}{x}:

dydx=exln⁡x+ex⋅1x=ex(ln⁡x+1x)\frac{dy}{dx} = e^x \ln x + e^x \cdot \frac{1}{x} = e^x\left(\ln x + \frac{1}{x}\right)

Factoring out exe^x is optional, but it makes the expression easier to set equal to zero or evaluate later.

Should you simplify the result? On the AP exam, an unsimplified derivative like 2xsin⁡x+x2cos⁡x2x\sin x + x^2\cos x earns full credit. Simplify only when it helps with what comes next, such as solving f′(x)=0f'(x) = 0, where factoring is usually the key step.

Products from a table

AP questions often give only values of ff, gg and their derivatives at a few points. You don't need formulas: plug the numbers straight into the product rule.

Worked example: Using a table of values

The table gives values of differentiable functions ff and gg.

xxf(x)f(x)f′(x)f'(x)g(x)g(x)g′(x)g'(x)
25−1-134

If h(x)=f(x) g(x)h(x) = f(x)\,g(x), find h′(2)h'(2).

h′(2)=f′(2) g(2)+f(2) g′(2)=(−1)(3)+(5)(4)=−3+20=17h'(2) = f'(2)\,g(2) + f(2)\,g'(2) = (-1)(3) + (5)(4) = -3 + 20 = 17

Worked example: A tangent line

Find the tangent line to y=xexy = xe^x at x=1x = 1.

The point is (1,e)(1, e). By the product rule, y′=1⋅ex+xex=ex(1+x)y' = 1 \cdot e^x + x e^x = e^x(1 + x), so the slope at x=1x = 1 is 2e2e. The tangent line is

y−e=2e(x−1),ory=2ex−ey - e = 2e(x - 1), \quad \text{or} \quad y = 2ex - e
The tangent line to y = xeˣ at (1, e) has slope 2e ≈ 5.44.Open in grapher →

Common mistake

ddx[f(x) g(x)]≠f′(x) g′(x)\dfrac{d}{dx}\big[f(x)\,g(x)\big] \ne f'(x)\,g'(x). The product rule always has two terms, and each term contains exactly one derivative. If your answer has a term with no derivative, or a term with two, look again.

Tip

A constant factor doesn't need the product rule: ddx[5sin⁡x]=5cos⁡x\dfrac{d}{dx}[5\sin x] = 5\cos x by the constant multiple rule. (The product rule would also work; the constant's derivative is 0, so one term drops out.) Save the product rule for two factors that both contain xx.

Practice

Practice 1

Find f′(x)f'(x) for f(x)=x3exf(x) = x^3 e^x.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 2

Find dydx\dfrac{dy}{dx} for y=xcos⁡xy = x\cos x.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 3

The functions ff and gg are differentiable, with f(1)=3f(1) = 3, f′(1)=−2f'(1) = -2, g(1)=4g(1) = 4 and g′(1)=5g'(1) = 5. If h(x)=f(x) g(x)h(x) = f(x)\,g(x), find h′(1)h'(1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Let f(x)=(x2+1)(3x−2)f(x) = (x^2 + 1)(3x - 2). Use the product rule to find f′(1)f'(1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Let f(x)=xln⁡xf(x) = x \ln x. Find f′(e)f'(e).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

What is ddx[sin⁡xcos⁡x]\dfrac{d}{dx}\big[\sin x \cos x\big]?

Practice 7

Find all xx in the interval 0≤x<2π0 \le x \lt 2\pi where f(x)=exsin⁡xf(x) = e^x \sin x has a horizontal tangent line.

Separate answers with commas, e.g. 2, -5

Practice 8

Find an equation of the tangent line to y=xexy = xe^x at x=0x = 0.

Enter an expression, e.g. 3x^2 - 2x + 1