Year 2 Pure · Chapter 12

Differentiation Rules

Specification: Edexcel Pure 7.1, 7.2, 7.4 — Differentiation  ·  AQA section G1, G2, G4

In this chapter
  1. 1. sin and cos from first principles
  2. 2. Exponentials and logarithms
  3. 3. The chain rule
  4. 4. The product rule
  5. 5. The quotient rule
  6. 6. Using dx/dy
  7. Practice

Key facts — this chapter

  • With xx in radians, ddx(sin⁡x)=cos⁡x\dfrac{d}{dx}(\sin x) = \cos x and ddx(cos⁡x)=−sin⁡x\dfrac{d}{dx}(\cos x) = -\sin x.
  • ddx(ekx)=kekx\dfrac{d}{dx}(e^{kx}) = ke^{kx}, ddx(ax)=axln⁡a\dfrac{d}{dx}(a^x) = a^x\ln a and ddx(ln⁡x)=1x\dfrac{d}{dx}(\ln x) = \dfrac{1}{x}.
  • Chain rule: if yy is a function of uu and uu is a function of xx, then dydx=dydu×dudx\dfrac{dy}{dx} = \dfrac{dy}{du} \times \dfrac{du}{dx}.
  • Product rule: ddx(uv)=udvdx+vdudx\dfrac{d}{dx}(uv) = u\dfrac{dv}{dx} + v\dfrac{du}{dx}.
  • Quotient rule: ddx(uv)=vdudx−udvdxv2\dfrac{d}{dx}\left(\dfrac{u}{v}\right) = \dfrac{v\frac{du}{dx} - u\frac{dv}{dx}}{v^2}.
  • ddx(tan⁡x)=sec⁡2x\dfrac{d}{dx}(\tan x) = \sec^2 x, and dxdy=1÷dydx\dfrac{dx}{dy} = 1 \div \dfrac{dy}{dx}.

In Year 1 you could differentiate powers of xx. This chapter adds the other functions, sines, exponentials and logarithms, and three rules for combining them: one for a function of a function, one for a product and one for a quotient. Together they differentiate almost anything you can write down.

1. sin and cos from first principles

The proof uses two limits. Both come from the small-angle approximations of Chapter 8, which is why the angle must be in radians.

Key result

With hh in radians, as h→0h \to 0,

sin⁡hh→1andcos⁡h−1h→0\frac{\sin h}{h} \to 1 \quad\text{and}\quad \frac{\cos h - 1}{h} \to 0

For small hh, sin⁡h≈h\sin h \approx h, and cos⁡h−1≈−12h2\cos h - 1 \approx -\frac{1}{2}h^2, so the second fraction is about −12h-\frac{1}{2}h.

Worked example 12.1 · The derivative of sin from first principles

Prove from first principles that the derivative of sin⁡x\sin x is cos⁡x\cos x.


  1. Expand sin⁡(x+h)\sin(x + h) with the addition formula and collect terms:

    sin⁡(x+h)−sin⁡x=sin⁡xcos⁡h+cos⁡xsin⁡h−sin⁡x=sin⁡x(cos⁡h−1)+cos⁡xsin⁡h\begin{aligned} &\sin(x + h) - \sin x \\ &= \sin x\cos h + \cos x\sin h - \sin x \\ &= \sin x(\cos h - 1) + \cos x\sin h \end{aligned}
  2. Divide by hh:

    sin⁡(x+h)−sin⁡xh=sin⁡x⋅cos⁡h−1h+cos⁡x⋅sin⁡hh\begin{aligned} &\frac{\sin(x + h) - \sin x}{h} \\ &= \sin x \cdot \frac{\cos h - 1}{h} + \cos x \cdot \frac{\sin h}{h} \end{aligned}
  3. As h→0h \to 0, the limits above turn this into sin⁡x×0+cos⁡x×1=cos⁡x\sin x \times 0 + \cos x \times 1 = \cos x.

The same method with cos⁡(x+h)=cos⁡xcos⁡h−sin⁡xsin⁡h\cos(x + h) = \cos x\cos h - \sin x\sin h shows that the derivative of cos⁡x\cos x is −sin⁡x-\sin x.

Top: y = sin x from 0 to 2 pi with tangents drawn at x = 0, pi over 2 and pi, of gradient 1, 0 and minus 1. Bottom: y = cos x, passing through the matching points (0, 1), (pi over 2, 0) and (pi, minus 1)
The gradient of sin x (top) at each point is the height of cos x (bottom) there.

Common mistake

