Calculus 1

The product rule

The derivative of a sum is the sum of the derivatives. Is the derivative of a product the product of the derivatives, and if not, what is it?

Where you are 13 in Derivatives

Why this exists

The basic rules differentiate sums and constant multiples of powers. A product such as x^3 e^x is neither, and it cannot be multiplied out. The first guess, that the derivative of a product is the product of the derivatives, fails on the simplest case there is. Take f(x) = x and g(x) = x. Then f(x)g(x) = x^2, whose derivative is 2x, while f'(x)g'(x) = 1 \cdot 1 = 1. These agree only at x = \tfrac{1}{2}.

Units say the same thing. Chaltu runs a flower farm. Her revenue for a day is the price per stem times the stems sold that day. If time is in days, the price’s rate is in dollars per stem per day and the sales rate is in stems per day per day. Their product is in dollars per day cubed, which is not a unit the rate of revenue (dollars per day, per day) can have. The rate of a product has to be built from different pieces, and this lesson finds them.

Definition

The product rule. If f and g are both differentiable at x, then the product fg is differentiable at x and

(fg)'(x) = 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. The order of the two terms does not matter, since addition is commutative. In Leibniz notation, with u and v functions of x,

\frac{d}{dx}\big[uv\big] = \frac{du}{dx}\,v + u\,\frac{dv}{dx}.

Intuition

Picture f(x) and g(x) as the width and height of a rectangle, both positive, so that f(x)g(x) is its area. Move from x to x + h. The width grows by \Delta f = f(x + h) - f(x) and the height by \Delta g = g(x + h) - g(x).

f(x)\,g(x)
g\,\Delta f
f\,\Delta g
\Delta f\,\Delta g
f(x)
\Delta f
g(x)
\Delta g
Figure 1When both sides grow, the area gains two strips and a corner. The strips give g\,\Delta f + f\,\Delta g; the shaded corner \Delta f\,\Delta g is so small that it disappears from the rate.

The new area is the old area plus three pieces: a strip g\,\Delta f down the right side, a strip f\,\Delta g across the top, and a corner \Delta f\,\Delta g. Divide the gain by h:

\begin{aligned} \frac{\Delta(\text{area})}{h} &= g\,\frac{\Delta f}{h} + f\,\frac{\Delta g}{h} \\ &\quad + \Delta f\,\frac{\Delta g}{h}. \end{aligned}

As h \to 0 the first two terms tend to g f' and f g'. In the last, \displaystyle \frac{\Delta g}{h} tends to g' but \Delta f tends to 0, so the corner drops out. Each strip is one side’s growth carried along the other side’s full length, and that is why the value of each function appears next to the derivative of the other. The picture assumes positive sides that grow; the proof below needs neither.

Results

Product rule. If f and g are differentiable at x, then (fg)'(x) = f'(x)g(x) + f(x)g'(x).

Three factors. If f, g and k are differentiable at x, then

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

Each term differentiates one factor and leaves the others alone. The pattern continues for any number of factors.

A square. Taking g = f gives \dfrac{d}{dx}\big[f(x)^2\big] = 2f(x)f'(x).

Agreement with the constant multiple rule. If g(x) = c is constant, then g' = 0 and the rule gives (cf)' = c f', as it must.

Why it is true

Let P(x) = f(x)g(x). The difference P(x + h) - P(x) changes both factors at once. Add and subtract the middle term f(x + h)g(x), which changes only one, and group:

\begin{aligned} &P(x + h) - P(x) \\ &= f(x + h)g(x + h) - f(x + h)g(x) \\ &\quad + f(x + h)g(x) - f(x)g(x) \\ &= f(x + h)\big[g(x + h) - g(x)\big] \\ &\quad + g(x)\big[f(x + h) - f(x)\big]. \end{aligned}

Divide by h \ne 0:

\begin{aligned} &\frac{P(x + h) - P(x)}{h} \\ &= f(x + h)\,\frac{g(x + h) - g(x)}{h} \\ &\quad + g(x)\,\frac{f(x + h) - f(x)}{h}. \end{aligned}

