Educerie

This whole subtopic is higher level. Nothing in it is on an SL paper.

Educerie · IB Diploma · Mathematics: analysis and approaches

IB Mathematics AA 5.12 · HL only

Continuity, differentiability and first principles

Where does the derivative actually come from, when can a curve be said to have one, and what happens when you differentiate again and again?

What you will learn

  • HL Understand informally what makes a function continuous or differentiable at a point, and why a corner breaks differentiability
  • HL Understand a limit as the value a function heads for, and when functions, sequences and series converge or diverge
  • HL Know the first principles definition of the derivative and how it proves the rules for polynomials
  • HL Know how to find and write higher derivatives, and how their patterns lead to proof by induction

You must be able to

  1. HL Prove by induction a formula for the nth derivative of a function
  2. HL Show from first principles the derivative of a polynomial, writing the limit on the right line
  3. HL Find higher derivatives, including d²y ÷ dx² and d³y ÷ dx³ in terms of y
  4. HL Find limits as x tends to infinity and use them to state horizontal asymptotes
  5. HL Find a limit of the form 0 ÷ 0 by factorising and cancelling
  6. HL Determine whether a sequence or geometric series converges, and find its limit

In the exam. higher derivatives, most often as a proof by induction of a formula for f(n)(x)f^{(n)}(x) on Paper 1 (7 to 9 marks, for functions such as x2exx^{2}e^{x}, xepxxe^{px} or ln⁡x\ln x), or as a 2 mark "find an expression for d3ydx3\dfrac{d^{3}y}{dx^{3}} in terms of yy"; limits as x→∞x\to\infty, such as "by considering limits, show that the graph has a horizontal asymptote" (2 marks); and differentiation from first principles for a polynomial, which the guide lists, so you must be able to write it out in full. Paper 3: limits and convergence as ideas inside a longer investigation. The guide says you will not be asked to test a function for continuity or differentiability in an examination; you need the ideas, because the rest of HL calculus rests on them.

1Continuity: a graph with no break

Informally, a function is continuous at x=ax = a if you can draw its graph through that point without lifting your pen. Precisely, three things must hold:

  1. f(a)f(a) is defined;
  2. the graph heads for one finite height as xx closes in on aa, from the left and from the right (the limit exists, section 3);
  3. that height is the value: lim⁡x→af(x)=f(a)\lim_{x\to a} f(x) = f(a).

Each condition can fail on its own. Figure 1 draws all three failures.

Figure 1 · Three ways to break continuity at a point (a) a jump km € 3 4 7 left 4, right 7 (b) a hole x y 2 4 no f(2) (c) an infinite break x y 1 −4 4 x = 1 (a) the one-sided limits differ; (b) the limit exists but f(2) does not; (c) no value, no finite limit.
Figure 1 · Three ways to break continuity
  • A jump. A taxi fare of €4 for the first 3 km and €7 after that jumps at x=3x = 3. The fare is 4 from the left and 7 from the right. There is no single height to head for, so condition 2 fails.
  • A hole. f(x)=x2−4x−2f(x) = \dfrac{x^{2}-4}{x-2} is a straight line with one point missing. It heads for 4 at x=2x = 2 but has no value there, so condition 1 fails. Define f(2)=4f(2) = 4 and the hole is filled (a removable discontinuity). Define f(2)=1f(2) = 1 and condition 3 fails instead.
  • An infinite break. f(x)=1x−1f(x) = \dfrac{1}{x-1} has a vertical asymptote at x=1x = 1. There is no value and no finite height to head for.

Redefining one value cannot repair a jump or an infinite break.

Polynomials, exe^{x}, sin⁡x\sin x and cos⁡x\cos x are continuous everywhere. Rational functions, ln⁡x\ln x and tan⁡x\tan x are continuous on their domains. The breaks come where they are not defined.

Joining two pieces. A function of two pieces meeting at x=cx = c is continuous at cc when both pieces give the same value there. That gives an equation for an unknown constant.

Worked example 1. Find kk so that ff is continuous at x=2x = 2, where f(x)=kx2+3f(x) = kx^{2} + 3 for x≤2x \le 2 and f(x)=5x−kf(x) = 5x - k for x>2x > 2.

