Skip to content

Unit 2: Differentiation: Definition and Fundamental Properties

The Product Rule

Differentiate a product of two or more functions, given by formulas or by tables of values, and see from a growing rectangle why the rule has two terms.

Topic 2.8 · 6 min read

The derivative of a sum is the sum of the derivatives (topic 2.6), so it is tempting to guess that the derivative of a product is the product of the derivatives. Test the guess on x⋅x=x2x\cdot x = x^2: each factor has derivative 1, so the guess says the derivative is 1⋅1=11\cdot 1 = 1, but the derivative of x2x^2 is 2x2x. The correct rule has two terms, f′g+fg′f'g + fg', and the reason is visible in the area of a rectangle.

Why a product's derivative has two terms

Picture 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). Now let xx increase by a small amount Δx\Delta x. The width grows by Δf\Delta f and the height by Δg\Delta g, and the rectangle gains three new pieces.

A rectangle of width f(x) and height g(x), with area f times g. Increasing x adds a strip on the right of width delta f and height g (area g times delta f), a strip on top of width f and height delta g (area f times delta g), and a small corner square of area delta f times delta g.

The change in area is

Δ(fg)=g Δf+f Δg+Δf Δg.\Delta(fg) = g\,\Delta f + f\,\Delta g + \Delta f\,\Delta g.

Divide by Δx\Delta x to get an average rate of change:

Δ(fg)Δx=g ΔfΔx+f ΔgΔx+Δf⋅ΔgΔx.\frac{\Delta(fg)}{\Delta x} = g\,\frac{\Delta f}{\Delta x} + f\,\frac{\Delta g}{\Delta x} + \Delta f\cdot\frac{\Delta g}{\Delta x}.

As Δx→0\Delta x \to 0, the first two fractions become f′f' and g′g'. In the last term, ΔgΔx\frac{\Delta g}{\Delta x} approaches g′g', but it is multiplied by Δf\Delta f, which shrinks to 0. The corner is small in both directions, so it disappears in the limit, and what remains is gf′+fg′g f' + f g'. Each term is one factor's change while the other factor is held at its current value.

The same argument works with the limit definition. Adding and subtracting f(x+h) g(x)f(x+h)\,g(x) in the numerator splits it into one piece where only gg changes and one where only ff changes:

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 fractions approach g′(x)g'(x) and f′(x)f'(x). The factor f(x+h)f(x+h) approaches f(x)f(x) because a function that is differentiable at xx is continuous there (topic 2.4). That continuity is the formal reason the corner term vanishes.

Because the two terms are added, their order doesn't matter, and you can write fg′+f′gfg' + f'g just as well. The rule agrees with what you already know. With a constant kk as one factor, it gives ddx[k f(x)]=0⋅f(x)+k f′(x)=k f′(x)\frac{d}{dx}\big[k\,f(x)\big] = 0\cdot f(x) + k\,f'(x) = k\,f'(x), the constant multiple rule. With x⋅xx\cdot x it gives 1⋅x+x⋅1=2x1\cdot x + x\cdot 1 = 2x.

Using the rule

The product rule is needed whenever two factors both depend on xx and you can't simply multiply them out: x3ln⁡xx^3\ln x, exsin⁡xe^x\sin x, x2cos⁡xx^2\cos x. Label the factors, find each derivative, then assemble. For y=x3ln⁡xy = x^3\ln x with x>0x > 0, the factors are x3x^3 (derivative 3x23x^2) and ln⁡x\ln x (derivative 1x\frac{1}{x}), so

dydx=3x2ln⁡x+x3⋅1x=3x2ln⁡x+x2=x2(3ln⁡x+1).\frac{dy}{dx} = 3x^2\ln x + x^3\cdot\frac{1}{x} = 3x^2\ln x + x^2 = x^2\left(3\ln x + 1\right).

Factoring at the end isn't required for a derivative, but it is what you want when the next step is solving dydx=0\frac{dy}{dx} = 0. Here, since x2>0x^2 > 0, the derivative is 0 exactly when ln⁡x=−13\ln x = -\frac{1}{3}, that is, at x=e−1/3x = e^{-1/3}.

A product of two polynomials can be expanded instead, and both routes give the same derivative. If you do use the product rule on polynomials, simplify carefully; expanding first is often less work.

Products of three factors

For f g kf\,g\,k, treat f gf\,g as one factor and apply the rule twice:

[(fg)k]′=(fg)′k+(fg)k′=f′gk+fg′k+fgk′.\big[(fg)k\big]' = (fg)'k + (fg)k' = f'gk + fg'k + fgk'.

The pattern: one term for each factor, in which that factor alone is differentiated. For y=x exsin⁡xy = x\,e^x\sin x,

dydx=exsin⁡x+x exsin⁡x+x excos⁡x.\frac{dy}{dx} = e^x\sin x + x\,e^x\sin x + x\,e^x\cos x.

Products from tables and graphs

