Hersi Maths WhatsApp me

Understand · explore · practise

Differentiation from first principles

Find a curve’s gradient from nearby points. Understand secants, tangents, the difference quotient and limits, with first-principles proofs and worked practice.

Before you startGradients of lines, algebraic expansion and fractions

01 / What is a curve’s gradient?

A gradient describes how steep the curve is here.

A straight line has one gradient. A curve can have a different gradient at each point. At a point where a finite tangent gradient exists, that gradient is the curve’s instantaneous rate of change.

On a graph, draw or estimate the tangent at the point, choose two well-separated points on that straight line, then calculate rise divided by run. Read the coordinate scales: a steep-looking line on stretched axes need not have a large numerical gradient.

Gradient = change in y / change in x

A tangent is a local direction, not a rule that a line must meet the curve only once. The x-axis is tangent to y = x³ at the origin and the curve crosses it there.

02 / Start with two points

A secant gives the average gradient between two positions.

Take f(x) = x² + x − 2. Choose A at x = a and a second point B at x = a + h. For h ≠ 0, their secant gradient is:

msecant = [f(a + h) − f(a)] / h
= 2a + 1 + h

At a = 1, the gradient is 3 + h. With h = 1 it is 4; with h = 0.1 it is 3.1; with h = −0.1 it is 2.9. Approaching from either side suggests the tangent gradient is 3.

Choose a point and a separation in the model. The “tangent limit” choice shows the limiting line; it does not evaluate the original quotient at h = 0.

Bring the two points closerMove at your pace
Bring the two points closerAt a = 1, A = (1,0). For h = 0.1, B = (1.1,0.31) and the secant gradient is 3.1. The tangent gradient is 3. Blue is the curve; gold is the secant; green is the tangent.f(x) = x² + x − 2-2024-404812a = 1 · h = 0.1Secant gradient = 3.1Tangent gradient = 3

At a = 1, A = (1,0). For h = 0.1, B = (1.1,0.31) and the secant gradient is 3.1. The tangent gradient is 3. Blue is the curve; gold is the secant; green is the tangent.

Watch a secant approach the tangent from both sides

Pause, replay or seek freely. The notes explain the same idea and stay in view.

03 / The difference quotient

Take a limit after simplifying the expression.

f′(x) = limh → 0 [f(x + h) − f(x)] / h

This defines the derivative wherever the limit exists as a finite number. The numerator is a change in output and the denominator is a change in input. The two changes must refer to the same points.

Do not put h = 0 into the original quotient: it gives 0/0, which is undefined. Simplify while h ≠ 0, then find the value approached as h tends to zero. Approaching zero and being zero are different steps.

You may see Δx instead of h. It plays the same role as the input increment. The derivative is also written dy/dx when y = f(x); f′(a) is its value at a particular input.

04 / A quadratic proof

Expand the entire shifted expression.

For f(x) = x² + x − 2:

From secant to derivativeWorked example

f(x + h) = (x + h)² + (x + h) − 2

Replace every x by x + h.

f(x + h) − f(x) = 2xh + h² + h

Subtract the whole original expression; constant and unchanged terms cancel.

[f(x + h) − f(x)]/h = 2x + h + 1

Factor out h and cancel it only while h ≠ 0.

f′(x) = 2x + 1

Let h tend to zero in the simplified expression.

Thus f′(1) = 3 and f′(−1) = −1. The derivative is a function of x; a gradient at one point is a number.

The general quadratic

For f(x) = ax² + bx + c:
[f(x + h) − f(x)]/h = 2ax + ah + b
f′(x) = 2ax + b

Here a,b,c are constants. The vertical shift c disappears because it changes both outputs by the same amount.

05 / A cubic proof

Terms containing h vanish in the limit.

For g(x) = x³, the binomial expansion gives:

(x + h)³ = x³ + 3x²h + 3xh² + h³
[g(x + h) − g(x)]/h = 3x² + 3xh + h²
g′(x) = 3x²

At x = 0 the derivative is zero, even though the curve continues to rise through the origin. A zero derivative does not automatically mean a maximum or minimum.

Extend the idea to a positive integer power

