sciandu
Mathematics

Mathematics

Product & chain rule

When two functions are multiplied or nested inside each other, the power rule is no longer enough. Two rules close the gap.

The power rule and the sum rule take you a long way with polynomials. But f(x)=x2sinxf(x) = x^2 \cdot \sin x is a product of two different functions, and f(x)=(3x+1)5f(x) = (3x + 1)^5 is one function sitting inside another. There is exactly one rule for each case, and once you know them you can differentiate almost anything you meet.

Why the easy way fails

The obvious idea would be to differentiate both parts separately and multiply. That is wrong, and you can see it in an example where you already know the answer. Take f(x)=xx=x2f(x) = x \cdot x = x^2. The correct is 2x2x. Differentiating separately and multiplying would give 11=11 \cdot 1 = 1, which is plainly not right.

The product rule

For a product uvu \cdot v you differentiate one factor and leave the other alone, then the other way round, and add the two. It can be remembered as a phrase: first differentiated times second left alone, plus first left alone times second differentiated.

(uv)=uv+uv(u \cdot v)' = u' \cdot v + u \cdot v'
Two terms, and in each one exactly one factor has been differentiated.

The check on f(x)=xxf(x) = x \cdot x now works: u=xu = x, v=xv = x, so u=1u' = 1 and v=1v' = 1. Substituting gives 1x+x1=2x1 \cdot x + x \cdot 1 = 2x, exactly the familiar derivative of x2x^2. A real example: f(x)=x2sinxf(x) = x^2 \cdot \sin x has the derivative 2xsinx+x2cosx2x \cdot \sin x + x^2 \cdot \cos x.

The chain rule

In f(x)=(3x+1)5f(x) = (3x + 1)^5 one function sits inside another. Inside is 3x+13x + 1, outside is the fifth power. You could expand the bracket, but that would be six terms of work for a task that fits on one line. The chain rule says: differentiate the outer function, leave the inner one untouched while doing so, and multiply by the derivative of the inner function at the end.

f(x)=u(v(x))f(x)=u(v(x))v(x)f(x) = u(v(x)) \quad \Rightarrow \quad f'(x) = u'(v(x)) \cdot v'(x)
Outer derivative times inner derivative. That last factor is the step people call differentiating the inside.

For f(x)=(3x+1)5f(x) = (3x + 1)^5 that means: the outer derivative is 5(3x+1)45 \cdot (3x + 1)^4, the inner derivative of 3x+13x + 1 is 3. Together f(x)=15(3x+1)4f'(x) = 15 \cdot (3x + 1)^4. The factor 3 at the end is the step people forget most often, which is why it gets a name of its own.

Function machine
x4
4
· 2 + 1
9
f(4) = 9
The machine applies one rule to your xx. That is exactly how a composition arises: put two such machines in a row and the output of the first becomes the input of the second. Set x=3x = 3 and choose the squaring rule, and 9 comes out. For (x+1)2(x + 1)^2 the 3 first runs through a plus-one machine to 4 and then through the square to 16. The chain rule differentiates exactly this order, from the outside in.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

What is the product rule?

Differentiate f(x)=x2(x+3)f(x) = x^2 \cdot (x + 3) with the product rule.

Differentiate f(x)=(2x+5)4f(x) = (2x + 5)^4.

With the chain rule you multiply the outer derivative by the .

For f(x)=(x2+1)3f(x) = (x^2 + 1)^3 the derivative is f(x)=6x(x2+1)2f'(x) = 6x \cdot (x^2 + 1)^2. Work out f(1)f'(1).

Match each function to the rule you need.

x3sinxx^3 \cdot \sin x
(4x1)6(4x - 1)^6
x3+sinxx^3 + \sin x