James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AA HL › Topic 5: Calculus › Limits & first principles

Limits, continuity & first principles

What a limit is, when a function is continuous and when it is differentiable, and how to find a derivative from first principles, including the harder cases 1x and x. Higher derivatives and their patterns.

SL 5.1AHL 5.12HL onlyPaper 1Paper 2≈ 75 min to work through
Before you start: gradients of tangents and the basic rules of differentiation. See Introduction to differentiation.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Find limits informally, including one-sided limits and limits as x→∞AHL 5.12
  • Decide whether a function is continuous at a pointAHL 5.12
  • Decide whether a function is differentiable at a pointAHL 5.12
  • Differentiate polynomials, 1x and x from first principlesAHL 5.12
  • Find higher derivatives and spot patterns in f(n)(x)AHL 5.12

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

The gradient of a curve at a point cannot be found from one point alone: a gradient needs two points. The trick is to take a second point a distance h away, find the gradient of the chord, and ask what happens as h shrinks to 0. That "what happens as" is a limit, and it is the foundation of all of calculus.

2.1 Limits

limx→af(x)=L means that f(x) can be made as close to L as we like by taking x close enough to a (but not equal to a). The value f(a) itself does not matter, and may not even exist.

Worked example 1Paper 1
Find limx→3x2−9x−3.
Substituting x=3 gives 00, which is undefined.
A 00 form means "more work needed", not "no limit".
For x≠3: (x−3)(x+3)x−3=x+3
limx→3(x+3)=6

A limit exists only if the left-hand limit limx→a− and the right-hand limit limx→a+ are equal. For example, |x|x is −1 for x<0 and 1 for x>0, so limx→0|x|x does not exist.

For limits as x→∞, divide top and bottom by the highest power of x: limx→∞3x2+1x2−5=limx→∞3+1/x21−5/x2=3. A limit that is a finite number converges; one that grows without bound diverges.

2.2 Continuity

Continuity at x = a Not in booklet: learn it

f is continuous at x=a if f(a) is defined and limx→af(x)=f(a). Informally: the graph can be drawn through x=a without lifting the pen.

Polynomials, ex, sinx and cosx are continuous everywhere. Problems arise at the joins of piecewise functions and where a function is undefined.