Now let h \to 0. The two quotients tend to g'(x) and f'(x) because f and g are differentiable at x. The factor g(x) does not depend on h. The factor f(x + h) tends to f(x) because a function differentiable at x is continuous there, which the lesson on differentiability proves: f(x + h) - f(x) equals \displaystyle h \cdot \frac{f(x + h) - f(x)}{h}, which tends to 0 \cdot f'(x) = 0. Every limit on the right exists, so the sum and product laws for limits give

P'(x) = f(x)g'(x) + g(x)f'(x).

That continuity step is the corner of the rectangle in the proof. Choosing the other middle term, f(x)g(x + h), gives the same rule and uses the continuity of g instead.

For three factors, group fgk as (fg)k and apply the rule twice:

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

Worked examples

Example 1

A product of polynomials

Find P'(x) for P(x) = (2x^3 - 5)(x^2 + 4x), and check the answer by expanding.

Solution

Take f(x) = 2x^3 - 5 and g(x) = x^2 + 4x, so f'(x) = 6x^2 and g'(x) = 2x + 4 by the power rule. The product rule gives

\begin{aligned} P'(x) &= 6x^2(x^2 + 4x) + (2x^3 - 5)(2x + 4) \\ &= 6x^4 + 24x^3 + 4x^4 + 8x^3 \\ &\quad - 10x - 20 \\ &= 10x^4 + 32x^3 - 10x - 20. \end{aligned}

Check. Expanding first, P(x) = 2x^5 + 8x^4 - 5x^2 - 20x, so P'(x) = 10x^4 + 32x^3 - 10x - 20. The two routes agree, as they must: they differentiate the same function.

Example 2

Expand first, or not?

(a) Find h'(x) for h(x) = (x^2 + 3)(x^2 - 3). (b) Find k'(1) for k(x) = (x^4 - 3x + 1)(x^5 + 2x^2 - 7).

Solution

(a) The factors are a sum and a difference, so expanding is one line: h(x) = x^4 - 9 and h'(x) = 4x^3. The product rule gives the same, 2x(x^2 - 3) + (x^2 + 3)(2x) = 4x^3, with more writing.

(b) Expanding would produce nine terms of degree up to 9, all to be differentiated and then evaluated at 1. The product rule needs only four numbers. With f(x) = x^4 - 3x + 1 and g(x) = x^5 + 2x^2 - 7:

\begin{aligned} f(1) &= -1, & f'(1) &= 4 - 3 = 1, \\ g(1) &= -4, & g'(1) &= 5 + 4 = 9. \end{aligned}

So k'(1) = f'(1)g(1) + f(1)g'(1), which is (1)(-4) + (-1)(9) = -13.

When the product collapses on expanding, expand. When it does not, or when only one value of the derivative is wanted, the product rule is shorter. When one factor is not a polynomial, as in the next example, it is the only route.

Example 3

Powers and exponentials

Find the derivative of (a) y = x^3 e^x and (b) \displaystyle g(x) = \sqrt{x}\,2^x, using \dfrac{d}{dx}\big[e^x\big] = e^x and \dfrac{d}{dx}\big[a^x\big] = a^x \ln a from derivatives of exponential functions. Where does the graph of (a) have a horizontal tangent?

Solution

(a) With x^3 first and e^x second,

\frac{dy}{dx} = 3x^2 e^x + x^3 e^x = x^2 e^x (x + 3).

A horizontal tangent needs \displaystyle \frac{dy}{dx} = 0. Since e^x > 0 for every x, the product is 0 exactly when x^2 = 0 or x + 3 = 0: at x = 0 and x = -3.

(b) Write \displaystyle \sqrt{x} = x^{1/2}, whose derivative is \displaystyle \dfrac{1}{2\sqrt{x}} for x > 0. Then

\begin{aligned} g'(x) &= \frac{2^x}{2\sqrt{x}} + \sqrt{x}\,2^x \ln 2 \\ &= \frac{2^x(1 + 2x\ln 2)}{2\sqrt{x}}, \quad x > 0, \end{aligned}

where the second form puts both terms over \displaystyle 2\sqrt{x}. At x = 1, g'(1) = 1 + 2\ln 2 \approx 2.386.

Example 4

Values from a table

The functions f and g are differentiable, with f(2) = 3, f'(2) = -1, g(2) = -4 and g'(2) = 5. Find the derivative at x = 2 of (a) f(x)g(x), (b) Q(x) = x^2 f(x), (c) R(x) = f(x)^2.