For an integer n ≥ 2, expand (x + h)ⁿ. After subtracting xⁿ and dividing by h, the first term is nxⁿ⁻¹ and every remaining term contains a positive power of h. Their limits are zero, so the derivative of xⁿ is nxⁿ⁻¹. For n = 1, the quotient is simply 1.

This argument proves the rule for positive integers. It does not by itself prove the rule for every real exponent.

06 / A reciprocal proof

Combine the fractions before taking the limit.

For f(x) = 1/x, fix x ≠ 0 and use nearby h with x + h ≠ 0.

[1/(x + h) − 1/x]/h
= [−h / (x(x + h))]/h
= −1/[x(x + h)]
f′(x) = −1/x²

The derivative is negative on each side of zero. The curve is not defined at zero, so there is no derivative there. A simplification never fills a missing point in the original domain.

07 / When the derivative does not exist

The two sides must agree on a finite gradient.

At the corner of y = |x|, the difference quotient at x = 0 is |h|/h. It is 1 for h > 0 and −1 for h < 0. There is no single two-sided derivative at the corner.

For y = √x at x = 0, positive secant gradients are √h/h = 1/√h. They grow without bound. A vertical tangent direction does not give a finite value of dy/dx.

For a boundary point of a restricted model, specify whether you are discussing a one-sided rate. Do not quietly treat a missing two-sided limit as an ordinary derivative.

08 / Your turn

Show the cancellation before writing the limit.

Use first principles in each calculation rather than quoting the power rule.

01 · Two points

For f(x) = x² + x − 2 at a = 2, find the secant gradient for h = 0.2 and h = −0.2. What limit do they suggest?

Hint

The simplified quotient is 2a + 1 + h.

Worked solution

5.2 and 4.8; limiting gradient 5.

02 · A constant

Prove that the derivative of f(x) = 7 is zero.

Hint

The two outputs are equal.

Worked solution

[7 − 7]/h = 0 for h ≠ 0
f′(x) = 0.

03 · A line

Find the derivative of f(x) = −4x + 3 from first principles.

Hint

Expand −4(x + h) + 3.

Worked solution

[−4(x + h) + 3 − (−4x + 3)]/h
= −4h/h = −4
f′(x) = −4.

04 · A quadratic

Find the derivative of f(x) = 3x² − 2x, and its gradient at x = 2.

Hint

The numerator factors as h(6x + 3h − 2).

Worked solution

Difference quotient = 6x + 3h − 2
f′(x) = 6x − 2
f′(2) = 10.

05 · A cubic combination

Find the derivative of g(x) = 2x³ − x, and evaluate it at x = −1.

Hint

Use the expansion of (x + h)³.

Worked solution

Difference quotient = 6x² + 6xh + 2h² − 1
g′(x) = 6x² − 1
g′(−1) = 5.

06 · A reciprocal multiple

Show from first principles that the derivative of 2/x is −2/x². State the domain restriction.

Hint

Use a common denominator in the numerator.

Worked solution

[2/(x + h) − 2/x]/h = −2/[x(x + h)]
Limit = −2/x², for x ≠ 0.

07 · A power proof

Use the binomial expansion to prove that the derivative of x⁵ is 5x⁴.

Hint

After cancelling x⁵, divide every remaining term by h.

Worked solution

Quotient = 5x⁴ + 10x³h + 10x²h² + 5xh³ + h⁴
Limit = 5x⁴.

08 · A corner

Why does y = |x| have no derivative at x = 0?

Hint

Compare positive and negative h.

Worked solution

The quotient |h|/h approaches 1 from the right and −1 from the left. The limits disagree.

09 · Tangent or crossing?

A student rejects the x-axis as a tangent to y = x³ at zero because the curve crosses it. Explain.

Hint

The derivative at zero is 0.

Worked solution

The tangent has the curve’s limiting local gradient, here zero. Crossing the curve does not prevent a line being tangent at that point.

09 / Recap

A derivative is a limiting gradient.

  • Start with two points and a non-zero input separation.
  • Subtract the entire original function.
  • Simplify before taking h → 0.
  • f′(x) is a function; f′(a) is its value at one input.
  • Keep the original domain restrictions.
  • A corner or unbounded slope may prevent a finite derivative.

Next: the power rule →

Section 1 of 9 · What is a curve’s gradient?