Differentiation, Chapter 01

Differentiation from First Principles

Where derivatives actually come from: the limit definition built up from scratch, 12 fully worked examples from polynomials to surds, and a 10-question quiz.

✦ The Limit Definition ✦ Full Derivation ✦ 12 Worked Examples ✦ Polynomials · Surds · Trig ✦ Interactive Graph ✦ 10-Question Quiz
Share this page

§ 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.

Why bother learning this? In exams you will rarely be asked to differentiate a simple function from first principles — the rules are faster. But understanding the derivation makes the rules feel inevitable rather than magical. It also gives you the tools to handle genuinely new functions that no rule covers.

§ 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:

Two points on y = f(x)
Point A:   (x,  f(x))
Point B:   (x + h,  f(x + h))

The straight line connecting A and B is called a chord. Its gradient is rise over run:

Gradient of the chord AB
m = [ f(x + h) − f(x) ] ÷ h

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:

The First Principles Definition
f′(x) = limh→0   [ f(x + h) − f(x) ] ÷ h

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.

What does the limit actually mean here? We cannot set h = 0 directly — that would give 0/0, which is undefined. Instead, we simplify the expression algebraically until the h in the denominator cancels, and then take the limit. The simplification always happens first.

§ 03The Four-Step Method

Every first principles problem follows exactly the same four steps. Memorise this routine and you can handle any function systematically.

Step 01
Write f(x + h)

Replace every x in the formula for f(x) with (x + h). Expand carefully, every x becomes (x + h), including inside powers and brackets.

Step 02
Form the difference

Calculate f(x + h) − f(x). Expand and simplify. Every term that does not contain h will cancel, leaving only terms with h.

Step 03
Divide by 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.

Step 04
Take the limit

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.

Worked derivation — f(x) = x²

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.

← Adjust h to see the chord approach the tangent

§ 05Twelve Worked Exercises

Work each problem yourself before revealing the solution. Every algebraic step is shown and explained: nothing is skipped.

Exercises opened: 0 / 12

Group A — Polynomials (Exercises 1–4)

Exercise 01 Basic
Differentiate f(x) = x from first principles
  1. Write f(x + h): f(x + h) = x + h
  2. Form the difference: f(x + h) − f(x) = (x + h) − x = h
  3. Divide by h: h ÷ h = 1
  4. 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.
Exercise 02 Basic
Differentiate f(x) = x² from first principles
  1. Write f(x + h). Expand (x + h)² using (a + b)² = a² + 2ab + b²: f(x + h) = (x + h)² = x² + 2xh + h²
  2. 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.
  3. Divide by h. Factor h from the numerator: (2xh + h²) ÷ h = h(2x + h) ÷ h = 2x + h
  4. Take the limit as h → 0. The h term disappears: f′(x) = lim[h→0] (2x + h) = 2x f′(x) = 2x
Exercise 03 Basic
Differentiate f(x) = x³ from first principles
Expand (x + h)³ using the binomial theorem: (a + b)³ = a³ + 3a²b + 3ab² + b³. The x³ terms will cancel in Step 2, leaving terms all containing h.
  1. Write f(x + h). Expand (x + h)³: f(x + h) = (x + h)³ = x³ + 3x²h + 3xh² + h³
  2. Form the difference: f(x + h) − f(x) = x³ + 3x²h + 3xh² + h³ − x³ = 3x²h + 3xh² + h³
  3. Divide by h. Every term has h as a factor: (3x²h + 3xh² + h³) ÷ h = 3x² + 3xh + h²
  4. Take the limit: the h and h² terms vanish: f′(x) = lim[h→0] (3x² + 3xh + h²) = 3x² f′(x) = 3x²
Exercise 04 Basic
Differentiate f(x) = 5x² − 3x + 2 from first principles
Replace every x with (x + h) in the entire expression. Work term by term: expand 5(x+h)², then −3(x+h), then the constant 2. The constant will cancel.
  1. 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
  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.
  3. Divide by h. Factor h from each term: (10xh + 5h² − 3h) ÷ h = 10x + 5h − 3
  4. 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)

Exercise 05 Medium
Differentiate f(x) = 1/x from first principles
In Step 2, the subtraction 1/(x+h) − 1/x requires a common denominator of x(x+h). Combine the fractions, then simplify.
  1. Write f(x + h): f(x + h) = 1 / (x + h)
  2. 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.
  3. Divide by h: the h in the numerator and the h denominator cancel: [ −h / (x(x+h)) ] ÷ h = −1 / [x(x + h)]
  4. 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²
Exercise 06 Medium
Differentiate f(x) = 1/x² from first principles
Form 1/(x+h)² − 1/x². Use common denominator x²(x+h)². Expand (x+h)² = x² + 2xh + h² in the numerator, then subtract x²(x+h)²/(x²(x+h)²)... The constant terms will cancel leaving only terms in h.
  1. Write f(x + h): f(x + h) = 1/(x + h)²
  2. 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)²]
  3. Divide by h. Factor h from numerator: = h(−2x − h) / (h · x²(x+h)²) = (−2x − h) / [x²(x+h)²]
  4. Take the limit as h → 0: f′(x) = (−2x − 0) / [x² · x²] = −2x / x⁴ f′(x) = −2/x³
Exercise 07 Medium
Differentiate f(x) = √x from first principles
After forming the difference √(x+h) − √x, rationalise the numerator by multiplying top and bottom by the conjugate (√(x+h) + √x). This eliminates the square roots from the numerator.
  1. Write f(x + h): f(x + h) = √(x + h)
  2. Form the difference: f(x + h) − f(x) = √(x + h) − √x We cannot simplify this directly, we must rationalise the numerator.
  3. 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)]
  4. Cancel h: = 1 / (√(x+h) + √x)
  5. 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)