left piece at x=2: 4k+3the formula for x≤2 is the one that owns f(2)\text{left piece at } x = 2\text{: } \quad 4k + 3 \qquad \textcolor{#838c91}{\text{the formula for }x \le 2\text{ is the one that owns }f(2)}right piece at x=2: 10−kwhat the other branch is heading for\text{right piece at } x = 2\text{: } \quad 10 - k \qquad \textcolor{#838c91}{\text{what the other branch is heading for}}no break: 4k+3=10−k  ⇒  5k=7  ⇒  k=75\text{no break: } \quad 4k + 3 = 10 - k \;\Rightarrow\; 5k = 7 \;\Rightarrow\; k = \frac{7}{5}

Worked example 2. g(x)=x2+2x−15x+5g(x) = \dfrac{x^{2}+2x-15}{x+5} is not defined at x=−5x = -5. What kind of break is it, and how is it repaired?

g(x)=(x+5)(x−3)x+5=x−3(x≠−5)factorise, then cancelg(x) = \frac{(x+5)(x-3)}{x+5} = x - 3 \quad (x \ne -5) \qquad \textcolor{#838c91}{\text{factorise, then cancel}}

The graph is the line y=x−3y = x - 3 with one point missing, heading for −8-8. It is a removable hole. Define g(−5)=−8g(-5) = -8 and it is continuous there.

2Differentiability: a graph with one tangent

A function is differentiable at x=ax = a if the limit

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

exists, with the same value whether hh approaches 0 from above or below. The graph has a single, non-vertical tangent there. Zoom in far enough and a differentiable function looks like a straight line.

Differentiable implies continuous. Suppose f′(a)f'(a) exists. Then

f(a+h)−f(a)=h×f(a+h)−f(a)h  →  0×f′(a)=0as h→0f(a+h) - f(a) = h \times \frac{f(a+h)-f(a)}{h} \;\to\; 0 \times f'(a) = 0 \quad\text{as } h \to 0

so f(a+h)→f(a)f(a+h) \to f(a), which is condition 3 of continuity. A break always destroys the tangent.

The converse is false. This is the key point: a function can be continuous everywhere and still fail to be differentiable at some points. Figure 2 shows the two ways.

Figure 2 · Continuous at 0, but not differentiable there (a) y = |x|: a corner x y −2 2 1 2 gradient −1 gradient +1 no single tangent (b) y = ∛x: a vertical tangent x y −2 2 −1 1 tangent at 0 is vertical Both graphs are drawn without lifting the pen, yet neither has a gradient at x = 0.
Figure 2 · Continuous, but not differentiable at 0

A corner. f(x)=∣x∣f(x) = \lvert x\rvert is continuous at 0: you draw the V in one stroke. But the chord gradients disagree from the two sides.

h>0:∣0+h∣−∣0∣h=hh=1h > 0: \quad \frac{\lvert 0+h\rvert - \lvert 0\rvert}{h} = \frac{h}{h} = 1h<0:∣0+h∣−∣0∣h=−hh=−1∣h∣=−h when h is negativeh < 0: \quad \frac{\lvert 0+h\rvert - \lvert 0\rvert}{h} = \frac{-h}{h} = -1 \qquad \textcolor{#838c91}{\lvert h\rvert = -h\text{ when }h\text{ is negative}}the right-hand limit is 1, the left-hand limit is −1, so f′(0) does not exist\text{the right-hand limit is } 1\text{, the left-hand limit is } -1\text{, so } f'(0) \text{ does not exist}

A vertical tangent

  • f(x)=x3f(x) = \sqrt[3]{x} is continuous at 0 and looks smooth, but the curve stands vertically there. The chord gradient is h3h=1h23\dfrac{\sqrt[3]{h}}{h} = \dfrac{1}{\sqrt[3]{h^{2}}}, which grows without bound as h→0h \to 0. A vertical line has no gradient, so f′(0)f'(0) does not exist.
  • A cusp, where a curve comes to a sharp point with both halves vertical, fails for both reasons at once.

The domain of f′f' is the set of xx where the limit exists, so it can be smaller than the domain of ff. For ∣x∣\lvert x\rvert, f′(x)=1f'(x) = 1 for x>0x > 0, −1-1 for x<0x < 0, and nothing at x=0x = 0.

Differentiable at a join. Two pieces meeting at x=cx = c give a differentiable function when they have the same value and the same gradient at cc. A corner has matching values but different gradients.

Worked example 3. Let f(x)=x3+x2f(x) = x^{3} + x^{2} for x≤1x \le 1 and f(x)=ax+bf(x) = ax + b for x>1x > 1. Find aa and bb so that ff is continuous and differentiable at x=1x = 1.

gradients match: 3x2+2x=5 at x=1  ⇒  a=5the right piece is a line, so its gradient is a everywhere\text{gradients match: } \quad 3x^{2} + 2x = 5 \text{ at } x = 1 \;\Rightarrow\; a = 5 \qquad \textcolor{#838c91}{\text{the right piece is a line, so its gradient is }a\text{ everywhere}}values match: 13+12=2=a+b  ⇒  b=2−5=−3\text{values match: } \quad 1^{3} + 1^{2} = 2 = a + b \;\Rightarrow\; b = 2 - 5 = -3

A parabola joined to its own tangent line is a smooth join, such as x2x^{2} then 2x−12x-1 at x=1x=1.

3Limits: where a function is heading

The hole in section 1, f(x)=x2−4x−2f(x) = \dfrac{x^{2}-4}{x-2}, has no value at x=2x = 2, but you can ask what happens near 2. Since (x−2)(x+2)x−2=x+2\dfrac{(x-2)(x+2)}{x-2} = x+2 for every xx except 2, close to 2 the value is close to 4.

xx1.91.91.991.991.9991.999222.0012.0012.012.012.12.1
f(x)f(x)3.93.93.993.993.9993.999undefined4.0014.0014.014.014.14.1

We write this as

lim⁡x→af(x)=L\boldsymbol{\lim_{x\to a} f(x) = L} means f(x)f(x) can be made as close to LL as you like by taking xx close enough to aa, from either side, but not equal to aa.

So lim⁡x→2x2−4x−2=4\lim_{x\to 2}\dfrac{x^{2}-4}{x-2} = 4. Figure 3 draws it: the line heads for the hole from both sides.

Figure 3 · y = (x² − 4)/(x − 2) near x = 2 x y 1 2 3 4 2 4 6 from the left from the right hole at (2, 4) The function has no value at x = 2, but from both sides f(x) heads for 4: the limit is 4.
Figure 3 · A limit is where the graph is heading, not what happens at the point

Three things follow from the definition.

The value at aa does not matter. The limit looks at xx near aa, never at x=ax = a. The function can be undefined there (as here), or defined as something else. The limit is unchanged.

Both sides must agree

  • x→a−x \to a^{-} means xx approaches aa from below, and x→a+x \to a^{+} from above. These are the one-sided limits. The limit exists only if the two one-sided limits exist and are equal.
  • Example: ∣x−1∣x−1\dfrac{\lvert x-1\rvert}{x-1} as x→1x \to 1. From above it is x−1x−1=1\dfrac{x-1}{x-1} = 1. From below it is −(x−1)x−1=−1\dfrac{-(x-1)}{x-1} = -1. So the limit does not exist.

A limit must be a finite number. If f(x)f(x) grows without bound as x→ax \to a, as 1(x−1)2\dfrac{1}{(x-1)^{2}} does as x→1x \to 1, you may write "f(x)→∞f(x) \to \infty". The limit does not exist.

A zero over zero at a point. When substituting aa gives 00\dfrac{0}{0}, the top and bottom share a factor (x−a)(x-a). Factorise, cancel (legal, because x≠ax \ne a), then substitute.

lim⁡x→−3x2−x−12x+3=lim⁡x→−3(x−4)(x+3)x+3=lim⁡x→−3(x−4)=−7cancel the shared factor, then put x=−3 in\lim_{x\to -3}\frac{x^{2}-x-12}{x+3}= \lim_{x\to -3}\frac{(x-4)(x+3)}{x+3} = \lim_{x\to -3}(x-4) = -7 \qquad \textcolor{#838c91}{\text{cancel the shared factor, then put }x=-3\text{ in}}

Limits of this kind that cannot be factored wait for l'Hôpital's rule in 5.13.

4Convergence and divergence

Convergence = settling down to one finite value.

Divergence = anything else: growing without bound, or never settling at all.

Both apply to functions, sequences and series.

A function as x→∞x \to \infty

  • f(x)=2+1xf(x) = 2 + \dfrac{1}{x} converges to 2 as x→∞x \to \infty, because the 1x\dfrac{1}{x} part shrinks to nothing. That limit is the horizontal asymptote y=2y = 2 from SL 2.8.
    • x210\dfrac{x^{2}}{10} diverges: it grows without bound.
    • sin⁡x\sin x diverges by oscillating: it keeps sweeping between −1-1 and 11. Some books call this "neither convergent nor divergent". Either way, no limit.

Figure 4 shows the three behaviours side by side.

Figure 4 · Three ways a function can behave as x → ∞ (a) 2 + 1/x converges to 2 x y 5 10 2 4 y = 2 (b) x²/10 diverges to ∞ x y 5 10 5 10 (c) sin x oscillates x y −1 1 2π 4π Only (a) settles on one finite value. (b) grows without bound; (c) never settles. Both diverge.
Figure 4 · Three ways a function can behave as x → ∞

Limits at infinity, for a fraction

  • Two facts do most of the work: 1xn→0\dfrac{1}{x^{n}} \to 0 as x→±∞x \to \pm\infty for any n>0n > 0, and e−x→0e^{-x} \to 0 as x→∞x \to \infty.
  • When the top and bottom both grow, divide every term by the highest power of xx in the denominator (or by the dominant exponential). Each piece then settles or vanishes.
lim⁡x→∞7x3−2x2x3+x2+5=lim⁡x→∞7−2x22+1x+5x3=72divide top and bottom by x3\lim_{x\to\infty}\frac{7x^{3}-2x}{2x^{3}+x^{2}+5} = \lim_{x\to\infty}\frac{7-\frac{2}{x^{2}}}{2+\frac{1}{x}+\frac{5}{x^{3}}} = \frac{7}{2} \qquad \textcolor{#838c91}{\text{divide top and bottom by }x^{3}}lim⁡x→∞5ex−2ex+6=lim⁡x→∞5−2e−x1+6e−x=5divide top and bottom by ex\lim_{x\to\infty}\frac{5e^{x}-2}{e^{x}+6} = \lim_{x\to\infty}\frac{5-2e^{-x}}{1+6e^{-x}} = 5 \qquad \textcolor{#838c91}{\text{divide top and bottom by }e^{x}}lim⁡x→−∞5ex−2ex+6=0−20+6=−13ex→0 as x→−∞: nothing to divide\lim_{x\to-\infty}\frac{5e^{x}-2}{e^{x}+6} = \frac{0-2}{0+6} = -\frac{1}{3} \qquad \textcolor{#838c91}{e^{x} \to 0\text{ as }x \to -\infty\text{: nothing to divide}}x3+1x2+4=x−4x−1x2+4→∞top has the higher power: the limit does not exist\frac{x^{3}+1}{x^{2}+4} = x - \frac{4x-1}{x^{2}+4} \to \infty \qquad \textcolor{#838c91}{\text{top has the higher power: the limit does not exist}}

For a rational function:

  • The same power on top and bottom gives the ratio of the leading coefficients.
  • A lower power on top gives 0.
  • A higher power on top diverges.

If lim⁡x→∞f(x)=L\lim_{x\to\infty} f(x) = L, the graph has the horizontal asymptote y=Ly = L (SL 2.8). The third line above shows why you check x→−∞x \to -\infty separately. The same function has two horizontal asymptotes, y=5y = 5 on the right and y=−13y = -\tfrac{1}{3} on the left.

A sequence. The sequence un=3n−1n+2u_{n} = \dfrac{3n-1}{n+2} has terms 23, 54, 85, …\tfrac{2}{3},\ \tfrac{5}{4},\ \tfrac{8}{5},\ \ldots. Divide top and bottom by nn: un=3−1n1+2n→3u_{n} = \dfrac{3 - \frac{1}{n}}{1 + \frac{2}{n}} \to 3. So it converges to 3. The sequence 2,−2,2,−2,…2, -2, 2, -2, \ldots diverges by oscillation.

A series. A series converges if its partial sums SnS_{n} converge. You met the key case in SL 1.8. A geometric series converges exactly when ∣r∣<1\lvert r\rvert < 1, and then

S∞=u11−rS_{\infty} = \dfrac{u_{1}}{1-r}, for ∣r∣<1\lvert r\rvert < 1.

Figure 5 plots the partial sums of 1+12+14+⋯1 + \tfrac{1}{2} + \tfrac{1}{4} + \cdots creeping up towards 2. It also plots the partial sums of 1+1.1+1.21+⋯1 + 1.1 + 1.21 + \cdots running away.

Figure 5 · Partial sums Sₙ of two geometric series n Sₙ 1 2 3 4 5 6 7 8 9 10 2 5 10 15 S∞ = 2 r = 1.1: diverges r = ½: converges to 2 With |r| < 1 each new term adds less, and the sums close in on 2. With r = 1.1 they run off.
Figure 5 · One series converges, one diverges

A derivative is a convergence question too. As hh shrinks, the chord gradients form a list of numbers. If it converges, its limit is the derivative.

5Differentiation from first principles

This is the method the guide names, and the formula booklet gives it:

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

Figure 6 takes y=x2y = x^{2} and the point P(3,9)\mathrm{P}(3, 9). Q\mathrm{Q} is a second point on the curve, hh to the right of P\mathrm{P}. The chord PQ\mathrm{PQ} has gradient f(3+h)−f(3)h\dfrac{f(3+h)-f(3)}{h}.

As hh shrinks, Q\mathrm{Q} slides down the curve towards P\mathrm{P}, and the chord swings round towards the tangent.

Figure 6 · Chords to P(3, 9) on y = x² x y 1 2 3 4 5 6 5 10 15 20 25 Q, h = 2: gradient 8 h = 1: gradient 7 h = ½: gradient 6.5 P(3, 9) tangent at P, gradient 6 Each chord PQ has gradient 6 + h. As h → 0 the grey chords close in on the amber tangent.
Figure 6 · Chords PQ turn into the tangent at P as h → 0

The numbers do the same thing:

hh110.10.10.010.010.0010.001
chord gradient (3+h)2−9h\dfrac{(3+h)^{2}-9}{h}776.16.16.016.016.0016.001

The chord gradients converge to 6, so the gradient of the tangent at P\mathrm{P} is 6. A table only suggests a limit. The proof is algebra, done for a general xx to get the whole gradient function.

The method, always in this order.

  1. Write f(x+h)f(x+h).
  2. Subtract f(x)f(x). Every term without an hh must cancel.
  3. Divide by hh. Every remaining term has at least one factor hh, so this is legal.
  4. Only now let h→0h \to 0.

Putting h=0h = 0 at the start gives 00\dfrac{0}{0}, which tells you nothing. The algebra exists to remove it.

Worked example 4. Paper 1. Use differentiation from first principles to find the derivative of f(x)=4x2+6x−11f(x) = 4x^{2}+6x-11.

f′(x)=lim⁡h→0f(x+h)−f(x)hthe definition: always the first linef'(x) = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \qquad \textcolor{#838c91}{\text{the definition: always the first line}}f(x+h)=4(x+h)2+6(x+h)−11=4x2+8xh+4h2+6x+6h−11f(x+h) = 4(x+h)^{2} + 6(x+h) - 11 = 4x^{2} + 8xh + 4h^{2} + 6x + 6h - 11f(x+h)−f(x)=8xh+4h2+6h4x2, 6x and −11 cancel: they always shouldf(x+h) - f(x) = 8xh + 4h^{2} + 6h \qquad \textcolor{#838c91}{4x^{2}\text{, }6x\text{ and }-11\text{ cancel: they always should}}f(x+h)−f(x)h=8x+4h+6h≠0, so dividing by h is allowed\frac{f(x+h) - f(x)}{h} = 8x + 4h + 6 \qquad \textcolor{#838c91}{h \ne 0\text{, so dividing by }h\text{ is allowed}}f′(x)=lim⁡h→0(8x+4h+6)=8x+6f'(x) = \lim_{h\to 0}\left(8x + 4h + 6\right) = 8x + 6

It agrees with the power rule, a shortcut for this calculation.

Worked example 5. Paper 1. Show from first principles that the derivative of f(x)=3x3−2x2+8f(x) = 3x^{3}-2x^{2}+8 is 9x2−4x9x^{2}-4x.

f′(x)=lim⁡h→0f(x+h)−f(x)hthe definition firstf'(x) = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \qquad \textcolor{#838c91}{\text{the definition first}}(x+h)3=x3+3x2h+3xh2+h3binomial expansion, SL 1.9(x+h)^{3} = x^{3} + 3x^{2}h + 3xh^{2} + h^{3} \qquad \textcolor{#838c91}{\text{binomial expansion, SL 1.9}}f(x+h)=3x3+9x2h+9xh2+3h3−2x2−4xh−2h2+8f(x+h) = 3x^{3} + 9x^{2}h + 9xh^{2} + 3h^{3} - 2x^{2} - 4xh - 2h^{2} + 8f(x+h)−f(x)=9x2h+9xh2+3h3−4xh−2h23x3, −2x2 and 8 cancelf(x+h) - f(x) = 9x^{2}h + 9xh^{2} + 3h^{3} - 4xh - 2h^{2} \qquad \textcolor{#838c91}{3x^{3}\text{, }-2x^{2}\text{ and 8 cancel}}f(x+h)−f(x)h=9x2+9xh+3h2−4x−2h\frac{f(x+h) - f(x)}{h} = 9x^{2} + 9xh + 3h^{2} - 4x - 2hf′(x)=lim⁡h→0(9x2+9xh+3h2−4x−2h)=9x2−4xas requiredf'(x) = \lim_{h\to 0}\left(9x^{2} + 9xh + 3h^{2} - 4x - 2h\right) = 9x^{2} - 4x \qquad \textcolor{#838c91}{\text{as required}}

A constant cancels in the subtraction, so it differentiates to zero. A linear term cxcx leaves chch, then cc, so it differentiates to its coefficient.

Worked example 6. Use the definition to find the gradient of f(x)=4x2−9xf(x) = 4x^{2} - 9x at the single point x=3x = 3.

f′(3)=lim⁡h→0f(3+h)−f(3)hthe definition at the point x=3f'(3) = \lim_{h\to 0}\frac{f(3+h)-f(3)}{h} \qquad \textcolor{#838c91}{\text{the definition at the point }x = 3}f(3+h)−f(3)=4(9+6h+h2)−27−9h−9=15h+4h2f(3)=36−27=9f(3+h) - f(3) = 4(9 + 6h + h^{2}) - 27 - 9h - 9 = 15h + 4h^{2} \qquad \textcolor{#838c91}{f(3) = 36 - 27 = 9}f′(3)=lim⁡h→015h+4h2h=lim⁡h→0(15+4h)=15f'(3) = \lim_{h\to 0}\frac{15h + 4h^{2}}{h} = \lim_{h\to 0}(15 + 4h) = 15

Use this version when a question gives a point.

Worked example 7. Paper 1, "find, hence". Let f(x)=2x2−12x+5f(x) = 2x^{2} - 12x + 5. Find f′(x)f'(x) from first principles, and hence find the coordinates of the point where the tangent is horizontal.

f′(x)=lim⁡h→0f(x+h)−f(x)hthe definition firstf'(x) = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \qquad \textcolor{#838c91}{\text{the definition first}}f(x+h)−f(x)=4xh+2h2−12h  ⇒  f(x+h)−f(x)h=4x+2h−12  ⇒  f′(x)=4x−12f(x+h) - f(x) = 4xh + 2h^{2} - 12h \;\Rightarrow\; \frac{f(x+h)-f(x)}{h} = 4x + 2h - 12 \;\Rightarrow\; f'(x) = 4x - 12horizontal tangent: 4x−12=0  ⇒  x=3,f(3)=18−36+5=−13\text{horizontal tangent: } 4x - 12 = 0 \;\Rightarrow\; x = 3, \quad f(3) = 18 - 36 + 5 = -13

The point is (3,−13)(3, -13).

The power rule, proved. The same argument works for xnx^{n} with any positive integer nn.

(x+h)n=xn+nxn−1h+(n2)xn−2h2+⋯+hn(x+h)^{n} = x^{n} + nx^{n-1}h + \binom{n}{2}x^{n-2}h^{2} + \cdots + h^{n}(x+h)n−xnh=nxn−1+(n2)xn−2h+⋯+hn−1\frac{(x+h)^{n} - x^{n}}{h} = nx^{n-1} + \binom{n}{2}x^{n-2}h + \cdots + h^{n-1}every term after the first contains h, so as h→0:\text{every term after the first contains } h\text{, so as } h \to 0\text{:}ddx(xn)=nxn−1\frac{d}{dx}\left(x^{n}\right) = nx^{n-1}

The same working on a general quadratic ax2+bx+cax^{2}+bx+c gives 2ax+b2ax+b. The hh-terms are 2axh+ah2+bh2axh + ah^{2} + bh, and dividing by hh leaves 2ax+ah+b2ax + ah + b.

The guide limits first-principles questions to polynomials. You will not be asked to do sin⁡x\sin x or exe^{x} this way.

6Higher derivatives

f′(x)f'(x) is itself a function, so it can be differentiated again. That gives the second derivative, then the third, fourth and beyond. You need two notations.

DerivativeFunction notationLeibniz notation
firstf′(x)f'(x)dydx\dfrac{dy}{dx}
secondf′′(x)f''(x)d2ydx2\dfrac{d^{2}y}{dx^{2}}
thirdf′′′(x)f'''(x)d3ydx3\dfrac{d^{3}y}{dx^{3}}
nthf(n)(x)f^{(n)}(x)dnydxn\dfrac{d^{n}y}{dx^{n}}

In f(n)(x)f^{(n)}(x) the brackets round nn are essential. f(3)(x)f^{(3)}(x) is the third derivative. f3(x)f^{3}(x) would mean f(x)f(x) cubed.

In d2ydx2\dfrac{d^{2}y}{dx^{2}} the 2 sits on the dd on top and on the xx underneath. It is "dd by dxdx, twice" applied to yy.

For a polynomial, each derivative lowers the degree by one, so the derivatives eventually reach zero. Figure 7 draws f(x)=x3−3xf(x) = x^{3}-3x and its first three derivatives: a cubic, a parabola, a line and a constant.

Figure 7 · f(x) = x³ − 3x and its derivatives x y −2 −1 1 2 −6 −3 3 6 f″(x) = 6x f′(x) = 3x² − 3 f(x) f‴(x) = 6 Where f turns (x = ±1), f′ crosses zero; where f′ turns (x = 0), f″ crosses zero. Next, f⁽⁴⁾(x) = 0.
Figure 7 · Each derivative is the gradient function of the one before

Other functions never run out. They produce patterns.

y=e−2x:−2e−2x, 4e−2x, −8e−2x, …  ⇒  dnydxn=(−2)ne−2xy = e^{-2x}: \quad -2e^{-2x},\ 4e^{-2x},\ -8e^{-2x},\ \ldots \;\Rightarrow\; \frac{d^{n}y}{dx^{n}} = (-2)^{n}e^{-2x}y=cos⁡3x:−3sin⁡3x, −9cos⁡3x, 27sin⁡3x, 81cos⁡3x, …back to cos⁡3x times 81 after foury = \cos 3x: \quad -3\sin 3x,\ -9\cos 3x,\ 27\sin 3x,\ 81\cos 3x,\ \ldots \qquad \textcolor{#838c91}{\text{back to }\cos 3x\text{ times }81\text{ after four}}y=x6:6x5, 30x4, 120x3, 360x2, 720x, 720, 0f(7)(x)=0y = x^{6}: \quad 6x^{5},\ 30x^{4},\ 120x^{3},\ 360x^{2},\ 720x,\ 720,\ 0 \qquad \textcolor{#838c91}{f^{(7)}(x) = 0}
dndxn(xk)=k(k−1)⋯(k−n+1) xk−n=k!(k−n)! xk−n,n≤kfor n>k the result is 0\frac{d^{n}}{dx^{n}}\left(x^{k}\right) = k(k-1)\cdots(k-n+1)\,x^{k-n} = \frac{k!}{(k-n)!}\,x^{k-n}, \quad n \le k \qquad \textcolor{#838c91}{\text{for }n > k\text{ the result is 0}}dndxn(eax)=aneax\frac{d^{n}}{dx^{n}}\left(e^{ax}\right) = a^{n}e^{ax}dndxn(sin⁡x)=sin⁡(x+nπ2)each derivative shifts the graph left by π2\frac{d^{n}}{dx^{n}}\left(\sin x\right) = \sin\left(x + \frac{n\pi}{2}\right) \qquad \textcolor{#838c91}{\text{each derivative shifts the graph left by }\tfrac{\pi}{2}}

sin⁡x\sin x and cos⁡x\cos x repeat every four derivatives, so divide nn by 4 and use the remainder. With a constant inside, each derivative also collects a factor: dndxnsin⁡2x=2nsin⁡(2x+nπ2)\dfrac{d^{n}}{dx^{n}}\sin 2x = 2^{n}\sin\left(2x + \dfrac{n\pi}{2}\right).

For n=10n = 10, sin⁡(2x+5π)=−sin⁡2x\sin(2x + 5\pi) = -\sin 2x, so f(10)(x)=−1024sin⁡2xf^{(10)}(x) = -1024\sin 2x.

If you are given dydx\dfrac{dy}{dx} as a function of yy, differentiate again with the chain rule. Then substitute dydx\dfrac{dy}{dx}.

Worked example 8. Given that dydx=3y−y2\dfrac{dy}{dx} = 3y - y^{2}, find d2ydx2\dfrac{d^{2}y}{dx^{2}} and d3ydx3\dfrac{d^{3}y}{dx^{3}} in terms of yy.

d2ydx2=(3−2y)dydx=(3−2y)(3y−y2)=2y3−9y2+9ychain rule: differentiate in y, multiply by dydx\frac{d^{2}y}{dx^{2}} = (3 - 2y)\frac{dy}{dx} = (3-2y)(3y - y^{2}) = 2y^{3} - 9y^{2} + 9y \qquad \textcolor{#838c91}{\text{chain rule: differentiate in }y\text{, multiply by }\frac{dy}{dx}}d3ydx3=(6y2−18y+9)dydxdifferentiate 2y3−9y2+9y with respect to x: the chain rule leaves a factor dydx=(6y2−18y+9)(3y−y2)=−6y4+36y3−63y2+27y\begin{aligned}\frac{d^{3}y}{dx^{3}} &= \left(6y^{2} - 18y + 9\right)\frac{dy}{dx} && \textcolor{#838c91}{\text{differentiate }2y^{3} - 9y^{2} + 9y\text{ with respect to }x\text{: the chain rule leaves a factor }\dfrac{dy}{dx}} \\[6pt] &= (6y^{2}-18y+9)(3y-y^{2}) = -6y^{4} + 36y^{3} - 63y^{2} + 27y\end{aligned}

Spotting the pattern is not proving it. A pattern for f(n)(x)f^{(n)}(x) that holds for n=1,2,3n = 1, 2, 3 might fail at n=50n = 50. The guide links this to proof by induction (AHL 1.15): find the first few derivatives, conjecture the nth, then prove it.

Worked example 9. Paper 1, Section B. Let f(x)=ln⁡xf(x) = \ln x for x>0x > 0. Find f′(x)f'(x), f′′(x)f''(x), f′′′(x)f'''(x), conjecture a formula for f(n)(x)f^{(n)}(x), and prove it by induction for all n∈Z+n \in \mathbb{Z}^{+}.

f′(x)=x−1,f′′(x)=−x−2,f′′′(x)=2x−3,f(4)(x)=−6x−4signs alternate; the numbers are 1,1,2,6f'(x) = x^{-1}, \quad f''(x) = -x^{-2}, \quad f'''(x) = 2x^{-3}, \quad f^{(4)}(x) = -6x^{-4} \qquad \textcolor{#838c91}{\text{signs alternate; the numbers are }1, 1, 2, 6}conjecture: f(n)(x)=(−1)n−1(n−1)! x−n\text{conjecture: } f^{(n)}(x) = (-1)^{n-1}(n-1)!\,x^{-n}n=1: (−1)0 0! x−1=x−1=f′(x)true for n=1n = 1\text{: } (-1)^{0}\,0!\,x^{-1} = x^{-1} = f'(x) \qquad \textcolor{#838c91}{\text{true for }n = 1}assume true for n=k: f(k)(x)=(−1)k−1(k−1)! x−k\text{assume true for } n = k\text{: } f^{(k)}(x) = (-1)^{k-1}(k-1)!\,x^{-k}f(k+1)(x)=(−1)k−1(k−1)!⋅(−k) x−k−1differentiate the assumed form=(−1)k k! x−(k+1)the statement for n=k+1\begin{aligned}f^{(k+1)}(x) &= (-1)^{k-1}(k-1)!\cdot(-k)\,x^{-k-1} && \textcolor{#838c91}{\text{differentiate the assumed form}} \\[6pt] &= (-1)^{k}\,k!\,x^{-(k+1)} && \textcolor{#838c91}{\text{the statement for }n = k+1}\end{aligned}

Then write the conclusion in full, because it carries a mark:

Since the result is true for n=1n = 1, and true for n=k+1n = k+1 whenever it is true for n=kn = k, it is true for all n∈Z+n \in \mathbb{Z}^{+} by mathematical induction.

Higher derivatives also give concavity (SL 5.7), acceleration (SL 5.9) and, at 0, Maclaurin series (AHL 5.19).

Practice questions

1 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.