These derivatives are only true in radians. In degrees the gradient of sin⁡x\sin x at x=0x = 0 is π180\frac{\pi}{180}, not 11, and every result in this chapter would need an extra factor.

2. Exponentials and logarithms

Key result

ddx(ekx)=kekxddx(ax)=axln⁡addx(ln⁡x)=1x\begin{aligned} \frac{d}{dx}(e^{kx}) &= ke^{kx} \\ \frac{d}{dx}(a^{x}) &= a^{x}\ln a \\ \frac{d}{dx}(\ln x) &= \frac{1}{x} \end{aligned}

The second follows from the first, because a=eln⁡aa = e^{\ln a}, so ax=exln⁡aa^x = e^{x\ln a}: that is ekxe^{kx} with k=ln⁡ak = \ln a. Section 6 shows where the third comes from. Since ln⁡(kx)=ln⁡k+ln⁡x\ln(kx) = \ln k + \ln x, the derivative of ln⁡(kx)\ln(kx) is also 1x\frac{1}{x}.

Worked example 12.2 · Standard derivatives

Differentiate y=3e2x−5ln⁡x+2xy = 3e^{2x} - 5\ln x + 2^x, and find the gradient of the curve at x=1x = 1.


  1. Differentiate term by term:

    dydx=6e2x−5x+2xln⁡2\frac{dy}{dx} = 6e^{2x} - \frac{5}{x} + 2^x\ln 2
  2. At x=1x = 1:

    dydx=6e2−5+2ln⁡2=40.7 (3 s.f.)\begin{aligned} \frac{dy}{dx} &= 6e^2 - 5 + 2\ln 2 \\ &= 40.7 \text{ (3 s.f.)} \end{aligned}

3. The chain rule

y=(3x2−1)5y = (3x^2 - 1)^5 is a function of a function: first work out u=3x2−1u = 3x^2 - 1, then y=u5y = u^5. A small change in xx changes uu at the rate dudx\frac{du}{dx}, and each change in uu changes yy at the rate dydu\frac{dy}{du}, so the rates multiply.

Key result

If yy is a function of uu, and uu is a function of xx, then

dydx=dydu×dudx\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}

In words: differentiate the outside, keeping the inside as it is, then multiply by the derivative of the inside.

A chain of two machines: x goes into the first, which outputs u = g(x) at rate du/dx; u goes into the second, which outputs y = f(u) at rate dy/du. Below, the overall rate dy/dx is the product of the two rates
Two machines in a chain: the overall rate is the product of the two rates.

Worked example 12.3 · A power of a bracket

Differentiate y=(3x2−1)5y = (3x^2 - 1)^5.


  1. Let u=3x2−1u = 3x^2 - 1, so y=u5y = u^5. Then dydu=5u4\frac{dy}{du} = 5u^4 and dudx=6x\frac{du}{dx} = 6x.

  2. Multiply, and write the answer in terms of xx:

    dydx=5(3x2−1)4×6x=30x(3x2−1)4\begin{aligned} \frac{dy}{dx} &= 5(3x^2 - 1)^4 \times 6x \\ &= 30x(3x^2 - 1)^4 \end{aligned}

Worked example 12.4 · Chains with the new functions

Differentiate (a) ex2e^{x^2}, (b) ln⁡(cos⁡x)\ln(\cos x) and (c) sin⁡3x\sin^3 x.


Each time, differentiate the outside function, then multiply by the derivative of the inside.

(a) The outside is eue^u and the inside is x2x^2: ex2×2x=2xex2e^{x^2} \times 2x = 2xe^{x^2}.

(b) The outside is ln⁡u\ln u and the inside is cos⁡x\cos x: 1cos⁡x×(−sin⁡x)=−tan⁡x\dfrac{1}{\cos x} \times (-\sin x) = -\tan x.

(c) sin⁡3x\sin^3 x means (sin⁡x)3(\sin x)^3, so the outside is the cube: 3sin⁡2x×cos⁡x=3sin⁡2xcos⁡x3\sin^2 x \times \cos x = 3\sin^2 x\cos x.

A special case comes up so often that it’s worth knowing on its own: if the inside is kxkx, the chain rule just multiplies by kk. So ddx(sin⁡kx)=kcos⁡kx\frac{d}{dx}(\sin kx) = k\cos kx and ddx(cos⁡kx)=−ksin⁡kx\frac{d}{dx}(\cos kx) = -k\sin kx.

4. The product rule

Key result

If uu and vv are functions of xx,

ddx(uv)=udvdx+vdudx\frac{d}{dx}(uv) = u\frac{dv}{dx} + v\frac{du}{dx}