Solution

(a) (fg)'(2) = f'(2)g(2) + f(2)g'(2), which is (-1)(-4) + (3)(5) = 19. The product of the derivatives, f'(2)g'(2) = -5, is not even the right sign.

(b) The first factor is x^2, with derivative 2x:

Q'(2) = 2(2)f(2) + 2^2 f'(2) = 12 - 4 = 8.

(c) By the square rule, R'(2) = 2f(2)f'(2) = 2(3)(-1) = -6.

The rule needs the values f(2) and g(2) as well as the derivatives; four numbers in, one number out.

Example 5

Three factors and a tangent line

Let q(x) = (x - 2)(x^2 + 1)e^x. Find q'(x) and the tangent line at x = 0.

Solution

The three-factor rule differentiates one factor at a time:

\begin{aligned} q'(x) &= (1)(x^2 + 1)e^x + (x - 2)(2x)e^x \\ &\quad + (x - 2)(x^2 + 1)e^x. \end{aligned}

Every term carries e^x. Factoring it out and collecting the bracket, x^2 + 1 + 2x^2 - 4x + x^3 - 2x^2 + x - 2,

q'(x) = e^x\,(x^3 + x^2 - 3x - 1).

At x = 0: q(0) = (-2)(1)(1) = -2 and q'(0) = 1 \cdot (-1) = -1. The line through (0, -2) with slope -1, as in tangent lines, is y = -x - 2.

Example 6

Chaltu’s revenue at one moment

On day 10 of the season, Chaltu sells roses at 0.80 dollars per stem, and the price is rising at 0.03 dollars per stem per day. She sells 9{,}000 stems a day, and that number is falling by 150 stems per day each day. At what rate is her daily revenue changing?

Solution

Let p(t) be the price in dollars per stem and q(t) the stems sold per day, so the daily revenue is R(t) = p(t)q(t) dollars per day. The facts are p(10) = 0.80, p'(10) = 0.03, q(10) = 9000 and q'(10) = -150. By the product rule,

\begin{aligned} R'(10) &= p'(10)q(10) + p(10)q'(10) \\ &= 0.03(9000) + 0.80(-150) \\ &= 270 - 120 = 150. \end{aligned}

Daily revenue is rising at 150 dollars per day, each day. The two terms read as two causes. The rising price, applied to all 9{,}000 stems, adds 270 dollars per day each day; the falling sales, each lost stem worth 0.80 dollars, take away 120. Each term has units (dollars per stem per day)(stems per day) or (dollars per stem)(stems per day per day), both dollars per day per day, which is what a rate of change of revenue must carry.

Example 7

Lensa’s model of the season

Lensa, who keeps the farm’s books, models the price as p(t) = 0.5 + 0.04t dollars per stem and the sales as q(t) = 8000(0.95)^t stems per day, t days into the season. Is daily revenue rising or falling at t = 0 and at t = 14? When is R'(t) = 0?

Solution

The sales factor is an exponential with base 0.95, so q'(t) = 8000(0.95)^t \ln 0.95. The product rule gives

\begin{aligned} R'(t) &= 0.04 \cdot 8000(0.95)^t \\ &\quad + (0.5 + 0.04t) \cdot 8000(0.95)^t \ln 0.95 \\ &= 8000(0.95)^t \\ &\quad \cdot \big[0.04 + (0.5 + 0.04t)\ln 0.95\big]. \end{aligned}

With \ln 0.95 \approx -0.051293:

At t = 0, the bracket is 0.04 - 0.025647 = 0.014353, so R'(0) \approx 8000(0.014353) \approx 114.83 dollars per day per day: rising.

At t = 14, (0.95)^{14} \approx 0.48767 and the bracket is 0.04 + 1.06(-0.051293) \approx -0.014371, so R'(14) \approx -56.07: falling.

The factor 8000(0.95)^t is never 0, so R'(t) = 0 exactly when the bracket is 0:

0.5 + 0.04t = \frac{0.04}{-\ln 0.95} \approx 0.77983,

so t \approx 6.996.

