Unit 3, lesson 23

The Product Rule

Why the derivative of a product is not the product of the derivatives, what the correct rule is, how a growing rectangle explains it, how to prove it, and how it extends to three or more factors.

  • Theory part 45
  • Practice part 46
  • Differentiation Rules

Theory, part 45

Nothing loads from YouTube until you press play.

Practice, part 46

Nothing loads from YouTube until you press play.

A tempting guess is that the derivative of fgf g is f′g′f' g'. It fails at once, because x⋅x=x2x \cdot x = x^2 has derivative 2x2x while 1⋅1=11 \cdot 1 = 1. The correct rule has two terms, one for each factor changing while the other holds still, and a picture of a growing rectangle makes it look obvious.

Key terms

Product rule

Definition If ff and gg are both differentiable at xx, then fgf g is differentiable at xx and

(fg)′(x)=f′(x)g(x)+f(x)g′(x).(f g)'(x) = f'(x) g(x) + f(x) g'(x).

In Leibniz notation, with u=f(x)u = f(x) and v=g(x)v = g(x), this reads

ddx(uv)=dudxv+udvdx.\frac{d}{dx}(uv) = \frac{du}{dx} v + u \frac{dv}{dx}.

In plain words Differentiate the first factor and keep the second, then keep the first and differentiate the second, and add.

Example Let y=(x2+1)(x3−2x)y = (x^2 + 1)(x^3 - 2x). Then

y′=2x(x3−2x)+(x2+1)(3x2−2)=5x4−3x2−2.y' = 2x(x^3 - 2x) + (x^2 + 1)(3x^2 - 2) = 5x^4 - 3x^2 - 2.

Multiplying out first gives y=x5−x3−2xy = x^5 - x^3 - 2x and the same derivative, which is a good check.

Geometric explanation

Definition Let u=f(x)u = f(x) and v=g(x)v = g(x) be the sides of a rectangle with area uvuv. When xx changes to x+hx + h, write Δu=f(x+h)−f(x)\Delta u = f(x + h) - f(x) and Δv=g(x+h)−g(x)\Delta v = g(x + h) - g(x). Then exactly

(u+Δu)(v+Δv)−uv=u Δv+v Δu+Δu Δv.(u + \Delta u)(v + \Delta v) - uv = u \, \Delta v + v \, \Delta u + \Delta u \, \Delta v.

The change in area is two thin strips, u Δvu \, \Delta v along one side and v Δuv \, \Delta u along the other, plus a small corner Δu Δv\Delta u \, \Delta v. After dividing by hh, the corner term is Δu⋅Δvh\Delta u \cdot \frac{\Delta v}{h}, which tends to 0⋅g′(x)=00 \cdot g'(x) = 0.

In plain words When both sides of a rectangle grow a little, the new area is mostly two strips. The corner piece is so small it does not count in the limit.

Example Take u=3u = 3, v=5v = 5, Δu=0.1\Delta u = 0.1 and Δv=0.2\Delta v = 0.2. The new area is 3.1⋅5.2=16.123.1 \cdot 5.2 = 16.12, so the area grew by 1.121.12. The strips give 3⋅0.2+5⋅0.1=1.13 \cdot 0.2 + 5 \cdot 0.1 = 1.1 and the corner gives 0.1⋅0.2=0.020.1 \cdot 0.2 = 0.02, which add to 1.121.12.

Proof from difference quotients

Definition Add and subtract f(x+h)g(x)f(x + h) g(x) in the numerator.

f(x+h)g(x+h)−f(x)g(x)h=f(x+h)⋅g(x+h)−g(x)h+g(x)⋅f(x+h)−f(x)h.\frac{f(x + h) g(x + h) - f(x) g(x)}{h} = f(x + h) \cdot \frac{g(x + h) - g(x)}{h} + g(x) \cdot \frac{f(x + h) - f(x)}{h}.

As h→0h \to 0 the second difference quotient tends to f′(x)f'(x) and the first to g′(x)g'(x). Also f(x+h)→f(x)f(x + h) \to f(x), because ff is differentiable and therefore continuous at xx. By the limit laws the whole expression tends to f(x)g′(x)+g(x)f′(x)f(x) g'(x) + g(x) f'(x).