Think of uvuv as the area of a rectangle with sides uu and vv. When xx grows a little, uu grows by δu\delta u and vv by δv\delta v, and the area gains three pieces: u δvu\,\delta v along one side, v δuv\,\delta u along the other, and a tiny corner δu δv\delta u\,\delta v. Divide by δx\delta x and let δx→0\delta x \to 0: the corner vanishes, and what’s left is the product rule.

The rectangle has sides u = 1 + x and v = 1 + ½x², so its area is uv. Increase x by δx and the area gains two strips and a corner. Make δx smaller and watch the corner's share shrink to nothing.

Worked example 12.5 · Stationary points of a product

Find the xx-coordinates of the stationary points of y=x2e3xy = x^2e^{3x}.


  1. With u=x2u = x^2 and v=e3xv = e^{3x}, dudx=2x\frac{du}{dx} = 2x and dvdx=3e3x\frac{dv}{dx} = 3e^{3x}:

    dydx=x2×3e3x+e3x×2x=xe3x(3x+2)\begin{aligned} \frac{dy}{dx} &= x^2 \times 3e^{3x} + e^{3x} \times 2x \\ &= xe^{3x}(3x + 2) \end{aligned}
  2. e3xe^{3x} is never 00, so dydx=0\frac{dy}{dx} = 0 when x=0x = 0 or x=−23x = -\tfrac{2}{3}.

5. The quotient rule

Key result

If uu and vv are functions of xx,

ddx(uv)=vdudx−udvdxv2\frac{d}{dx}\left(\frac{u}{v}\right) = \frac{v\dfrac{du}{dx} - u\dfrac{dv}{dx}}{v^2}

The order on top matters, because it’s a subtraction: start with vv.

Worked example 12.6 · The derivative of tan

Show that ddx(tan⁡x)=sec⁡2x\dfrac{d}{dx}(\tan x) = \sec^2 x.


Write tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x}, with u=sin⁡xu = \sin x and v=cos⁡xv = \cos x:

ddx(tan⁡x)=cos⁡xcos⁡x−sin⁡x(−sin⁡x)cos⁡2x=cos⁡2x+sin⁡2xcos⁡2x=1cos⁡2x=sec⁡2x\begin{aligned} &\frac{d}{dx}(\tan x) \\ &= \frac{\cos x\cos x - \sin x(-\sin x)}{\cos^2 x} \\ &= \frac{\cos^2 x + \sin^2 x}{\cos^2 x} \\ &= \frac{1}{\cos^2 x} = \sec^2 x \end{aligned}

The reciprocal functions follow in the same way, from the quotient rule or the chain rule:

The other trig derivatives

ddx(tan⁡x)=sec⁡2xddx(sec⁡x)=sec⁡xtan⁡xddx(cosec⁡x)=−cosec⁡xcot⁡xddx(cot⁡x)=−cosec⁡2x\begin{aligned} \frac{d}{dx}(\tan x) &= \sec^2 x \\ \frac{d}{dx}(\sec x) &= \sec x\tan x \\ \frac{d}{dx}(\operatorname{cosec} x) &= -\operatorname{cosec} x\cot x \\ \frac{d}{dx}(\cot x) &= -\operatorname{cosec}^2 x \end{aligned}

Worked example 12.7 · A maximum

Find the coordinates of the stationary point of y=ln⁡xxy = \dfrac{\ln x}{x}, x>0x > 0, and show that it is a maximum.


  1. With u=ln⁡xu = \ln x and v=xv = x:

    dydx=x×1x−ln⁡x×1x2=1−ln⁡xx2\begin{aligned} \frac{dy}{dx} &= \frac{x \times \frac{1}{x} - \ln x \times 1}{x^2} \\ &= \frac{1 - \ln x}{x^2} \end{aligned}
  2. This is 00 when ln⁡x=1\ln x = 1, so x=ex = e and y=1ey = \frac{1}{e}.

  3. x2x^2 is positive, so dydx\frac{dy}{dx} has the sign of 1−ln⁡x1 - \ln x: positive for x<ex < e and negative for x>ex > e. The curve rises then falls, so (e,1e)\left(e, \tfrac{1}{e}\right) is a maximum.

6. Using dx/dy

Key result

dxdy=1  dydx  \frac{dx}{dy} = \frac{1}{\;\dfrac{dy}{dx}\;}

So when xx is given as a function of yy, find dxdy\frac{dx}{dy} and turn it upside down.

Worked example 12.8 · Turning the gradient upside down