The bracket decreases as t grows, because \ln 0.95 < 0, so R' is positive before t \approx 7.0 and negative after: before that moment the rising price outweighs the shrinking sales, and after it the shrinking sales win. That a derivative changing sign this way marks the largest daily revenue of the season is a theorem still to come, in maxima and minima; this lesson only finds where the sign changes.

Boundaries

  • Both factors must be differentiable at the point. The proof uses f'(x) and g'(x). If one of them does not exist, the rule says nothing, though the product may still have a derivative: \displaystyle x \cdot \sqrt[3]{x} = x^{4/3} has derivative 0 at x = 0 while \displaystyle \sqrt[3]{x} has none there.
  • The rule is not a product of derivatives. (fg)' = f'g' fails in general, as f(x) = g(x) = x shows.
  • Domains carry over. \displaystyle \sqrt{x}\,2^x is differentiated by the rule only for x > 0, where \displaystyle \sqrt{x} is differentiable.
  • The rectangle is a picture, not the proof. It assumes positive sides that grow. The algebra with the middle term covers negative values and shrinking factors too.

Where this goes next

The quotient rule follows from the product rule applied to \displaystyle f \cdot \frac{1}{g}. The chain rule handles a function inside another, and combining the rules decides which applies first in a layered expression. Once the trigonometric derivatives are known, products such as x^2 times a sine fall to the same rule. Rates of products return in related rates, where the area of a growing rectangle is a typical case. Read backward, the product rule becomes integration by parts.

Exercises

Products of powers and polynomials

  1. f(x) = (x^2 + 5)(3x - 4)
  2. g(t) = (t^3 - 2t)(4t^2 + 1); check by expanding.
  3. \displaystyle y = \sqrt{x}\,(x^2 - 6), for x > 0.
  4. h(x) = (2x + 1)(x^2 - x)(x + 3); find h'(1) with the three-factor rule.

Exponentials

  1. y = x^4 e^x
  2. Find every x where f'(x) = 0 for f(x) = (x^2 - 2x)e^x.
  3. g(x) = 3^x (x^2 + 1); find g'(x) and g'(0).
  4. Use the product rule on e^x \cdot e^x to find the derivative of e^{2x}.
  5. Find the tangent line to y = x e^x at x = 1.

Values from a table

The functions f and g are differentiable, with f(1) = 2, f'(1) = -3, g(1) = 5 and g'(1) = 4.

  1. Find (fg)'(1).
  2. Find the derivative of x^3 g(x) at x = 1.
  3. Find the derivative of f(x)^2 at x = 1.

Rates in context

Gemechu ships carnations from the farm. On one day the price is 0.45 dollars per stem and falling at 0.01 dollars per stem per day, and he ships 20{,}000 stems a day, a number rising by 600 stems per day each day.

  1. At what rate is the daily revenue from carnations changing that day?
  2. At what rate would shipments have to rise, with the same price figures, for daily revenue to hold steady?
  3. Chaltu is enlarging a rectangular greenhouse. Its length is 40 meters and growing at 2 meters per week, and its width is 15 meters and growing at 0.5 meters per week. How fast is its floor area growing?
  4. In another season Lensa models p(t) = 1.2 - 0.02t dollars per stem and q(t) = 400(1.1)^t stems per day. Find R'(0) for R = pq, to the nearest cent.

Expand or not

  1. Find the derivative of \left(x + \dfrac{1}{x}\right)\left(x - \dfrac{1}{x}\right), x \ne 0, by expanding first.
  2. Find k'(1) for k(x) = (x^5 - 4x^2 + 2)(x^4 + x - 3) without expanding.

Reasoning

  1. Use the product rule and x^{n+1} = x \cdot x^n to prove \dfrac{d}{dx}\big[x^n\big] = nx^{n-1} for every positive integer n by induction.
  2. Use the three-factor rule to show that \dfrac{d}{dx}\big[f(x)^3\big] = 3f(x)^2 f'(x).
  3. Explain why the product rule cannot be applied to x^2\,|x| at x = 0 with the factors x^2 and |x|, then find the derivative there from the definition.
  4. In the rectangle picture, explain why the corner term \Delta f\,\dfrac{\Delta g}{h} tends to 0, and name the fact about f that this uses.
