IB Maths AA & A-Level
You already know a quick way to differentiate. For y = x2 you bring the power down and take one off, and you get 2x. That shortcut works, but where did it come from?
Differentiating from first principles means working out the answer from the definition of a gradient, without using any shortcut. It is the proof behind the rule. This page walks through it slowly, with a picture of what is really happening, and then shows you the four steps you use in an exam.
Start with something easy. On a straight line, the gradient is the same everywhere, and you find it like this:
gradient = change in y ÷ change in x
pick any two points on the line, and you always get the same answer
Now try the same thing on a curve. Here is the problem. A curve does not have one gradient. It is steep in some places and flat in others, so the gradient depends on where you are standing.
What we want is the gradient at a single point — the steepness of the curve exactly there. But to find a gradient you need two points, and we only have one. That is the whole difficulty.
The question
How do you find a gradient at one point, when the formula for gradient needs two points?
Since we need two points, we will use two. We take the point we care about, and then a second point a little way along the curve. We join them with a straight line.
A straight line joining two points on a curve is called a chord. We can find the gradient of a chord easily, because a chord is straight.
Scroll the diagram sideways.
Look at the two steps drawn under and beside the chord. To get from P to Q you move:
Put those into “change in y divided by change in x” and you have the gradient of the chord:
gradient of chord = [ f(x + h) − f(x) ] ÷ h
the vertical step divided by the horizontal step
This is not the answer yet. It is the gradient of the chord, not the gradient at P. But it is close, and here is the clever bit: the smaller we make h, the closer it gets.
Slide Q down towards P. As the gap h gets smaller, the chord swings round until it is lying almost flat against the curve at P. The line that just touches the curve at a point is called the tangent, and the gradient of the tangent is what we are after.
Below is the curve y = x2 with P at x = 1. The dashed grey line is the real tangent. Watch the gold chord close in on it.
Scroll the diagrams sideways.
You can see where it is going. Let us check it with numbers. Here is the gradient of the chord on y = x2 at x = 3, for smaller and smaller values of h.
| h | Gradient of the chord |
|---|---|
| 1 | 7 |
| 0.5 | 6.5 |
| 0.1 | 6.1 |
| 0.01 | 6.01 |
| 0.001 | 6.001 |
| 0.0001 | 6.0001 |
The answers are closing in on 6. They never quite reach it, but they get as near as you like. That is what we mean when we say the gradient tends to 6, and we write it using the word limit.
What a limit means, in plain words
Everything above now fits into one line. This is the definition of the derivative, and it is the formula you quote in an exam.
f′(x) = limh→0 [ f(x + h) − f(x) ] ÷ h
the gradient at a point is the limit of the gradient of a chord, as the chord shrinks to nothing
It looks heavy, so take it one symbol at a time.
| Part | How you say it | What it means |
|---|---|---|
| f′(x) | “f dash of x” | The gradient of the curve at the point x. This is the answer we want. |
| h | “h” | The small step along the x-axis to the second point. |
| f(x + h) | “f of x plus h” | The height of the curve at the second point. You get it by writing (x + h) everywhere the rule has an x. |
| f(x + h) − f(x) | “the difference in height” | How far up you go from the first point to the second. |
| limh→0 | “the limit as h tends to zero” | Squeeze the gap down to nothing and see what number the answer settles on. |
Keep writing “lim” until the very last line
The limit sign is part of the maths, not decoration. It must appear on every line until the moment you actually let h go to zero. Dropping it early is one of the most common reasons students lose method marks on this question.
Every first principles question is the same four steps. Learn the pattern once and you can do any of them.
Step 2 is where the magic happens. The whole method works because the constant terms cancel, which leaves every surviving term carrying an h — and that is exactly what lets you divide by h in step 3.
Prove, from first principles, that if f(x) = x2 then f′(x) = 2x.
Step 1. Replace x with (x + h) and expand
f(x + h) = (x + h)² = x² + 2xh + h²
Step 2. Subtract f(x). The x² terms cancel
f(x + h) − f(x) = x² + 2xh + h² − x²
= 2xh + h²
Step 3. Divide by h. Every term has an h, so every term loses one
(2xh + h²) / h = 2x + h
Step 4. Let h go to zero
f′(x) = limh→0 (2x + h) = 2x
f′(x) = 2x
Check it against the shortcut: bring the 2 down, take one off the power, and you get 2x. Same answer. The shortcut was never magic — it was this calculation, done once, for everybody.
Find f′(x) from first principles when f(x) = x3.
Step 1. Expand (x + h)³
f(x + h) = x³ + 3x²h + 3xh² + h³
Step 2. Subtract f(x). The x³ terms cancel
f(x + h) − f(x) = 3x²h + 3xh² + h³
Step 3. Divide by h
= 3x² + 3xh + h²
Step 4. Let h go to zero. Both terms with an h vanish
f′(x) = 3x²
Expanding (x + h)3 without panicking
Differentiate f(x) = 3x2 + 2x from first principles.
Step 1. Replace both x’s
f(x + h) = 3(x + h)² + 2(x + h)
= 3(x² + 2xh + h²) + 2x + 2h
= 3x² + 6xh + 3h² + 2x + 2h
Step 2. Subtract f(x) = 3x² + 2x
= 6xh + 3h² + 2h
Step 3. Divide by h
= 6x + 3h + 2
Step 4. Let h go to zero
f′(x) = 6x + 2
Notice what happened to the + 2x. It produced + 2h, which divided down to a plain + 2 and survived to the end. Terms in x always leave behind a constant.
Differentiate f(x) = 1/x from first principles.
Step 1 and 2 together
f(x + h) − f(x) = 1/(x + h) − 1/x
Put the two fractions over a common denominator
= [ x − (x + h) ] / [ x(x + h) ]
= −h / [ x(x + h) ]
Step 3. Divide by h, which means multiply by 1/h
= −1 / [ x(x + h) ]
Step 4. Let h go to zero, so (x + h) becomes x
f′(x) = −1/x²
Differentiate f(x) = √x from first principles.
Step 1 and 2
f(x + h) − f(x) = √(x + h) − √x
Step 3. Dividing by h gets stuck. Multiply top and bottom by √(x + h) + √x
top = [√(x+h) − √x]
× [√(x+h) + √x]
= (x + h) − x = h
That h cancels the h on the bottom
= 1 / [ √(x + h) + √x ]
Step 4. Let h go to zero
= 1 / ( √x + √x )
f′(x) = 1 / (2√x)
The trick to remember here
This is the question almost every student asks, and it is a good one. If we want the gap to be zero, why not set h = 0 at the start and save all the work?
Try it on f(x) = x2:
Putting h = 0 straight into the formula
[ f(x + 0) − f(x) ] / 0 = ( x² − x² ) / 0
= 0 / 0
Zero divided by zero has no value. It is not 0, it is not 1, and it is not infinity. It tells you nothing at all. In maths this is called an indeterminate form, which is a formal way of saying “this expression has not got an answer”.
That makes sense if you go back to the picture. Setting h = 0 means P and Q are the same point — and you cannot draw a line through one point. There are infinitely many lines through a single point, so there is no gradient to find.
So what do we do instead
Here is the bit that quietly bothers thoughtful students, and most pages skip it. In step 3 we cancelled the h. You are only allowed to cancel h if h is not zero. But then in step 4 we let h go to zero. Is that not cheating?
No, and here is why. Look at the two expressions from Example 1:
| Expression | When h is not zero | When h is zero |
|---|---|---|
| (2xh + h²) / h | Equal to 2x + h | No value. It is 0/0. |
| 2x + h | Equal to the fraction above | Equal to 2x. Perfectly fine. |
The two expressions agree at every single value of h except zero. And a limit only cares about what happens near zero, never at zero. So the limit of the messy fraction is the same as the limit of the tidy one — and the tidy one we can just read off.
In one sentence
We are not putting h = 0 into the original fraction. We are replacing the fraction with a tidier expression that matches it everywhere that matters, and then reading off where that is heading.
A sentence worth memorising
We do not ask what happens when h equals zero. We ask what the answer is heading towards as h gets closer and closer to zero. Those are different questions, and only the second one has an answer.
Different books and different exam boards write the same idea with different letters. Nothing changes except the symbols, but you need to recognise all of them.
| Written as | Where you see it | What is different |
|---|---|---|
| f′(x) = limh→0 [f(x+h) − f(x)]/h | IB Maths AA and most A-level textbooks | The standard version. Use this unless told otherwise. |
| dy/dx = limδx→0 δy/δx | Older A-level books, and some physics courses | δx (“delta x”) is just another name for h. δy is the change in y. |
| f′(a) = limx→a [f(x) − f(a)]/(x − a) | University courses, and occasionally IB HL | Instead of a step h, the second point slides towards a fixed point a. Same idea, different bookkeeping. |
If a question asks for first principles and uses δx, write δx in your answer. Matching the notation in the question is free marks.
Before you revise this, check whether your course examines it at all. A lot of students lose time on first principles when their paper will never ask for it.
| Course | Is it examined | What comes up |
|---|---|---|
| IB Maths AA HL | Yes — syllabus point AHL 5.12, “first principles, higher derivatives”. | Powers such as x2 and x3, short polynomials, and at the top end sin x using the compound angle formula. |
| IB Maths AA SL | No — “AHL” means additional higher level, so it is HL content only. | SL meets the idea informally under 5.1, as the gradient of a chord approaching a tangent, but is not asked to prove a derivative. |
| IB Maths AI | No, at either level. | AI uses differentiation but never asks you to derive it. |
| A-level maths | Yes — AQA, Edexcel and OCR all examine it, usually for 4 or 5 marks. | Powers up to x3, short polynomials, and occasionally 1/x. Trig from first principles is Further Maths. |
Where the marks actually are
This is the hardest one that comes up, and it is HL only. You need two things first: the compound angle formula, and one limit that you have to know.
As h gets small, (sin h) / h gets close to 1. That is not obvious, so look at the numbers. Your calculator must be in radians for this.
| h | (sin h) / h | (cos h − 1) / h |
|---|---|---|
| 1 | 0.84147 | −0.45970 |
| 0.5 | 0.95885 | −0.24483 |
| 0.1 | 0.99833 | −0.04996 |
| 0.01 | 0.99998 | −0.00500 |
| 0.001 | 0.99999 98 | −0.00050 |
| heading for | 1 | 0 |
Radians, not degrees
In degrees, (sin h)/h heads towards 0.01745, not 1, and the whole derivation collapses. This is the real reason calculus always uses radians. It is not a convention someone picked — the derivative of sin x is only equal to cos x when the angle is measured in radians.
Prove from first principles that if f(x) = sin x then f′(x) = cos x.
Step 1. Expand sin(x + h) with the compound angle formula
sin(x + h)
= sin x cos h + cos x sin h
Step 2. Subtract sin x and group the sin x terms
= sin x cos h + cos x sin h
− sin x
= sin x (cos h − 1) + cos x sin h
Step 3. Divide by h, splitting it into two pieces
= sin x × (cos h − 1)/h
+ cos x × (sin h)/h
Step 4. Let h go to zero, using the two limits from the table
→ sin x × 0 + cos x × 1
f′(x) = cos x
Notice that sin x and cos x are treated as constants here, because x is not the thing changing. Only h is changing. That is why they can be pulled outside the limit.
The same method gives cos x
| The mistake | What goes wrong | Do this instead |
|---|---|---|
| Using the power rule | Scores zero on a “prove from first principles” question, even with the right answer. | Start from the definition every time the words “first principles” appear. |
| Writing (x + h)² = x² + h² | The 2xh term goes missing, and that term is the derivative. | (x + h)² = x² + 2xh + h². Expand properly, every time. |
| Dropping the limit sign | The lines are no longer true statements, and method marks go. | Write lim on every line until the final step. |
| Setting h = 0 too early | You get 0/0, which means nothing. | Cancel the h off the bottom first, then let h go to zero. |
| Forgetting to subtract f(x) | The constant terms never cancel, so nothing divides by h cleanly. | Always do f(x + h) minus f(x), in that order. |
| Only replacing some of the x’s | In 3x² + 2x students often change the first x and forget the second. | Every single x becomes (x + h). Count them before you expand. |
| Cancelling only one term’s h | Dividing 2xh + h² by h and writing 2x + h². | Every term on the top loses one h. So it is 2x + h. |
Work each one on paper, using all four steps, then tap to check. Every answer below was verified.
Step 1
f(x + h) = 4(x + h)²
= 4x² + 8xh + 4h²
Step 2. The 4x² terms cancel
= 8xh + 4h²
Step 3. Divide by h
= 8x + 4h
Step 4. Let h go to zero
f′(x) = 8x
Step 1. Change both x’s
f(x + h) = (x + h)² + 3(x + h)
= x² + 2xh + h² + 3x + 3h
Step 2. Subtract x² + 3x
= 2xh + h² + 3h
Step 3. Divide by h
= 2x + h + 3
Step 4
f′(x) = 2x + 3
Step 1
f(x + h) = 5(x + h)²
− 4(x + h) + 1
= 5x² + 10xh + 5h²
− 4x − 4h + 1
Step 2. The 5x², −4x and +1 all cancel
= 10xh + 5h² − 4h
Step 3. Divide by h
= 10x + 5h − 4
Step 4
f′(x) = 10x − 4
Note the +1 vanished completely. A constant never affects a gradient.
Step 1. Expand (x + h)³ first
f(x + h) = 2(x + h)³ − (x + h)
= 2(x³ + 3x²h + 3xh² + h³)
− x − h
Step 2. Subtract 2x³ − x
= 6x²h + 6xh² + 2h³ − h
Step 3. Divide by h
= 6x² + 6xh + 2h² − 1
Step 4
f′(x) = 6x² − 1
Because the top becomes f(x) − f(x) = 0 and the bottom is 0, giving 0/0, which has no value. In the picture, it means the two points have merged into one, and you cannot draw a line through a single point. You must cancel the h off the bottom first.
The chord gradients were heading for 6. Checking with the derivative: f′(x) = 2x, so f′(3) = 6. They agree.
Steps 1 and 2, over a common denominator
1/(x + h) − 1/x
= [x − (x + h)] / [x(x + h)]
= −h / [x(x + h)]
Step 3. Divide by h
= −1 / [x(x + h)]
Step 4. (x + h) becomes x
f′(x) = −1/x²
They left out the 2xh term. With it missing, step 2 gives just h², step 3 gives h, and step 4 sends that to zero. The 2xh term is the derivative — it is the only term that survives. Losing it loses the whole answer.
Step 1. Compound angle formula
cos(x + h)
= cos x cos h − sin x sin h
Step 2. Subtract cos x and group
= cos x (cos h − 1) − sin x sin h
Step 3. Divide by h
= cos x × (cos h − 1)/h
− sin x × (sin h)/h
Step 4. The two limits are 0 and 1
→ cos x × 0 − sin x × 1
f′(x) = −sin x
It means finding a derivative using only the definition of a gradient, with no shortcut rules. You take two points on the curve a small distance h apart, find the gradient of the straight line joining them, and then see what that gradient heads towards as h shrinks to nothing. It is where the power rule and every other rule came from in the first place.
f′(x) = limh→0 [f(x + h) − f(x)] / h. In words: the derivative is the limit, as the gap h shrinks to zero, of the change in height divided by the change in x.
Because you get 0/0, which has no value. The top becomes f(x) − f(x) = 0 and the bottom is already 0. You have to do the algebra that cancels the h off the bottom first. Once h is only on the top, letting it go to zero is perfectly safe.
Because the two expressions agree at every value of h except zero, and a limit only looks at what happens near a point, never at it. So the limit of the messy fraction equals the limit of the tidy expression, and the tidy one you can simply read off. We never actually evaluate the original fraction at zero.
A chord is a straight line joining two points on a curve. A tangent is a straight line that touches the curve at just one point and has the same steepness as the curve there. First principles works by starting with a chord and squeezing it until it becomes the tangent. Some textbooks call the chord a secant; it means the same thing.
A limit is the value something is heading towards. It does not have to arrive. If the gradients go 7, 6.5, 6.1, 6.01, 6.001, none of them is 6, but 6 is clearly where they are going, so the limit is 6.
Nothing — they are two names for the same small step along the x-axis. h is used by the IB and most modern A-level books; δx (“delta x”) is used by older textbooks and by Imperial-style university notes, often paired with δy for the change in height. Some books write Δx instead. Whichever the question uses, use the same in your answer.
No. It sits at AHL 5.12, and “AHL” means additional higher level, so it is HL content. SL students meet the idea informally under 5.1 — the gradient of a chord approaching a tangent — but are not asked to prove a derivative from the definition. Maths AI does not examine it at either level.
Yes. AQA, Edexcel and OCR all examine it, typically as a 4 or 5 mark “prove from first principles” question using powers up to x3 or a short polynomial. Differentiating trig functions from first principles belongs to Further Maths.
Not if the question says “from first principles” or “using the definition of the derivative”. The method is the question, so a right answer reached by the shortcut scores nothing. Use the shortcut afterwards to check your answer.
Combine the two fractions over a common denominator before you try to divide by h. For 1/x that gives −h / [x(x + h)], and the h then cancels cleanly, leaving −1/x².
Multiply the top and bottom by the same expression with the middle sign flipped — so for √(x + h) − √x you multiply by √(x + h) + √x. This is called rationalising. The roots disappear from the top, leaving a plain h that cancels, and you end up with 1 / (2√x).
Because the derivative of sin x is only cos x when the angle is in radians. The proof relies on (sin h)/h heading towards 1 as h shrinks, and that is only true in radians. In degrees it heads towards about 0.01745 instead, and every trig derivative would carry that awkward factor. Radians are not a convention someone picked — they are the measure that makes calculus work.
You say it “f dash of x”, or “f prime of x”. It means the gradient of the curve y = f(x) at the point x. It is the same thing as dy/dx, just written differently.
Usually 4 or 5. The marks are spread across quoting the definition, expanding correctly, showing the h cancel, and taking the limit on the final line. Because the marks are for the method rather than the answer, writing out every step is worth far more here than in most questions.
Yes, until the line where you actually let h go to zero. Without it the lines are not true statements, and examiners take method marks off for dropping it. It is the easiest mark on the question to keep and the easiest to lose.
Most students can get the right answer here. Far fewer write it in a way that collects all five marks — quoting the definition, keeping the limit sign, showing the cancelling. Our tutors teach IB and A‑level maths and work through your own past papers, so we fix the habits that are costing you marks rather than teaching topics you already know.
Book a free 30-minute meetingRevising the whole subject? Our IB revision notes cover maths topic by topic at SL and HL, or read about our IB maths tutors.
I am a
Teachers log in with the details IB Demystified sent them. No account yet? Please contact us.