§ 01What Is "First Principles"?
Differentiation from first principles means deriving the derivative directly from the definition of a limit, no shortcuts, no rules borrowed on faith.
Every differentiation rule you will ever use (the power rule, the product rule, the chain rule) was originally proved using the argument laid out on this page. First principles is the foundation from which everything else follows.
The central question is: what is the gradient of a curve at a single point? A straight line has a constant gradient: rise over run. But a curve's steepness changes continuously, so "rise over run" only makes sense between two points, not at one. First principles resolves this by making those two points infinitely close together.
§ 02Building the Formula — From Chord to Tangent
We start with something we already understand, the gradient of a straight line between two points, and then take a limit to turn it into a gradient at a single point.
Step 1: The gradient of a chord
Consider a curve y = f(x). Pick a point on the curve with x-coordinate x. A nearby point has x-coordinate x + h, where h is some small positive number. The two points on the curve are:
Point B: (x + h, f(x + h))
The straight line connecting A and B is called a chord. Its gradient is rise over run:
Step 2: Shrink h towards zero
This chord gradient is only an approximation to the gradient of the curve at A. The smaller h is, the closer B is to A, and the closer the chord gradient is to the true gradient of the tangent at A. As h → 0, the chord becomes the tangent:
This is the limit definition of the derivative, also called differentiating from first principles. The notation f′(x) (read "f prime of x") represents the derivative of f at x. You may also see it written as dy/dx or df/dx.
§ 03The Four-Step Method
Every first principles problem follows exactly the same four steps. Memorise this routine and you can handle any function systematically.
Replace every x in the formula for f(x) with (x + h). Expand carefully, every x becomes (x + h), including inside powers and brackets.
Calculate f(x + h) − f(x). Expand and simplify. Every term that does not contain h will cancel, leaving only terms with h.
Divide the result by h. At this stage, every term in the numerator must contain at least one factor of h so it cancels cleanly. Factor out h first if needed.
Let h → 0. Set h = 0 in the simplified expression. The terms still containing h vanish, leaving the derivative f′(x).
The critical skill is Step 2: the algebra of expanding f(x + h) correctly. Let us work through the most important example (the power rule for x²) to see the method in full.
Step 1: Write f(x + h): replace every x with (x + h) and expand the bracket:
f(x + h) = (x + h)² = x² + 2xh + h²Step 2, Form the difference f(x + h) − f(x):
f(x + h) − f(x) = (x² + 2xh + h²) − x² = 2xh + h² The x² terms cancel exactly — this always happens and is how the method "clears" the constant parts.Step 3, Divide by h. Factor h from the numerator first:
[ f(x + h) − f(x) ] ÷ h = (2xh + h²) ÷ h = h(2x + h) ÷ h = 2x + h After dividing, the expression is now just (2x + h) — no longer 0/0. The dangerous h in the denominator is gone.Step 4, Take the limit as h → 0. The h term vanishes:
f′(x) = lim[h→0] (2x + h) = 2x + 0 = 2x This confirms the power rule result: d/dx[x²] = 2x.§ 04Interactive Graph — Watching the Chord Become a Tangent
Use the slider to shrink h towards zero and watch the chord (gold) converge to the tangent line (teal) at x = a. This is precisely what the limit definition captures.
§ 05Twelve Worked Exercises
Work each problem yourself before revealing the solution. Every algebraic step is shown and explained: nothing is skipped.
Group A — Polynomials (Exercises 1–4)
- Write f(x + h): f(x + h) = x + h
- Form the difference: f(x + h) − f(x) = (x + h) − x = h
- Divide by h: h ÷ h = 1
- Take the limit as h → 0: f′(x) = lim[h→0] (1) = 1 f′(x) = 1 The gradient of y = x is always 1: it's a straight line with slope 1. First principles confirms this.
- Write f(x + h). Expand (x + h)² using (a + b)² = a² + 2ab + b²: f(x + h) = (x + h)² = x² + 2xh + h²
- Form the difference: f(x + h) − f(x) = x² + 2xh + h² − x² = 2xh + h² The x² cancels. Every remaining term contains h, a good sign.
- Divide by h. Factor h from the numerator: (2xh + h²) ÷ h = h(2x + h) ÷ h = 2x + h
- Take the limit as h → 0. The h term disappears: f′(x) = lim[h→0] (2x + h) = 2x f′(x) = 2x
- Write f(x + h). Expand (x + h)³: f(x + h) = (x + h)³ = x³ + 3x²h + 3xh² + h³
- Form the difference: f(x + h) − f(x) = x³ + 3x²h + 3xh² + h³ − x³ = 3x²h + 3xh² + h³
- Divide by h. Every term has h as a factor: (3x²h + 3xh² + h³) ÷ h = 3x² + 3xh + h²
- Take the limit: the h and h² terms vanish: f′(x) = lim[h→0] (3x² + 3xh + h²) = 3x² f′(x) = 3x²
- Write f(x + h) by replacing every x with (x + h): f(x + h) = 5(x + h)² − 3(x + h) + 2 = 5(x² + 2xh + h²) − 3x − 3h + 2 = 5x² + 10xh + 5h² − 3x − 3h + 2
- Form the difference f(x + h) − f(x): = (5x² + 10xh + 5h² − 3x − 3h + 2) − (5x² − 3x + 2) = 10xh + 5h² − 3h The constant terms 5x², −3x, and +2 all cancel: only terms with h survive.
- Divide by h. Factor h from each term: (10xh + 5h² − 3h) ÷ h = 10x + 5h − 3
- Take the limit, the 5h term disappears: f′(x) = lim[h→0] (10x + 5h − 3) = 10x − 3 f′(x) = 10x − 3
Group B — Rational Functions and Surds (Exercises 5–8)
- Write f(x + h): f(x + h) = 1 / (x + h)
- Form the difference. Use common denominator x(x + h): f(x + h) − f(x) = 1/(x + h) − 1/x = [x − (x + h)] / [x(x + h)] = −h / [x(x + h)] The x terms in the numerator cancel, leaving −h.
- Divide by h: the h in the numerator and the h denominator cancel: [ −h / (x(x+h)) ] ÷ h = −1 / [x(x + h)]
- Take the limit. As h → 0, (x + h) → x: f′(x) = lim[h→0] −1/[x(x+h)] = −1/[x · x] f′(x) = −1/x²
- Write f(x + h): f(x + h) = 1/(x + h)²
- Form the difference with common denominator x²(x + h)²: f(x+h) − f(x) = [x² − (x+h)²] / [x²(x+h)²] Numerator: x² − (x² + 2xh + h²) = −2xh − h² = (−2xh − h²) / [x²(x+h)²]
- Divide by h. Factor h from numerator: = h(−2x − h) / (h · x²(x+h)²) = (−2x − h) / [x²(x+h)²]
- Take the limit as h → 0: f′(x) = (−2x − 0) / [x² · x²] = −2x / x⁴ f′(x) = −2/x³
- Write f(x + h): f(x + h) = √(x + h)
- Form the difference: f(x + h) − f(x) = √(x + h) − √x We cannot simplify this directly, we must rationalise the numerator.
- Multiply numerator and denominator by the conjugate (√(x+h) + √x): [√(x+h) − √x] × [√(x+h) + √x] = (x+h) − x = h So: [f(x+h)−f(x)] / h = h / [h(√(x+h) + √x)]
- Cancel h: = 1 / (√(x+h) + √x)
- Take the limit as h → 0. (x + h) → x, so √(x+h) → √x: f′(x) = 1 / (√x + √x) = 1 / (2√x) f′(x) = 1 / (2√x)
- Write f(x + h) = 1/√(x + h).
- Form the difference with common denominator √x · √(x+h): [1/√(x+h) − 1/√x] = (√x − √(x+h)) / (√x · √(x+h))
- Divide by h: = (√x − √(x+h)) / (h · √x · √(x+h))
- Rationalise, multiply top and bottom by (√x + √(x+h)): Numerator: (√x − √(x+h))(√x + √(x+h)) = x − (x+h) = −h = −h / (h · √x · √(x+h) · (√x + √(x+h)))
- Cancel h: = −1 / (√x · √(x+h) · (√x + √(x+h)))
- Take the limit as h → 0: = −1 / (√x · √x · (√x + √x)) = −1 / (x · 2√x) f′(x) = −1 / (2x^(3/2))
Group C — Trigonometric Functions (Exercises 9–12)
- Apply the compound angle formula for sin(x + h): f(x + h) = sin(x + h) = sin(x)cos(h) + cos(x)sin(h)
- Form the difference: f(x+h) − f(x) = sin(x)cos(h) + cos(x)sin(h) − sin(x) = sin(x)[cos(h) − 1] + cos(x)sin(h)
- Divide by h: = sin(x) · [(cos(h) − 1)/h] + cos(x) · [sin(h)/h]
- Take the limit. Use the two standard trig limits: lim[h→0] sin(h)/h = 1 lim[h→0] (cos(h) − 1)/h = 0 These two limits are proved using the Squeeze Theorem, see the Limits section.
- Substitute the limits: f′(x) = sin(x) · 0 + cos(x) · 1 = cos(x) f′(x) = cos(x)
- Apply the compound angle formula for cos(x + h): f(x + h) = cos(x)cos(h) − sin(x)sin(h)
- Form the difference: f(x+h) − f(x) = cos(x)cos(h) − sin(x)sin(h) − cos(x) = cos(x)[cos(h) − 1] − sin(x)sin(h)
- Divide by h: = cos(x) · [(cos(h)−1)/h] − sin(x) · [sin(h)/h]
- Take the limit using the same two standard trig limits: f′(x) = cos(x) · 0 − sin(x) · 1 = −sin(x) f′(x) = −sin(x) The minus sign in the derivative of cosine comes directly from the minus sign in the compound angle formula, it is not arbitrary.
- Write f(x + h) = (x+h)² + sin(x+h) and expand: = x² + 2xh + h² + sin(x)cos(h) + cos(x)sin(h)
- Form the difference: f(x+h) − f(x) = 2xh + h² + sin(x)[cos(h)−1] + cos(x)sin(h)
- Divide by h: = 2x + h + sin(x)·[(cos(h)−1)/h] + cos(x)·[sin(h)/h]
- Take the limit (h→0): = 2x + 0 + sin(x)·0 + cos(x)·1 f′(x) = 2x + cos(x) First principles is additive: the derivative of a sum is the sum of the derivatives, as confirmed here.
- Write f(x + h). Since f(x) = c for all x, the value of the function never changes: f(x + h) = c
- Form the difference: f(x + h) − f(x) = c − c = 0
- Divide by h: 0 ÷ h = 0
- Take the limit: f′(x) = lim[h→0] (0) = 0 f′(x) = 0 for any constant c A constant function is flat, its graph is a horizontal line. Horizontal means zero gradient. First principles confirms this elegantly.
§ 06Common Mistakes
These are the errors that appear repeatedly in first principles questions. Study them before your exam.
Wrong: Substituting h = 0 before simplifying the fraction gives 0/0, which is undefined.
Correct: Always simplify the expression algebraically first, expand, cancel, factor out h from the numerator, until the h in the denominator has been cancelled. Only then take the limit h → 0.
Wrong: (x + h)² = x² + h². This omits the cross term.
Correct: (x + h)² = x² + 2xh + h². The 2xh term is essential: it is what survives after dividing by h and produces the derivative 2x. Without it, the answer is wrong.
After forming f(x+h) − f(x), all terms that do not contain h must cancel. If you have a constant term left over, check your expansion of f(x+h), you likely made an arithmetic error somewhere.
For f(x) = 3x² − x, writing f(x + h) = 3(x+h)² − x (leaving the second x unchanged) is a common slip. Every occurrence of x in f(x) must become (x + h) in f(x + h).
In an exam question that specifically asks you to differentiate from first principles, writing "using the power rule, the answer is 2x" earns no marks. You must show the full limit argument, all four steps. The question is testing whether you understand the derivation, not whether you know the shortcut.
§ 07From First Principles to the Power Rule
The exercises above hint at a pattern. Once you see it, the power rule becomes obvious: and something you could derive yourself rather than borrow on faith.
Look at what we found:
d/dx[x²] = 2x = 2·x¹
d/dx[x³] = 3x² = 3·x²
The pattern is unmistakable: the exponent comes down as a multiplier, and the power reduces by 1. This is the power rule, and first principles shows exactly where it comes from.
To prove this for general n, the binomial theorem expansion of (x + h)ⁿ is used. The first term is xⁿ (which cancels), the second term is nxⁿ⁻¹ · h (which survives after dividing by h and taking the limit), and all higher terms vanish as h → 0. The result is precisely n · xⁿ⁻¹.
Once you have the power rule from first principles, the other rules, product, quotient, chain, follow from the same limit arguments. All of calculus sits on this one foundation.
§ 0810-Question Quiz
Test your understanding. Select your answer for each question then press Submit to see your score with full explanations.