Exercise 08 Medium
Differentiate f(x) = 1/√x from first principles
Form 1/√(x+h) − 1/√x. Use a common denominator of √x·√(x+h). You'll get (√x − √(x+h)) in the numerator — now rationalise that as in Exercise 7.
  1. Write f(x + h) = 1/√(x + h).
  2. Form the difference with common denominator √x · √(x+h): [1/√(x+h) − 1/√x] = (√x − √(x+h)) / (√x · √(x+h))
  3. Divide by h: = (√x − √(x+h)) / (h · √x · √(x+h))
  4. 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)))
  5. Cancel h: = −1 / (√x · √(x+h) · (√x + √(x+h)))
  6. 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)

Exercise 09 Hard
Differentiate f(x) = sin(x) from first principles
Use the compound angle formula: sin(x + h) = sin(x)cos(h) + cos(x)sin(h). The limit then breaks into two parts: you need the standard limits lim[h→0] sin(h)/h = 1 and lim[h→0] (cos(h)−1)/h = 0.
  1. Apply the compound angle formula for sin(x + h): f(x + h) = sin(x + h) = sin(x)cos(h) + cos(x)sin(h)
  2. 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)
  3. Divide by h: = sin(x) · [(cos(h) − 1)/h] + cos(x) · [sin(h)/h]
  4. 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.
  5. Substitute the limits: f′(x) = sin(x) · 0 + cos(x) · 1 = cos(x) f′(x) = cos(x)
Exercise 10 Hard
Differentiate f(x) = cos(x) from first principles
Use cos(x + h) = cos(x)cos(h) − sin(x)sin(h). Group terms to get cos(x)·[(cos(h)−1)/h] and −sin(x)·[sin(h)/h], then apply the same two standard limits.
  1. Apply the compound angle formula for cos(x + h): f(x + h) = cos(x)cos(h) − sin(x)sin(h)
  2. 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)
  3. Divide by h: = cos(x) · [(cos(h)−1)/h] − sin(x) · [sin(h)/h]
  4. 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.
Exercise 11 Hard
Differentiate f(x) = x² + sin(x) from first principles
  1. Write f(x + h) = (x+h)² + sin(x+h) and expand: = x² + 2xh + h² + sin(x)cos(h) + cos(x)sin(h)
  2. Form the difference: f(x+h) − f(x) = 2xh + h² + sin(x)[cos(h)−1] + cos(x)sin(h)
  3. Divide by h: = 2x + h + sin(x)·[(cos(h)−1)/h] + cos(x)·[sin(h)/h]
  4. 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.
Exercise 12 Hard
Show from first principles that the derivative of any constant f(x) = c is zero
  1. Write f(x + h). Since f(x) = c for all x, the value of the function never changes: f(x + h) = c
  2. Form the difference: f(x + h) − f(x) = c − c = 0
  3. Divide by h: 0 ÷ h = 0
  4. 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.

✗ Setting h = 0 too early

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.

✗ Expanding (x + h)² as x² + h²

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.

✗ Not cancelling all constant terms in Step 2

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.

✗ Forgetting to replace every x when writing f(x + h)

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).

✗ Applying the rules without showing the limit work

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:

Pattern emerging from first principles
d/dx[x¹] = 1   = 1·x⁰
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.

The Power Rule (derived from first principles)
d/dx [xⁿ] = n · xⁿ⁻¹

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.

First Principles — Quiz

Question 01 of 10
The first principles definition of f′(x) is ...
  • lim[h→0] f(x + h) / h
  • lim[h→0] [ f(x + h) − f(x) ] / h
  • lim[h→0] [ f(x + h) − f(h) ] / x
  • lim[x→0] [ f(x + h) − f(x) ] / h
Question 02 of 10
If f(x) = x², what is f(x + h)?
  • x² + h²
  • x² + 2xh
  • x² + 2xh + h²
  • 2x + 2h
Question 03 of 10
Using first principles, d/dx[x²] = 2x. In the derivation, after forming (2xh + h²)/h, the next step is ...
  • Set h = 0 immediately to get 0/0
  • Factor h from the numerator to get (2x + h), then take the limit
  • Multiply numerator and denominator by h
  • Replace h with 1
Question 04 of 10
Using first principles, what is d/dx[x³]?
  • 3x
  • 3x²
  • 2x³
Question 05 of 10
Why can we not simply set h = 0 directly in the limit [ f(x+h) − f(x) ] / h ?
  • Because h must always be positive
  • Because setting h = 0 gives 0/0 which is undefined before simplification
  • Because the limit does not exist
  • Because h represents a fixed small number
Question 06 of 10
Using first principles, what is d/dx[√x]?
  • 1 / √x
  • 2√x
  • 1 / (2√x)
  • √(2x)
Question 07 of 10
What technique is used to simplify √(x+h) − √x in the first principles derivation of d/dx[√x]?
  • Completing the square
  • Long division
  • Multiplying by the conjugate to rationalise the numerator
  • Partial fractions
Question 08 of 10
In the first principles proof of d/dx[sin x] = cos x, which standard limit is used?
  • lim[h→0] sin(h)/h = 0
  • lim[h→0] sin(h)/h = 1
  • lim[h→0] cos(h)/h = 1
  • lim[h→0] sin(h) = h
Question 09 of 10
Using first principles, what is d/dx[1/x]?
  • 1/x²
  • −1/x
  • ln x
  • −1/x²
Question 10 of 10
The chord between (x, f(x)) and (x+h, f(x+h)) on the curve y = f(x) has gradient [ f(x+h) − f(x) ] / h. As h → 0, this chord becomes ...
  • The normal to the curve at x
  • A horizontal line
  • The tangent to the curve at x
  • A vertical line
❧     ❧     ❧

Cookie Settings