A curve has equation x=y3+yx = y^3 + y. Find the gradient of the curve at the point (2,1)(2, 1).


  1. dxdy=3y2+1\frac{dx}{dy} = 3y^2 + 1, which is 44 when y=1y = 1.

  2. So dydx=14\frac{dy}{dx} = \frac{1}{4} at (2,1)(2, 1).

Where the derivative of ln comes from

If y=ln⁡xy = \ln x, then x=eyx = e^y, so dxdy=ey=x\frac{dx}{dy} = e^y = x. Turning it upside down gives dydx=1x\frac{dy}{dx} = \frac{1}{x}.

Practice

Twelve questions in three tiers. Try each one properly before opening the solution — the solutions show full method, not just answers.

Warm-up

1 [4 marks]

Differentiate each of these with respect to xx.

  1. e5xe^{5x} [1]
  2. 4ln⁡x4\ln x [1]
  3. 3x3^x [1]
  4. sin⁡4x\sin 4x [1]
Show solution

(a) 5e5x5e^{5x} (b) 4x\dfrac{4}{x} (c) 3xln⁡33^x\ln 3 (d) 4cos⁡4x4\cos 4x

2 [2 marks]

Differentiate y=(2x+1)6y = (2x + 1)^6.

Show solution

By the chain rule, with inside 2x+12x + 1:

dydx=6(2x+1)5×2=12(2x+1)5\frac{dy}{dx} = 6(2x + 1)^5 \times 2 = 12(2x + 1)^5
3 [2 marks]

Differentiate y=x3ln⁡xy = x^3\ln x.

Show solution

By the product rule, with u=x3u = x^3 and v=ln⁡xv = \ln x:

dydx=x3×1x+ln⁡x×3x2=x2(1+3ln⁡x)\begin{aligned} \frac{dy}{dx} &= x^3 \times \frac{1}{x} + \ln x \times 3x^2 \\ &= x^2(1 + 3\ln x) \end{aligned}
4 [2 marks]

Differentiate y=xx+1y = \dfrac{x}{x + 1}.

Show solution

By the quotient rule, with u=xu = x and v=x+1v = x + 1:

dydx=(x+1)×1−x×1(x+1)2=1(x+1)2\begin{aligned} \frac{dy}{dx} &= \frac{(x + 1) \times 1 - x \times 1}{(x + 1)^2} \\ &= \frac{1}{(x + 1)^2} \end{aligned}

Standard

5 [3 marks]

Find the gradient of y=esin⁡xy = e^{\sin x} at the point where x=πx = \pi.

Show solution

By the chain rule, dydx=cos⁡x esin⁡x\dfrac{dy}{dx} = \cos x\,e^{\sin x}. At x=πx = \pi this is cos⁡π×e0=−1\cos\pi \times e^0 = -1.

6 [6 marks]

Find the coordinates of the stationary points of y=x2e−xy = x^2e^{-x}, and determine their nature.

Show solution

By the product rule,

dydx=x2×(−e−x)+e−x×2x=xe−x(2−x)\begin{aligned} \frac{dy}{dx} &= x^2 \times (-e^{-x}) + e^{-x} \times 2x \\ &= xe^{-x}(2 - x) \end{aligned}

which is 00 when x=0x = 0 or x=2x = 2: the points (0,0)(0, 0) and (2,4e−2)(2, 4e^{-2}).

Differentiating again, d2ydx2=e−x(x2−4x+2)\dfrac{d^2y}{dx^2} = e^{-x}(x^2 - 4x + 2). At x=0x = 0 this is 2>02 > 0, so (0,0)(0, 0) is a minimum. At x=2x = 2 it is −2e−2<0-2e^{-2} < 0, so (2,4e−2)(2, 4e^{-2}) is a maximum.

7 [3 marks]

Show that ddx(sec⁡x)=sec⁡xtan⁡x\dfrac{d}{dx}(\sec x) = \sec x\tan x.

Show solution

Write sec⁡x=(cos⁡x)−1\sec x = (\cos x)^{-1} and use the chain rule:

ddx(cos⁡x)−1=−(cos⁡x)−2×(−sin⁡x)=1cos⁡x×sin⁡xcos⁡x=sec⁡xtan⁡x\begin{aligned} &\frac{d}{dx}(\cos x)^{-1} \\ &= -(\cos x)^{-2} \times (-\sin x) \\ &= \frac{1}{\cos x} \times \frac{\sin x}{\cos x} = \sec x\tan x \end{aligned}
8 [3 marks]

A curve has equation x=y2−4yx = y^2 - 4y. Find the gradient of the curve at the point (−3,1)(-3, 1).

Show solution