When ff and gg are given only by values, the product rule needs four numbers, all at the same input: f(a)f(a), f′(a)f'(a), g(a)g(a) and g′(a)g'(a). If f(2)=3f(2) = 3, f′(2)=−1f'(2) = -1, g(2)=4g(2) = 4 and g′(2)=5g'(2) = 5, then the derivative of f(x) g(x)f(x)\,g(x) at x=2x = 2 is (−1)(4)+(3)(5)=11(-1)(4) + (3)(5) = 11. Notice that the function values matter as much as the derivatives: each derivative is weighted by the other factor's current value.

Worked examples

Worked exampleExample 1: formulas, and a check by expanding

Find dydx\dfrac{dy}{dx}.

(a) y=exsin⁡xy = e^x\sin x

(b) y=(2x2−1)(x3+4x)y = \left(2x^2 - 1\right)\left(x^3 + 4x\right)

Show solution

(a) The factors are exe^x and sin⁡x\sin x, with derivatives exe^x and cos⁡x\cos x (topic 2.7):

dydx=exsin⁡x+excos⁡x=ex(sin⁡x+cos⁡x).\frac{dy}{dx} = e^x\sin x + e^x\cos x = e^x\left(\sin x + \cos x\right).

(b) With the product rule, the factor derivatives are 4x4x and 3x2+43x^2 + 4:

dydx=4x(x3+4x)+(2x2−1)(3x2+4)=4x4+16x2+6x4+8x2−3x2−4=10x4+21x2−4.\frac{dy}{dx} = 4x\left(x^3 + 4x\right) + \left(2x^2 - 1\right)\left(3x^2 + 4\right) = 4x^4 + 16x^2 + 6x^4 + 8x^2 - 3x^2 - 4 = 10x^4 + 21x^2 - 4.

Expanding first gives y=2x5+7x3−4xy = 2x^5 + 7x^3 - 4x, whose derivative is 10x4+21x2−410x^4 + 21x^2 - 4, the same answer.

Worked exampleExample 2: horizontal tangent lines

Let f(x)=(x2−3)exf(x) = \left(x^2 - 3\right)e^x. Find all xx where the graph of ff has a horizontal tangent line.

Show solution

By the product rule,

f′(x)=2x ex+(x2−3)ex=ex(x2+2x−3)=ex(x+3)(x−1).f'(x) = 2x\,e^x + \left(x^2 - 3\right)e^x = e^x\left(x^2 + 2x - 3\right) = e^x(x + 3)(x - 1).

Factoring out exe^x is the key move: ex>0e^x > 0 for every xx, so f′(x)=0f'(x) = 0 only when (x+3)(x−1)=0(x + 3)(x - 1) = 0. The horizontal tangent lines are at x=−3x = -3 and x=1x = 1.

Worked exampleExample 3: products from a table (no calculator)

The functions ff and gg are differentiable. The table gives selected values.

xf(x)f′(x)g(x)g′(x)12−1−343531−2\begin{array}{c|cccc} x & f(x) & f'(x) & g(x) & g'(x) \\ \hline 1 & 2 & -1 & -3 & 4 \\ 3 & 5 & 3 & 1 & -2 \end{array}

(a) Let h(x)=f(x) g(x)h(x) = f(x)\,g(x). Find h′(1)h'(1).

(b) Let p(x)=x2f(x)p(x) = x^2 f(x). Find p′(3)p'(3).

(c) Let q(x)=[g(x)]2q(x) = \big[g(x)\big]^2. Find q′(3)q'(3).

Show solution

Write each derivative in general before substituting, so every lookup is visible.

(a) h′(x)=f′(x) g(x)+f(x) g′(x)h'(x) = f'(x)\,g(x) + f(x)\,g'(x), so

h′(1)=(−1)(−3)+(2)(4)=3+8=11.h'(1) = (-1)(-3) + (2)(4) = 3 + 8 = 11.

(b) The factors are x2x^2 and f(x)f(x), so p′(x)=2x f(x)+x2f′(x)p'(x) = 2x\,f(x) + x^2 f'(x) and

p′(3)=2(3)(5)+9(3)=30+27=57.p'(3) = 2(3)(5) + 9(3) = 30 + 27 = 57.

(c) Write q(x)=g(x)⋅g(x)q(x) = g(x)\cdot g(x). The product rule gives q′(x)=g′(x) g(x)+g(x) g′(x)=2 g(x) g′(x)q'(x) = g'(x)\,g(x) + g(x)\,g'(x) = 2\,g(x)\,g'(x), so

q′(3)=2(1)(−2)=−4.q'(3) = 2(1)(-2) = -4.

The chain rule (topic 3.1) gives the same formula for the square of a function; the product rule gets there with what you have now.

Worked exampleExample 4: an exam-style free-response question (no calculator)

The function gg is differentiable for all xx, with g(0)=3g(0) = 3 and g′(0)=−2g'(0) = -2. Let h(x)=(2+sin⁡x) g(x)h(x) = (2 + \sin x)\,g(x) and k(x)=x exg(x)k(x) = x\,e^x g(x).

