Differentiation from First Principles: A-level Maths
Learn differentiation from first principles for A-level Maths with clear proofs, worked examples, common mistakes and exam-style questions with answers.

Differentiation from first principles means finding a derivative directly from the definition of a gradient, rather than applying a rule such as the power rule. For a function f(x)f(x)f(x), the definition is
f′(x)=limh→0f(x+h)−f(x)h. f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}. f′(x)=h→0limhf(x+h)−f(x).For differentiation from first principles A-level Maths questions, you must substitute the function into this formula, simplify the difference quotient and then take the limit. This guide explains why the formula works, demonstrates the method through worked examples and provides exam-style questions with answers.
What is differentiation from first principles?
The derivative f′(x)f'(x)f′(x) gives the gradient of the tangent to the curve y=f(x)y=f(x)y=f(x) at a general point. It can also represent an instantaneous rate of change, depending on the context.
Begin with two points on the curve:
P=(x,f(x)) P=(x,f(x)) P=(x,f(x))and
Q=(x+h,f(x+h)). Q=(x+h,f(x+h)). Q=(x+h,f(x+h)).The change in the horizontal coordinate is hhh, while the change in the vertical coordinate is f(x+h)−f(x)f(x+h)-f(x)f(x+h)−f(x). Therefore, the gradient of the straight line through PPP and QQQ is
f(x+h)−f(x)h. \frac{f(x+h)-f(x)}{h}. hf(x+h)−f(x).This is the gradient of a chord, also called a secant, rather than the gradient of the tangent. As hhh approaches zero, QQQ approaches PPP and the chord approaches the tangent. This produces the first-principles definition:
f′(x)=limh→0f(x+h)−f(x)h. \boxed{f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}. f′(x)=h→0limhf(x+h)−f(x).Some questions use δx\delta xδx instead of hhh:
f′(x)=limδx→0f(x+δx)−f(x)δx. f'(x)=\lim_{\delta x\to 0}\frac{f(x+\delta x)-f(x)}{\delta x}. f′(x)=δx→0limδxf(x+δx)−f(x).The meaning and method are identical.
Why can you not substitute h=0h=0h=0 immediately?
Direct substitution into the original difference quotient gives
f(x)−f(x)0=00, \frac{f(x)-f(x)}{0}=\frac{0}{0}, 0f(x)−f(x)=00,which is undefined. You must first simplify the numerator until it contains a factor of hhh. Since the limit considers non-zero values of hhh approaching zero, that factor can then be cancelled.
Only after cancellation should you evaluate the limit. This distinction is fundamental: hhh approaches zero, but it is not set equal to zero before the algebra has been simplified.
The step-by-step first-principles method
For a polynomial function, use this reliable sequence:
-
Write the definition
f′(x)=limh→0f(x+h)−f(x)h. f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}. f′(x)=h→0limhf(x+h)−f(x). -
Calculate f(x+h)f(x+h)f(x+h) by replacing every xxx in the function with x+hx+hx+h.
-
Substitute f(x+h)f(x+h)f(x+h) and f(x)f(x)f(x) into the numerator.
-
Expand brackets carefully.
-
Simplify the numerator. All terms independent of hhh should cancel.
-
Factor out hhh and cancel it with the denominator.
-
Take the limit as h→0h\to 0h→0.
-
State the derivative clearly using f′(x)f'(x)f′(x) or dydx\dfrac{dy}{dx}dxdy.
Showing these stages matters in an exam because the question is testing the definition of a derivative, not merely whether you know the final differentiation rule.
Differentiation from first principles worked examples
Worked example 1: differentiating x2x^2x2
Let
f(x)=x2. f(x)=x^2. f(x)=x2.Start from the definition:
f′(x)=limh→0f(x+h)−f(x)h. f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}. f′(x)=h→0limhf(x+h)−f(x).Since f(x+h)=(x+h)2f(x+h)=(x+h)^2f(x+h)=(x+h)2,
f′(x)=limh→0(x+h)2−x2h. f'(x)=\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}. f′(x)=h→0limh(x+h)2−x2.Expand the square:
f′(x)=limh→0x2+2xh+h2−x2h. f'(x)=\lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h}. f′(x)=h→0limhx2+2xh+h2−x2.The x2x^2x2 terms cancel:
f′(x)=limh→02xh+h2h. f'(x)=\lim_{h\to 0}\frac{2xh+h^2}{h}. f′(x)=h→0limh2xh+h2.Factorise and cancel hhh:
f′(x)=limh→0(2x+h). f'(x)=\lim_{h\to 0}(2x+h). f′(x)=h→0lim(2x+h).Now take the limit:
f′(x)=2x. \boxed{f'(x)=2x}. f′(x)=2x.This proves the derivative of x2x^2x2 from first principles. Writing only 2x2x2x would not answer a question that specifically asks for a proof from first principles.
Worked example 2: differentiating a quadratic
Let
f(x)=3x2−4x+7. f(x)=3x^2-4x+7. f(x)=3x2−4x+7.Then
f(x+h)=3(x+h)2−4(x+h)+7. f(x+h)=3(x+h)^2-4(x+h)+7. f(x+h)=3(x+h)2−4(x+h)+7.Using the definition,
f′(x)=limh→03(x+h)2−4(x+h)+7−(3x2−4x+7)h. f'(x)=\lim_{h\to 0}\frac{3(x+h)^2-4(x+h)+7-(3x^2-4x+7)}{h}. f′(x)=h→0limh3(x+h)2−4(x+h)+7−(3x2−4x+7).Take care with the subtraction of f(x)f(x)f(x). Expanding gives
f′(x)=limh→03x2+6xh+3h2−4x−4h+7−3x2+4x−7h. f'(x)=\lim_{h\to 0}\frac{3x^2+6xh+3h^2-4x-4h+7-3x^2+4x-7}{h}. f′(x)=h→0limh3x2+6xh+3h2−4x−4h+7−3x2+4x−7.After collecting terms,
f′(x)=limh→06xh+3h2−4hh. f'(x)=\lim_{h\to 0}\frac{6xh+3h^2-4h}{h}. f′(x)=h→0limh6xh+3h2−4h.Cancel the common factor:
f′(x)=limh→0(6x+3h−4). f'(x)=\lim_{h\to 0}(6x+3h-4). f′(x)=h→0lim(6x+3h−4).Therefore,
f′(x)=6x−4. \boxed{f'(x)=6x-4}. f′(x)=6x−4.Notice that the constant 777 disappears because it contributes no change to the output of the function.
Worked example 3: differentiating x3x^3x3
Let f(x)=x3f(x)=x^3f(x)=x3. Then
f′(x)=limh→0(x+h)3−x3h. f'(x)=\lim_{h\to 0}\frac{(x+h)^3-x^3}{h}. f′(x)=h→0limh(x+h)3−x3.Use
(x+h)3=x3+3x2h+3xh2+h3. (x+h)^3=x^3+3x^2h+3xh^2+h^3. (x+h)3=x3+3x2h+3xh2+h3.It follows that
f′(x)=limh→03x2h+3xh2+h3h. f'(x)=\lim_{h\to 0}\frac{3x^2h+3xh^2+h^3}{h}. f′(x)=h→0limh3x2h+3xh2+h3.Cancelling hhh gives
f′(x)=limh→0(3x2+3xh+h2). f'(x)=\lim_{h\to 0}(3x^2+3xh+h^2). f′(x)=h→0lim(3x2+3xh+h2).Hence,
f′(x)=3x2. \boxed{f'(x)=3x^2}. f′(x)=3x2.The expansion of (x+h)3(x+h)^3(x+h)3 is a frequent source of errors, so it is worth writing the full binomial expansion before simplifying.
First principles for sine and cosine
Some A-level specifications include differentiating sinx\sin xsinx and cosx\cos xcosx from first principles. These proofs require angles to be measured in radians and use the standard limits
limh→0sinhh=1 \lim_{h\to 0}\frac{\sin h}{h}=1 h→0limhsinh=1and
limh→0cosh−1h=0. \lim_{h\to 0}\frac{\cos h-1}{h}=0. h→0limhcosh−1=0.For example, if f(x)=sinxf(x)=\sin xf(x)=sinx, then
f′(x)=limh→0sin(x+h)−sinxh. f'(x)=\lim_{h\to 0}\frac{\sin(x+h)-\sin x}{h}. f′(x)=h→0limhsin(x+h)−sinx.Using sin(x+h)=sinxcosh+cosxsinh\sin(x+h)=\sin x\cos h+\cos x\sin hsin(x+h)=sinxcosh+cosxsinh,
f′(x)=limh→0(sinxcosh−1h+cosxsinhh). f'(x)=\lim_{h\to 0}\left(\sin x\frac{\cos h-1}{h}+\cos x\frac{\sin h}{h}\right). f′(x)=h→0lim(sinxhcosh−1+cosxhsinh).Applying the two standard limits gives
ddx(sinx)=cosx. \boxed{\frac{d}{dx}(\sin x)=\cos x}. dxd(sinx)=cosx.A similar argument using the cosine addition formula produces
ddx(cosx)=−sinx. \boxed{\frac{d}{dx}(\cos x)=-\sin x}. dxd(cosx)=−sinx.Check your own exam board specification for the precise scope required. The algebraic method for small positive integer powers is central, while the exact wording and emphasis can vary.
Embedded exam-style question
Question: The curve CCC has equation
y=2x3−5x. y=2x^3-5x. y=2x3−5x.Use differentiation from first principles to find dydx\dfrac{dy}{dx}dxdy. You must show each stage of your working.
Answer:
Let f(x)=2x3−5xf(x)=2x^3-5xf(x)=2x3−5x. Then
f(x+h)=2(x+h)3−5(x+h). f(x+h)=2(x+h)^3-5(x+h). f(x+h)=2(x+h)3−5(x+h).Therefore,
f′(x)=limh→02(x+h)3−5(x+h)−(2x3−5x)h. f'(x)=\lim_{h\to 0}\frac{2(x+h)^3-5(x+h)-(2x^3-5x)}{h}. f′(x)=h→0limh2(x+h)3−5(x+h)−(2x3−5x).Expanding and simplifying the numerator gives
f′(x)=limh→06x2h+6xh2+2h3−5hh. f'(x)=\lim_{h\to 0}\frac{6x^2h+6xh^2+2h^3-5h}{h}. f′(x)=h→0limh6x2h+6xh2+2h3−5h.After cancelling hhh,
f′(x)=limh→0(6x2+6xh+2h2−5). f'(x)=\lim_{h\to 0}(6x^2+6xh+2h^2-5). f′(x)=h→0lim(6x2+6xh+2h2−5).Thus,
dydx=6x2−5. \boxed{\frac{dy}{dx}=6x^2-5}. dxdy=6x2−5.Try 4 more differentiation from first principles exam questions. The MathsGenie question bank includes worked solutions and mark schemes so that you can compare both your answer and your method.
Further exam-style practice questions
Question 1
Use first principles to show that the derivative of f(x)=5x2+3x−1f(x)=5x^2+3x-1f(x)=5x2+3x−1 is 10x+310x+310x+3.
Answer:
f(x+h)−f(x)h=5(x+h)2+3(x+h)−1−(5x2+3x−1)h \frac{f(x+h)-f(x)}{h}=\frac{5(x+h)^2+3(x+h)-1-(5x^2+3x-1)}{h} hf(x+h)−f(x)=h5(x+h)2+3(x+h)−1−(5x2+3x−1) =10xh+5h2+3hh=10x+5h+3. =\frac{10xh+5h^2+3h}{h}=10x+5h+3. =h10xh+5h2+3h=10x+5h+3.Taking the limit as h→0h\to 0h→0 gives
f′(x)=10x+3. \boxed{f'(x)=10x+3}. f′(x)=10x+3.Question 2
Given f(x)=4−3x2f(x)=4-3x^2f(x)=4−3x2, use first principles to find f′(x)f'(x)f′(x) and hence find the gradient when x=2x=2x=2.
Answer:
Applying the definition and simplifying gives
f′(x)=limh→0(−6x−3h)=−6x. f'(x)=\lim_{h\to 0}(-6x-3h)=-6x. f′(x)=h→0lim(−6x−3h)=−6x.At x=2x=2x=2,
f′(2)=−6(2)=−12. f'(2)=-6(2)=\boxed{-12}. f′(2)=−6(2)=−12.The derivative is a function giving the gradient at a general value of xxx. Substitution is only performed after that function has been found.
Question 3
Use first principles to differentiate f(x)=3x3+2f(x)=3x^3+2f(x)=3x3+2.
Answer:
f′(x)=limh→03(x+h)3+2−(3x3+2)h. f'(x)=\lim_{h\to 0}\frac{3(x+h)^3+2-(3x^3+2)}{h}. f′(x)=h→0limh3(x+h)3+2−(3x3+2).Expansion and cancellation give
f′(x)=limh→0(9x2+9xh+3h2). f'(x)=\lim_{h\to 0}(9x^2+9xh+3h^2). f′(x)=h→0lim(9x2+9xh+3h2).Therefore,
f′(x)=9x2. \boxed{f'(x)=9x^2}. f′(x)=9x2.Common mistakes in differentiation from first principles
Using the power rule instead of the definition
If a question says from first principles, applying ddx(xn)=nxn−1\dfrac{d}{dx}(x^n)=nx^{n-1}dxd(xn)=nxn−1 does not demonstrate the required method. You may use the rule afterwards to check your answer, but your submitted proof must begin with the limit definition.
Subtracting f(x)f(x)f(x) incorrectly
The whole expression for f(x)f(x)f(x) must be subtracted. For example,
−(3x2−4x+7)=−3x2+4x−7. -(3x^2-4x+7)=-3x^2+4x-7. −(3x2−4x+7)=−3x2+4x−7.Missing the brackets often creates sign errors and prevents the terms independent of hhh from cancelling.
Cancelling terms instead of factors
You can cancel a common factor, not individual terms joined by addition. First rewrite
2xh+h2=h(2x+h) 2xh+h^2=h(2x+h) 2xh+h2=h(2x+h)before cancelling hhh with the denominator.
Setting h=0h=0h=0 too early
Substituting h=0h=0h=0 before cancellation creates division by zero. Simplify the quotient first, then evaluate its limit.
Forgetting the limit notation
Keep limh→0\lim_{h\to 0}limh→0 in your working until the denominator has been cancelled. This shows that you understand the derivative as a limiting value rather than an ordinary substitution.
Confusing a derivative with a gradient at a point
The derivative f′(x)f'(x)f′(x) usually depends on xxx. A numerical gradient is obtained only after substituting the specified coordinate into the derivative.
How to revise differentiation from first principles
First, memorise the definition accurately and practise finding f(x+h)f(x+h)f(x+h). Most errors in this topic come from expansion and signs rather than from the underlying calculus.
Next, practise complete proofs without looking at a model answer. Use the MathsGenie differentiation from first principles revision page, the interactive lesson and the worked-example videos. OCR students can also use the first principles for powers of xxx resource.
Finally, complete topic questions before moving to mixed past papers and predicted papers. Mark every line against the mark scheme, since a correct final derivative may not earn full credit if the required limit, expansion or cancellation is missing.
Students reviewing earlier course content can also use the GCSE Maths topics by exam board and tier checklist to identify algebra skills that may need strengthening.
Conclusion
Differentiation from first principles establishes the derivative as the limiting gradient of a chord. The essential process is to form f(x+h)−f(x)f(x+h)-f(x)f(x+h)−f(x), expand accurately, factor and cancel hhh, and only then take the limit as hhh approaches zero.
For exam preparation, learn the definition exactly, show every algebraic stage and distinguish a general derivative from the gradient at a particular point. MathsGenie’s lesson, videos, practice questions and mark schemes provide a structured way to consolidate the method before attempting mixed past papers.
Sources and referenced URLs
- https://mathsgenie.co.uk/a-level/maths/edexcel/as-pure-mathematics-12-2-differentiation-from-first-principles
- https://mathsgenie.co.uk/a-level/maths/edexcel/as-pure-mathematics-12-2-differentiation-from-first-principles/questions/q1
- https://mathsgenie.co.uk/as-level/maths/edexcel/as-pure-mathematics-12-2-differentiation-from-first-principles/lessons
- https://mathsgenie.co.uk/a-level/maths/edexcel/as-pure-mathematics-12-2-differentiation-from-first-principles/videos
- https://mathsgenie.co.uk/a-level/maths/ocr/differentiation-from-first-principles-for-powers-of-x
- https://old-asset.mathsgenie.co.uk/resources/as-pure-differentiation-first-principles.pdf
- https://mathsgenie.co.uk/blog/gcse-maths-topics-by-exam-board-and-tier