dxdy=2y−4\dfrac{dx}{dy} = 2y - 4, which is −2-2 when y=1y = 1. So dydx=−12\dfrac{dy}{dx} = -\tfrac{1}{2} at (−3,1)(-3, 1).

9 [4 marks]

Find the equation of the tangent to y=ln⁡(2x−3)y = \ln(2x - 3) at the point where x=2x = 2.

Show solution

When x=2x = 2, y=ln⁡1=0y = \ln 1 = 0. By the chain rule, dydx=22x−3\dfrac{dy}{dx} = \dfrac{2}{2x - 3}, which is 22 when x=2x = 2. The tangent is y−0=2(x−2)y - 0 = 2(x - 2), that is y=2x−4y = 2x - 4.

Exam style

10 [6 marks]
f(x)=x2+3x−1,x>1f(x) = \frac{x^2 + 3}{x - 1}, \quad x > 1
  1. Show that f′(x)=(x−3)(x+1)(x−1)2f'(x) = \dfrac{(x - 3)(x + 1)}{(x - 1)^2}. [3]
  2. Find the coordinates of the stationary point of y=f(x)y = f(x), and show that it is a minimum. [3]
Show solution

(a) By the quotient rule,

f′(x)=(x−1)×2x−(x2+3)×1(x−1)2=x2−2x−3(x−1)2=(x−3)(x+1)(x−1)2\begin{aligned} &f'(x) \\ &= \frac{(x - 1) \times 2x - (x^2 + 3) \times 1}{(x - 1)^2} \\ &= \frac{x^2 - 2x - 3}{(x - 1)^2} = \frac{(x - 3)(x + 1)}{(x - 1)^2} \end{aligned}

(b) For x>1x > 1, f′(x)=0f'(x) = 0 only when x=3x = 3, and f(3)=122=6f(3) = \tfrac{12}{2} = 6. The denominator and x+1x + 1 are positive, so f′(x)f'(x) has the sign of x−3x - 3: negative just before x=3x = 3 and positive just after. So (3,6)(3, 6) is a minimum.

11 [5 marks]

Given that sin⁡hh→1\dfrac{\sin h}{h} \to 1 and cos⁡h−1h→0\dfrac{\cos h - 1}{h} \to 0 as h→0h \to 0, prove from first principles that the derivative of cos⁡x\cos x is −sin⁡x-\sin x.

Show solution

Using the addition formula,

cos⁡(x+h)−cos⁡x=cos⁡xcos⁡h−sin⁡xsin⁡h−cos⁡x=cos⁡x(cos⁡h−1)−sin⁡xsin⁡h\begin{aligned} &\cos(x + h) - \cos x \\ &= \cos x\cos h - \sin x\sin h - \cos x \\ &= \cos x(\cos h - 1) - \sin x\sin h \end{aligned}

Dividing by hh,

cos⁡(x+h)−cos⁡xh=cos⁡x⋅cos⁡h−1h−sin⁡x⋅sin⁡hh\begin{aligned} &\frac{\cos(x + h) - \cos x}{h} \\ &= \cos x \cdot \frac{\cos h - 1}{h} - \sin x \cdot \frac{\sin h}{h} \end{aligned}

As h→0h \to 0 this tends to cos⁡x×0−sin⁡x×1=−sin⁡x\cos x \times 0 - \sin x \times 1 = -\sin x.

12 [7 marks]

A hot drink cools so that its temperature tt minutes after it is made is T=20+70e−0.05tT = 20 + 70e^{-0.05t} °C.

  1. State its temperature when it is made. [1]
  2. Find the rate at which it is cooling after 10 minutes. [3]
  3. Find when it is cooling at 11 °C per minute, and its temperature then. [3]
Show solution

(a) At t=0t = 0, T=20+70=90T = 20 + 70 = 90 °C.

(b) dTdt=70×(−0.05)e−0.05t=−3.5e−0.05t\dfrac{dT}{dt} = 70 \times (-0.05)e^{-0.05t} = -3.5e^{-0.05t}. At t=10t = 10 this is −3.5e−0.5=−2.12-3.5e^{-0.5} = -2.12 (3 s.f.), so it is cooling at 2.122.12 °C per minute.

(c) 3.5e−0.05t=13.5e^{-0.05t} = 1 gives e−0.05t=13.5e^{-0.05t} = \tfrac{1}{3.5}, so

t=ln⁡3.50.05=25.1 minutes (3 s.f.)t = \frac{\ln 3.5}{0.05} = 25.1 \text{ minutes (3 s.f.)}

Then T=20+70×13.5=40T = 20 + 70 \times \tfrac{1}{3.5} = 40 °C.