In plain words One small algebra trick splits the change in the product into the change caused by gg and the change caused by ff. Each piece becomes a familiar derivative.

Example Take f(x)=x2f(x) = x^2 and g(x)=x3g(x) = x^3 at x=1x = 1, so fg=x5f g = x^5 and the derivative should be 55. The two pieces of the split for shrinking hh are shown below, rounded to four decimal places.

hhf(1+h)⋅g(1+h)−g(1)hf(1 + h) \cdot \frac{g(1 + h) - g(1)}{h}g(1)⋅f(1+h)−f(1)hg(1) \cdot \frac{f(1 + h) - f(1)}{h}Sum
0.10.14.00514.00512.12.16.10516.1051
0.010.013.09103.09102.012.015.10105.1010
0.0010.0013.00903.00902.0012.0015.01005.0100

The pieces approach f(1)g′(1)=3f(1) g'(1) = 3 and g(1)f′(1)=2g(1) f'(1) = 2, and the sum approaches 55.

Products of several functions

Definition If ff, gg and kk are differentiable at xx, then applying the product rule twice gives

(fgk)′=f′gk+fg′k+fgk′.(f g k)' = f' g k + f g' k + f g k'.

In general, the derivative of a product of nn differentiable functions is a sum of nn terms, where each term differentiates one factor and leaves the others unchanged. In particular, for a positive integer nn and ff differentiable at xx,

ddx(f(x)n)=nf(x)n−1f′(x).\frac{d}{dx}\left(f(x)^n\right) = n f(x)^{n - 1} f'(x).

In plain words Take turns. Each factor gets differentiated once while the rest stay as they are, and you add up all the turns.

Example For y=x(x+1)(x+2)y = x(x + 1)(x + 2) at x=1x = 1, the three terms are 1⋅2⋅3=61 \cdot 2 \cdot 3 = 6, 1⋅1⋅3=31 \cdot 1 \cdot 3 = 3 and 1⋅2⋅1=21 \cdot 2 \cdot 1 = 2, so y′(1)=11y'(1) = 11. Expanding, y=x3+3x2+2xy = x^3 + 3x^2 + 2x and y′=3x2+6x+2y' = 3x^2 + 6x + 2, which is also 1111 at x=1x = 1. For a power, the last formula gives

ddx((x2+1)3)=3(x2+1)2⋅2x=6x(x2+1)2.\frac{d}{dx}\left((x^2 + 1)^3\right) = 3(x^2 + 1)^2 \cdot 2x = 6x(x^2 + 1)^2.

Check yourself

  1. Differentiate y=(2x−1)(x2+4)y = (2x - 1)(x^2 + 4) with the product rule.
Show the answer

The rule gives

y′=2(x2+4)+(2x−1)(2x)=6x2−2x+8.y' = 2(x^2 + 4) + (2x - 1)(2x) = 6x^2 - 2x + 8.

Expanding first gives y=2x3−x2+8x−4y = 2x^3 - x^2 + 8x - 4 and the same answer.

  1. Suppose f(2)=3f(2) = 3, f′(2)=−1f'(2) = -1, g(2)=4g(2) = 4 and g′(2)=5g'(2) = 5. Find (fg)′(2)(f g)'(2).
Show the answer

By the product rule

(fg)′(2)=f′(2)g(2)+f(2)g′(2)=(−1)(4)+(3)(5)=11.(f g)'(2) = f'(2) g(2) + f(2) g'(2) = (-1)(4) + (3)(5) = 11.
  1. Find the derivative of y=x (x2+1)y = \sqrt{x}\,(x^2 + 1) for x>0x > 0.
Show the answer

The product rule gives

y′=12x(x2+1)+x⋅2x=x2+12x+4x22x=5x2+12x.y' = \frac{1}{2\sqrt{x}}(x^2 + 1) + \sqrt{x} \cdot 2x = \frac{x^2 + 1}{2\sqrt{x}} + \frac{4x^2}{2\sqrt{x}} = \frac{5x^2 + 1}{2\sqrt{x}}.

How this lesson connects