Worked example 2Paper 1
f(x)={x2+k,x<23x−1,x≥2. Find k so that f is continuous.
Left-hand limit at 2: 4+k. Right-hand value: 3(2)−1=5.
The two pieces must meet at the join.
4+k=5⇒k=1

2.3 Differentiability

f is differentiable at a if the graph has a well-defined tangent there: the gradient from the left equals the gradient from the right. Differentiable implies continuous, but not the other way round: y=|x| is continuous at 0 but has a corner there (gradient −1 on the left, +1 on the right), so it is not differentiable at 0.

Differentiable at a join Not in booklet: learn it

For a piecewise function to be differentiable at a join x=a, two things must hold: the pieces have the same value at a (continuity) and the same derivative at a.

Worked example 3Paper 1
f(x)={x2+a,x≤1bx−2,x>1. Find a and b so that f is differentiable at x=1.
Gradients: 2x on the left gives 2 at x=1; the right has gradient b. So b=2.
Do the gradient condition first: it usually gives one unknown directly.
Values: 1+a=b−2=0, so a=−1.
a=−1, b=2

2.4 Differentiation from first principles

The derivative from first principles In formula booklet
f′(x)=limh→0f(x+h)−f(x)h

This is the gradient of the chord from x to x+h, in the limit as the chord shrinks to a tangent. The method is always the same: substitute, simplify the numerator until every term has a factor of h, cancel h, and only then let h→0.

Worked example 4Paper 1
Differentiate f(x)=2x2−3x from first principles.
f(x+h)−f(x)=2(x+h)2−3(x+h)−2x2+3x=4xh+2h2−3h
f(x+h)−f(x)h=4x+2h−3
Cancel h before taking the limit.
f′(x)=limh→0(4x+2h−3)=4x−3

The two harder cases need an algebra trick before h can be cancelled. These are the ones examiners like.

Worked example 5Paper 1
Differentiate f(x)=1x from first principles.
1x+h−1x=x−(x+h)x(x+h)=−hx(x+h)
Combine the fractions first.
Divide by h: −1x(x+h)
f′(x)=limh→0−1x(x+h)=−1x2
Worked example 6Paper 1
Differentiate f(x)=x from first principles.
x+h−xh×x+h+xx+h+x
Multiply by the conjugate, as when rationalising a denominator.
=(x+h)−xh(x+h+x)=1x+h+x
f′(x)=12x, as expected from ddxx1/2=12x−1/2.
Presentation

Notation matters in first-principles proofs. Write "limh→0" on every line until the limit is actually taken, and do not substitute h=0 while h is still in a denominator. Markschemes often give the final A1 only if the limit is written correctly.

2.5 Higher derivatives

Differentiating again gives the second derivative f′′(x)=d2ydx2, and so on. The nth derivative is written f(n)(x) or dnydxn. Patterns in higher derivatives are often proved by induction.

Worked example 7Paper 1
Find the first three derivatives of f(x)=xex and suggest a formula for f(n)(x).
f′(x)=ex+xex=(x+1)ex
f′′(x)=ex+(x+1)ex=(x+2)ex, f′′′(x)=(x+3)ex
f(n)(x)=(x+n)ex
Proved by induction on the Proof by induction page.
Worked example 8 (faded)Paper 1
Find f(n)(x) for f(x)=e3x.
f′(x)=3e3x, f′′(x)=9e3x, so f(n)(x)= 3ⁿe³ˣ  ← you work this out
On your TI-Nspire Calculator tricks →

A table of values shows a limit numerically: enter f(x) in a Lists & Spreadsheet or table and use x=2.9,2.99,2.999 and 3.1,3.01,3.001. The limit( template in the Calculus menu gives the exact limit. For a derivative at a point use Calculus → Numerical derivative at a point.

3Explore it

The red line is the chord from x to x+h. Shrink h towards 0 and watch the chord gradient approach the gradient of the tangent (green).

4Common mistakes & exam tips

Common mistakes

  • Substituting h=0 before cancelling, which gives 00.
  • Dropping "limh→0" from the working, or writing it after the limit has been taken.
  • Expanding (x+h)2 as x2+h2.
  • Checking only continuity when the question asks for differentiability, or only the gradients and not the values.
  • Thinking that a function equal to 00 at a point has no limit there.

Exam tips

  • In first-principles questions, the final answer is usually known in advance: the marks are for the method, so show every line.
  • For 1x-type functions combine fractions; for roots multiply by the conjugate.
  • For piecewise questions, write two equations clearly labelled "continuity" and "differentiability".
  • If asked for f(n)(x), write out at least three derivatives so the pattern is clear.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
Find limx→−2x2+5x+6x+2.
lim(x+3)=1
FluencyP2
Find limx→∞4x−12x+7.
2
FluencyP3
Differentiate f(x)=x3 from first principles.
3x2h+3xh2+h3h=3x2+3xh+h2→3x2
FluencyP4
f(x)={kx,x<3x2−3,x≥3 is continuous. Find k. Is it differentiable at 3?
3k=6, k=2. Gradients 2 and 6 differ: not differentiable.
Problem solvingP5
Differentiate f(x)=1x+1 from first principles.
−hh(x+1)(x+h+1)→−1(x+1)2
Problem solvingP6
Differentiate f(x)=1x from first principles.
Combine, then multiply by the conjugate: −1xx+h(x+x+h)→−12x3/2

6Exam-style questions

Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.

Question 1Paper 1[4 marks]

Use differentiation from first principles to find the derivative of f(x)=x2−5x.

limh→0(x+h)2−5(x+h)−(x2−5x)hM1
=limh→02xh+h2−5hhA1
=limh→0(2x+h−5)A1
=2x−5A1
Question 2Paper 1[6 marks]

The function f is defined by f(x)={kx2,x≤24x+m,x>2, where k,m∈ℝ. f is differentiable at x=2.

  • (a)Find the value of k.[3]
  • (b)Find the value of m.[3]
(a)
derivatives: 2kx and 4M1
4k=4A1
k=1A1
(b)
continuity: k(2)2=4(2)+mM1
4=8+mA1
m=−4A1
Question 3Paper 1[5 marks]

Use differentiation from first principles to show that the derivative of f(x)=1x+1 is −1(x+1)2.

limh→01x+h+1−1x+1hM1
(x+1)−(x+h+1)(x+h+1)(x+1)M1
=−h(x+h+1)(x+1)A1
limh→0−1(x+h+1)(x+1)A1
=−1(x+1)2AG A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.

PaperQuestionFocusDifficulty
May 2024 · TZ1 · Paper 1Q11Limits of a function as x tends to particular values★★
Nov 2023 · TZ1 · Paper 1Q9Using a given limit to find an unknown constant★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake