To differentiate a product f(x)g(x), use the product rule. The derivative is f′(x)g(x)+f(x)g′(x), one term for each factor changing while the other holds still. It is not f′(x)g′(x).
A concrete case
Follow one small change
Take f(x)=x2(x+1), the product of the two factors x2 and x+1. At x=2 the factors are 4 and 3, and the product is 12.
Nudge x up by 0.01, to 2.01. The first factor becomes 4.0401, a change of 0.0401. The second becomes 3.01, a change of 0.01. The product becomes 12.160701, a change of 0.160701. Divided by the nudge, that is a rate of about 16.07.
Multiplying the factors’ own rates does not come close. At x=2 the first factor changes 4 times as fast as x and the second exactly as fast, and 4×1 is only 4. The product changes for two reasons at once. The first factor grows while the second is about 3, which contributes 4×3=12. The second factor grows while the first is about 4, which contributes 4×1=4. Together they make 12+4=16, the exact rate at x=2.
0.010.160701=16.0701
Following a nudge of 0.01 through x2(x+1) at x=2
Quantity
At x=2
At x=2.01
Change
First factor, x2
4
4.0401
0.0401
Second factor, x+1
3
3.01
0.01
Product, x2(x+1)
12
12.160701
0.160701
The rule
The product rule
Let f and g be functions that both have a derivative at x. The derivative of their product is the derivative of the first times the second, plus the first times the derivative of the second. In the formula, f′(x) and g′(x) are the rates of the two factors, and f(x) and g(x) are their values at the same x.
Read it as two effects added together. Let the first factor change while the second keeps its value, then let the second change while the first keeps its value. The order of the two terms does not matter, because each is a product and the two are added.
dxd[f(x)g(x)]=f′(x)g(x)+f(x)g′(x)
dxd[f(x)g(x)]=f′(x)g(x)+f(x)g′(x)
Why it works
Why there are two terms
Picture the product as the area of a rectangle with width f and height g. When x moves by a small amount h, the width grows by Δf and the height by Δg. The new rectangle is the old one plus three pieces. A strip down the side has area g⋅Δf, a strip along the top has area f⋅Δg, and a small corner has area Δf⋅Δg.
The nudge above fits this picture exactly. With h=0.01 at x=2, the side strip is 3×0.0401=0.1203, the top strip is 4×0.01=0.04, and the corner is 0.0401×0.01=0.000401. They add to 0.160701, the whole change in the product.
Now divide by h and let h shrink to 0. The side strip over h becomes g⋅f′, and the top strip over h becomes f⋅g′. The corner over h is (Δf/h)⋅Δg. Its first part tends to f′ and its second part tends to 0, because g barely moves when h is tiny. The corner contributes nothing, and the two strips are the two terms of the rule.
Δ(fg)=gΔf+fΔg+ΔfΔg
The three pieces of the change in x2(x+1) from x=2 to x=2.01
Piece
Area
Divided by h=0.01
Side strip, g⋅Δf
3×0.0401=0.1203
12.03
Top strip, f⋅Δg
4×0.01=0.04
4
Corner, Δf⋅Δg
0.0401×0.01=0.000401
0.0401
Whole change
0.160701
16.0701
The method
The method in five steps
Write the four pieces f,f′,g and g′ before you assemble anything. Most product rule errors are a piece put in the wrong place, and a list makes the places plain. The table works through y=(x2+1)ex.
Step 4 is worth the trouble. The factored form shows that the slope is 0 only at x=−1, because ex is never 0.
dxd[(x2+1)ex]=2xex+(x2+1)ex=ex(x+1)2
dxd[(x2+1)ex]=2xex+(x2+1)ex=ex(x+1)2
The product rule on y=(x2+1)ex
Step
What to do
For y=(x2+1)ex
1
Name the two factors
f=x2+1 and g=ex
2
Differentiate each factor
f′=2x and g′=ex
3
Write f′g+fg′
2x⋅ex+(x2+1)⋅ex
4
Factor out what the terms share
ex(x2+2x+1)=ex(x+1)2
5
Check one value
at x=0 the slope is 1
When to multiply out instead
If both factors are polynomials, you have a choice. Multiplying out x2(x+1) gives x3+x2, and the power rule finishes the job. The product rule gives the same answer and is quicker when the factors are long.
When the factors are different kinds of function, such as x2cosx,exsinx or xlnx, nothing multiplies out, and the product rule is the route. A constant factor needs no rule at all. 5x3 is a constant times x3, and its derivative is 5⋅3x2=15x2.
For three factors, let one change at a time and add the three terms. The pattern extends to any number of factors, with one term for each.
(fgh)′=f′gh+fg′h+fgh′
Where it breaks
Where it breaks
The tempting shortcut is to multiply the two derivatives. Test it on x⋅x=x2. The shortcut gives 1⋅1=1, but the derivative of x2 is 2x. The product rule gives 1⋅x+x⋅1=2x, as it should.
A product is also easy to confuse with a composition. The function x2sinx multiplies two functions you work out separately, so it takes the product rule. In sin(x2) the x2 sits inside the sine, so it takes the chain rule, and its derivative is 2xcos(x2). To tell them apart, ask which operation is done last. If it is a multiplication, start with the product rule.
The rule needs both factors to have a derivative at the point. Where one of them does not, the rule cannot be used there, though the product itself may still have a derivative. Deeper shows such a case.
dxd(x⋅x)=1⋅x+x⋅1=2x
Check your answer
Check your answer
A product rule derivative can be checked against the product itself.
Multiply out when you can. The product x2(x+1) is x3+x2, whose derivative 3x2+2x matches the product rule’s answer.
Compare with a secant. The ratio [f(x+h)−f(x)]/h with a small h such as 0.001 should be close to your derivative. For x2(x+1) at x=2 it is about 16.007, against f′(2)=16. Try a second point too, because one point can hide a sign error.
Count the terms before you simplify. Two factors give two terms and three factors give three, each with exactly one derivative in it.
To have Chalk check the work, write it in a Math box. Put the function on the first row as f(x)=… and each step of the derivative on its own row below it as f′(x)=…. A value such as f′(2)=16 can follow, once the derivative is in the same box. A wrong derivative reads ✗ with “Not the derivative of row 1.”
Why the rule is true, and where it leads
The rectangle is a picture, not a proof. The proof adds and subtracts one term, f(x)g(x+h), in the difference quotient. The numerator then splits into [f(x+h)−f(x)]⋅g(x+h) plus f(x)⋅[g(x+h)−g(x)]. Divide by h and let h shrink to 0. The first part tends to f′(x)g(x), because a function with a derivative is continuous. The second tends to f(x)g′(x).
The rule asks more than it needs. The function x∣x∣ has derivative 0 at x=0, though ∣x∣ has no derivative there. Its difference quotient at 0 is h∣h∣/h=∣h∣, which tends to 0.
Applied twice, the rule gives the second derivative of a product, f′′g+2f′g′+fg′′. Read backwards, it becomes integration by parts, the method for integrating a product such as xex.
Multiplying the derivatives. The derivative of x2⋅x3=x5 is 5x4, not 2x⋅3x2=6x3, because each factor’s rate is weighed against the other factor’s value, not its rate.
Putting both derivatives in one term, as in f′g′+fg. Each term of the rule holds exactly one derivative, so the right form is f′g+fg′.
Dropping the 3 from the derivative of e3x. In x2e3x, the second factor’s derivative is 3e3x, not e3x, because ekx has derivative kekx. The answer is 2xe3x+3x2e3x.
Losing the sign of the cosine’s derivative. The derivative of xcosx is cosx−xsinx, not cosx+xsinx, because the derivative of cosxis −sinx.
Key terms
Product rule
To differentiate a product, take the derivative of the first factor times the second, plus the first times the derivative of the second: (uv)′=u′v+uv′.
Derivative
The instantaneous rate of change of a function: the limit of the average rate of change as the step shrinks to zero, when that limit exists. On a graph it is the slope of the tangent line.
Differentiable
Having a derivative at a point. A function is continuous wherever it is differentiable, but not the other way round: ∣x∣ is continuous at x=0 with no derivative there.
Chain rule
The rule for differentiating a function inside another function: [f(g(x))]′=f′(g(x))⋅g′(x). Differentiate the outside, keeping the inside as it is, then multiply by the derivative of the inside.
Work through an example
Differentiate f(x)=x2(x+1) with the product rule, then check the result by expanding first.