(a) Is hh increasing or decreasing at x=0x = 0? Give a reason for your answer.

(b) Write an equation for the line tangent to the graph of hh at x=0x = 0.

(c) Find k′(0)k'(0).

Show solution

(a) By the product rule, h′(x)=cos⁡x⋅g(x)+(2+sin⁡x) g′(x)h'(x) = \cos x\cdot g(x) + (2 + \sin x)\,g'(x). At x=0x = 0,

h′(0)=(1)(3)+(2)(−2)=−1.h'(0) = (1)(3) + (2)(-2) = -1.

Since h′(0)=−1<0h'(0) = -1 < 0, hh is decreasing at x=0x = 0. The reason must point to the sign of h′(0)h'(0); a value of hh alone says nothing about direction.

(b) The point is h(0)=(2+0)(3)=6h(0) = (2 + 0)(3) = 6 and the slope is h′(0)=−1h'(0) = -1, so the tangent line is y=6−xy = 6 - x.

(c) kk has three factors, xx, exe^x and g(x)g(x), so it has three terms, each differentiating one factor:

k′(x)=1⋅exg(x)+x exg(x)+x exg′(x).k'(x) = 1\cdot e^x g(x) + x\,e^x g(x) + x\,e^x g'(x).

At x=0x = 0 the factor xx makes the last two terms 0, and

k′(0)=1⋅1⋅3+0+0=3.k'(0) = 1\cdot 1\cdot 3 + 0 + 0 = 3.

You never needed g′(0)g'(0) for (c), because it is multiplied by x=0x = 0.

Where students lose points

On the exam

Product-rule questions on the exam can combine the rule with values from a table or graph, or with a follow-up such as a tangent line or a decision about whether a function is increasing. In a free-response answer, writing the general derivative (for example, h′(x)=f′(x)g(x)+f(x)g′(x)h'(x) = f'(x)g(x) + f(x)g'(x)) before substituting shows the method. An unsimplified numeric answer such as (−1)(−3)+(2)(4)(-1)(-3) + (2)(4) is acceptable on no-calculator parts.

Check yourself

  1. Question 1

    If y=x2cos⁡xy = x^2\cos x, then dydx=\dfrac{dy}{dx} =

    1. A

      2xcos⁡x+x2sin⁡x2x\cos x + x^2\sin x

    2. B

      −2xsin⁡x-2x\sin x

    3. C

      2xcos⁡x−x2sin⁡x2x\cos x - x^2\sin x

    4. D

      2x−sin⁡x2x - \sin x

    Show answer

    C

    The product rule gives 2x⋅cos⁡x+x2⋅(−sin⁡x)2x\cdot\cos x + x^2\cdot(-\sin x). Choice A has the wrong sign on the derivative of cosine, and choice B multiplies the two derivatives.

  2. Question 2

    The function ff is differentiable with f(4)=3f(4) = 3 and f′(4)=−2f'(4) = -2. Let h(x)=x f(x)h(x) = \sqrt{x}\,f(x). Find h′(4)h'(4).

    Show answer

    h′(4)=−134h'(4) = -\dfrac{13}{4}

    h′(x)=12xf(x)+x f′(x)h'(x) = \dfrac{1}{2\sqrt{x}}f(x) + \sqrt{x}\,f'(x), so h′(4)=14(3)+2(−2)=34−4=−134h'(4) = \dfrac{1}{4}(3) + 2(-2) = \dfrac{3}{4} - 4 = -\dfrac{13}{4}.

  3. Question 3

    Differentiable functions ff and gg have f(1)=0f(1) = 0, f′(1)=5f'(1) = 5 and g(1)=7g(1) = 7, but g′(1)g'(1) is unknown. Can you find the derivative of f(x) g(x)f(x)\,g(x) at x=1x = 1? If so, what is it?

    Show answer

    Yes. It is 3535.

    The product rule gives f′(1) g(1)+f(1) g′(1)=5(7)+0⋅g′(1)=35f'(1)\,g(1) + f(1)\,g'(1) = 5(7) + 0\cdot g'(1) = 35. The unknown g′(1)g'(1) is multiplied by f(1)=0f(1) = 0, so its value doesn't matter.

  4. Question 4

    What is the slope of the graph of y=xln⁡xy = x\ln x at x=ex = e?

    1. A

      1e\dfrac{1}{e}

    2. B

      11

    3. C

      22

    4. D

      ee

    Show answer

    C

    dydx=1⋅ln⁡x+x⋅1x=ln⁡x+1\dfrac{dy}{dx} = 1\cdot\ln x + x\cdot\dfrac{1}{x} = \ln x + 1, which is 1+1=21 + 1 = 2 at x=ex = e. Choice A multiplies the derivatives 11 and 1e\frac{1}{e}, and choice B keeps only the second term.

Go deeper