Answers
  1. f'(x) = 9x^2 - 8x + 15. 2x(3x - 4) + (x^2 + 5)(3), that is, 6x^2 - 8x + 3x^2 + 15.
  2. g'(t) = 20t^4 - 21t^2 - 2. (3t^2 - 2)(4t^2 + 1) + (t^3 - 2t)(8t). Expanded, g(t) = 4t^5 - 7t^3 - 2t, which gives the same.
  3. \displaystyle y' = \dfrac{5x^2 - 6}{2\sqrt{x}}. \displaystyle \dfrac{x^2 - 6}{2\sqrt{x}} + \sqrt{x}(2x), and \displaystyle 2x\sqrt{x} = \dfrac{4x^2}{2\sqrt{x}}.
  4. h'(1) = 12. At 1 the factors are 3, 0, 4 and their derivatives 2, 1, 1: 2(0)(4) + 3(1)(4) + 3(0)(1).
  5. y' = x^3 e^x (x + 4). 4x^3 e^x + x^4 e^x.
  6. \displaystyle x = \sqrt{2} and \displaystyle x = -\sqrt{2}. f'(x) = (2x - 2)e^x + (x^2 - 2x)e^x, which is e^x(x^2 - 2), and e^x \ne 0.
  7. g'(x) = 3^x\big[(x^2 + 1)\ln 3 + 2x\big]; g'(0) = \ln 3. 3^x \ln 3 \,(x^2 + 1) + 3^x (2x).
  8. 2e^{2x}. e^x \cdot e^x + e^x \cdot e^x = 2e^x e^x, and e^x e^x = e^{2x}.
  9. y = 2ex - e. y' = e^x(1 + x), so the slope at 1 is 2e and the point is (1, e); y = e + 2e(x - 1).
  10. -7. (-3)(5) + (2)(4) = -15 + 8.
  11. 19. 3x^2 g(x) + x^3 g'(x) at 1: 3(5) + 4.
  12. -12. 2f(1)f'(1) = 2(2)(-3).
  13. Rising at 70 dollars per day, each day. p'q + pq' is (-0.01)(20000) + 0.45(600), or -200 + 270.
  14. About 444 stems per day each day (exactly \displaystyle \frac{4000}{9}). -200 + 0.45\,q' = 0 gives \displaystyle q' = \frac{200}{0.45}.
  15. 50 square meters per week. 2(15) + 40(0.5) = 30 + 20.
  16. R'(0) \approx 37.75 dollars per day per day. p'(0)q(0) + p(0)q'(0) is (-0.02)(400) + 1.2(400\ln 1.1), or -8 + 480\ln 1.1.
  17. 2x + \dfrac{2}{x^3}, x \ne 0. The product is x^2 - \dfrac{1}{x^2} = x^2 - x^{-2}, whose derivative is 2x + 2x^{-3}.
  18. k'(1) = -2. f(1) = -1, f'(1) = 5 - 8 = -3, g(1) = -1, g'(1) = 4 + 1 = 5; (-3)(-1) + (-1)(5).
  19. For n = 1, \displaystyle \frac{d}{dx}[x] = 1 = 1 \cdot x^0. If \displaystyle \frac{d}{dx}[x^n] = nx^{n-1}, then \displaystyle \frac{d}{dx}[x \cdot x^n] = 1 \cdot x^n + x \cdot nx^{n-1}, which is (n + 1)x^n, and that is the rule for n + 1. By induction it holds for every positive integer n.
  20. With all three factors equal to f: f'ff + ff'f + fff' = 3f^2 f'.
  21. The derivative is 0. The rule needs both factors differentiable at 0, and |x| has a corner there. From the definition, \dfrac{h^2|h| - 0}{h} = h|h|, which tends to 0 from both sides. The hypothesis is enough for a derivative but not needed for one. Split differently, as x \cdot (x|x|), both factors are differentiable at 0 (the derivative of x|x| there is 0, from the definition), and the rule gives 1 \cdot 0 + 0 \cdot 0 = 0, the same answer.
  22. \displaystyle \frac{\Delta g}{h} tends to g'(x), a finite number, while \Delta f = f(x + h) - f(x) tends to 0 because f is continuous at x, which follows from f being differentiable there. The product tends to 0 \cdot g'(x) = 0.
kg1128 · updated 2026-10-21 · CC-BY-SA-4.0