Derivatives and the chain rule

Mathematics · Senior school calculus and first-year maths · about 12 min

A derivative measures how fast something changes: the gradient of a curve at a point, the speed of a moving object, the rate a tank fills. The chain rule is what lets you differentiate functions built from other functions, which is most of them.

The key idea

The derivative is the limit of the gradient over a shrinking interval:

f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}

and the chain rule for a function of a function is

ddx f(g(x))=f′(g(x))⋅g′(x)\frac{d}{dx}\,f\big(g(x)\big) = f'\big(g(x)\big)\cdot g'(x)
An x-y graph with a smooth rising curve. Two dots on the curve at x and x + h. A thin grey straight line through both dots is the secant. A dark blue straight line touches the curve at the first dot only, as the tangent. Thin dashed lines drop from both dots to the x axis and run across to the y axis. A dimension on the x axis between x and x + h.
As h shrinks, the line through two points becomes the tangent.

Try it yourself

Slide the point along the curve and watch the tangent line and its gradient change.

The rules you'll use most

FunctionDerivative
xnx^nnxn−1n x^{n-1}
exe^xexe^x
ln⁡x\ln x1x\dfrac{1}{x}
sin⁡x\sin xcos⁡x\cos x
cos⁡x\cos x−sin⁡x-\sin x

Plus: constants multiply through, and the derivative of a sum is the sum of the derivatives.

Using the chain rule

Spot the inside function g(x)g(x) and the outside function ff. Differentiate the outside, leaving the inside alone, then multiply by the derivative of the inside.

For sin⁡(x2)\sin(x^2): outside sin⁡\sin, inside x2x^2, so

ddxsin⁡(x2)=cos⁡(x2)⋅2x\frac{d}{dx}\sin(x^2) = \cos(x^2)\cdot 2x

What the answer means

  • f′(x)>0f'(x) > 0: the function is increasing there.
  • f′(x)<0f'(x) < 0: it's decreasing.
  • f′(x)=0f'(x) = 0: a stationary point, possibly a maximum or minimum.

In physics, the derivative of position is velocity, and the derivative of velocity is acceleration.

An x-y graph with one smooth wavy curve in dark blue: it rises to a maximum, falls to a minimum, then rises again. Short dark red tangent lines at the maximum and the minimum are horizontal. Short dark red tangent lines on the rising and falling parts follow the slope.
The sign of the derivative tells you which way the curve is heading.

Worked example: a power of a bracket

Differentiate y=(3x2+1)5y = (3x^2 + 1)^5, and find the gradient at x=1x = 1.

Show the solution

Outside: u5u^5, with derivative 5u45u^4. Inside: u=3x2+1u = 3x^2 + 1, with derivative 6x6x.

dydx=5(3x2+1)4⋅6x=30x (3x2+1)4\frac{dy}{dx} = 5(3x^2 + 1)^4 \cdot 6x = 30x\,(3x^2 + 1)^4

At x=1x = 1:

dydx=30×1×(3+1)4=30×256=7680\frac{dy}{dx} = 30 \times 1 \times (3 + 1)^4 = 30 \times 256 = 7680

Common mistakes

Forgetting to multiply by the inside's derivative

ddx(3x2+1)5\frac{d}{dx}(3x^2+1)^5 is not 5(3x2+1)45(3x^2+1)^4; you still need the ×6x\times 6x.

Differentiating the inside before the outside

Differentiate the outer function first with the inside left untouched, then multiply by the inside's derivative.

Treating sin⁡2x\sin^2 x like sin⁡(x2)\sin(x^2)

sin⁡2x=(sin⁡x)2\sin^2 x = (\sin x)^2, whose derivative is 2sin⁡xcos⁡x2\sin x\cos x. That's a different function from sin⁡(x2)\sin(x^2).

Check your understanding

1. What is ddx x4\dfrac{d}{dx}\,x^4?

2. What is ddx e3x\dfrac{d}{dx}\,e^{3x}?

3. At a point where f′(x)=0f'(x) = 0, the graph of ff is...

Still not sure? Talk it through.

Waypoint Mentor's tutor explains this out loud, works through your own problems on a whiteboard, and checks you've got it. Free to start.

Explain this to me

Related topics