๐Ÿ” Differentiation from First Principles

A Level Maths Year 1 ยท Differentiation

Level 3 · Ages 16–17

← Back to topic overview
1 The Gradient of a Curve
A straight line has the same gradient everywhere. A curve does not: its steepness changes from point to point. The gradient of a curve at a point is defined as the gradient of the tangent at that point โ€” the straight line that just touches the curve there.

We cannot find a tangent's gradient directly, because we only know one point on it. Instead we take a second point $Q$ on the curve, find the gradient of the chord $PQ$, and see what happens as $Q$ moves towards $P$.

x y -1 1 2 3 2 4 6 8 10 O y = xยฒ P(1, 1) chord gradient 4 chord gradient 3 chord gradient 2.5 tangent, gradient 2 As Q slides towards P, the chord gradient approaches the tangent gradient
Worked Example 1 โ€” Chords getting shorter

$P$ is the point $(1, 1)$ on $y = x^2$. $Q$ is the point on the curve with $x$-coordinate $1 + h$. Find the gradient of $PQ$ for several values of $h$.

$h$$Q$Gradient of $PQ = \dfrac{(1+h)^2 - 1}{h}$
$2$$(3,\, 9)$$\dfrac{9 - 1}{2} = 4$
$1$$(2,\, 4)$$\dfrac{4 - 1}{1} = 3$
$0.5$$(1.5,\, 2.25)$$\dfrac{1.25}{0.5} = 2.5$
$0.1$$(1.1,\, 1.21)$$\dfrac{0.21}{0.1} = 2.1$
$0.01$$(1.01,\, 1.0201)$$\dfrac{0.0201}{0.01} = 2.01$
$-0.01$$(0.99,\, 0.9801)$$\dfrac{-0.0199}{-0.01} = 1.99$
โ‘ As $h$ gets closer to $0$ (from either side), the chord gradient gets closer to $2$.
โ‘กSo the gradient of $y = x^2$ at $(1, 1)$ is $2$.
2 The Definition of the Derivative

Doing the table algebraically for a general point gives a formula for the gradient everywhere at once. For $y = \mathrm{f}(x)$, take $P\left(x,\, \mathrm{f}(x)\right)$ and $Q\left(x + h,\, \mathrm{f}(x+h)\right)$:

Differentiation from first principles (DfE content area G)
$\mathrm{f}'(x) = \displaystyle\lim_{h \to 0} \dfrac{\mathrm{f}(x + h) - \mathrm{f}(x)}{h}$

"$\displaystyle\lim_{h \to 0}$" means the value the expression approaches as $h$ gets closer and closer to $0$. We never actually put $h = 0$ into the fraction โ€” that would give $\frac00$. We simplify first, so that the $h$ in the denominator cancels, and only then let $h \to 0$.

NotationRead asMeaning
$\mathrm{f}'(x)$"f dash of $x$"The derivative (gradient function) of $\mathrm{f}$
$\dfrac{\mathrm{d}y}{\mathrm{d}x}$"dee $y$ by dee $x$"The rate of change of $y$ with respect to $x$
$\delta x$, $\delta y$"delta $x$", "delta $y$"A small change in $x$ and the matching change in $y$
Many textbooks write the same definition with $\delta x$ in place of $h$: $\;\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle\lim_{\delta x \to 0}\dfrac{\delta y}{\delta x}$. The chord gradient $\dfrac{\delta y}{\delta x}$ becomes the tangent gradient $\dfrac{\mathrm{d}y}{\mathrm{d}x}$ in the limit. Note that $\dfrac{\mathrm{d}y}{\mathrm{d}x}$ is a single symbol, not a fraction you can cancel.
3 Deriving the Results for $x^2$ and $x^3$
Worked Example 2 โ€” Proving the derivative of $x^2$

Prove from first principles that the derivative of $x^2$ is $2x$.

โ‘ $\mathrm{f}(x) = x^2$, so $\mathrm{f}(x + h) = (x + h)^2 = x^2 + 2xh + h^2$.
โ‘ก$\mathrm{f}(x+h) - \mathrm{f}(x) = 2xh + h^2$
โ‘ข$\dfrac{\mathrm{f}(x+h) - \mathrm{f}(x)}{h} = \dfrac{2xh + h^2}{h} = 2x + h$
โ‘ฃ$\mathrm{f}'(x) = \displaystyle\lim_{h \to 0}(2x + h) = 2x$.  $\blacksquare$
With $x = 1$ the chord gradient $2x + h$ is $2 + h$ โ€” exactly the numbers in the table of Example 1.
Worked Example 3 โ€” Proving the derivative of $x^3$

Prove from first principles that $\dfrac{\mathrm{d}}{\mathrm{d}x}\left(x^3\right) = 3x^2$.

โ‘ $(x + h)^3 = x^3 + 3x^2h + 3xh^2 + h^3$
โ‘ก$(x+h)^3 - x^3 = 3x^2h + 3xh^2 + h^3$
โ‘ขDivide by $h$: $3x^2 + 3xh + h^2$
โ‘ฃAs $h \to 0$, $3xh \to 0$ and $h^2 \to 0$, so $\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle\lim_{h \to 0}\left(3x^2 + 3xh + h^2\right) = 3x^2$.  $\blacksquare$
The expansion $(x+h)^3$ comes from the binomial expansion (coefficients $1, 3, 3, 1$ from Pascal's triangle).
Worked Example 4 โ€” A polynomial from first principles

Find $\mathrm{f}'(x)$ from first principles, where $\mathrm{f}(x) = 5x^2 - 3x$.

โ‘ $\mathrm{f}(x+h) = 5(x+h)^2 - 3(x+h) = 5x^2 + 10xh + 5h^2 - 3x - 3h$
โ‘ก$\mathrm{f}(x+h) - \mathrm{f}(x) = 10xh + 5h^2 - 3h$
โ‘ขDivide by $h$: $10x + 5h - 3$
โ‘ฃ$\mathrm{f}'(x) = \displaystyle\lim_{h \to 0}(10x + 5h - 3) = 10x - 3$
Worked Example 5 โ€” Straight lines and constants

Use first principles to differentiate (a) $\mathrm{f}(x) = mx + c$   (b) $\mathrm{g}(x) = k$ (a constant).

โ‘ (a) $\dfrac{m(x+h) + c - (mx + c)}{h} = \dfrac{mh}{h} = m$, so $\mathrm{f}'(x) = m$.
โ‘ก(b) $\dfrac{k - k}{h} = 0$, so $\mathrm{g}'(x) = 0$.
โ‘ขThe gradient of a straight line is its $m$, and a horizontal line has gradient $0$ โ€” as expected.
4 The Pattern: $kx^n$
$\mathrm{f}(x)$$1$$x$$x^2$$x^3$$x^4$
$\mathrm{f}'(x)$$0$$1$$2x$$3x^2$$4x^3$
The binomial expansion shows why: $(x + h)^n = x^n + nx^{n-1}h + (\text{terms in } h^2, h^3, \ldots)$. Subtracting $x^n$ and dividing by $h$ leaves $nx^{n-1}$ plus terms that all still contain $h$, which vanish in the limit. Multiplying $\mathrm{f}$ by a constant $k$ multiplies every chord gradient by $k$, so \[ \frac{\mathrm{d}}{\mathrm{d}x}\left(kx^n\right) = knx^{n-1}. \]

This rule โ€” which also works for negative and fractional $n$ โ€” is developed and used on the Differentiating Powers of $x$ page. Here is one case with a negative power, done from first principles.

Worked Example 6 โ€” First principles for $\dfrac{1}{x}$

Show from first principles that the derivative of $\mathrm{f}(x) = \dfrac1x$ is $-\dfrac{1}{x^2}$.

โ‘ $\mathrm{f}(x+h) - \mathrm{f}(x) = \dfrac{1}{x+h} - \dfrac1x = \dfrac{x - (x+h)}{x(x+h)} = \dfrac{-h}{x(x+h)}$
โ‘กDivide by $h$: $\dfrac{-1}{x(x+h)}$
โ‘ขAs $h \to 0$: $\mathrm{f}'(x) = \dfrac{-1}{x \cdot x} = -\dfrac{1}{x^2}$
This agrees with the pattern: $x^{-1}$ differentiates to $-1 \times x^{-2}$.
"From first principles" means use the limit. If a question says this, quoting $nx^{n-1}$ earns no marks. You must show the expansion, the cancellation of $h$, and the limit, with $\lim_{h\to0}$ written correctly.
5 Quick Reference

Gradient of a curve

The gradient of the tangent at that point.

Chord

Gradient $\dfrac{\mathrm{f}(x+h) - \mathrm{f}(x)}{h}$

Definition

$\mathrm{f}'(x) = \displaystyle\lim_{h\to0}\dfrac{\mathrm{f}(x+h)-\mathrm{f}(x)}{h}$

Notation

$\mathrm{f}'(x)$ and $\dfrac{\mathrm{d}y}{\mathrm{d}x}$ mean the same.

Method

Expand, subtract, divide by $h$, let $h \to 0$.

$x^2$

Chord gradient $2x + h \to 2x$

$x^3$

$3x^2 + 3xh + h^2 \to 3x^2$

Pattern

$kx^n \to knx^{n-1}$

Never

substitute $h = 0$ before cancelling.

6 Practice Questions
Question 1

Find the gradient of the chord joining the points on $y = x^2$ with $x = 2$ and $x = 2.1$. What does this suggest about the gradient of the curve at $x = 2$?

โ–ถ Show solution

Points $(2, 4)$ and $(2.1, 4.41)$. Gradient $= \dfrac{0.41}{0.1} = 4.1$.

This suggests the gradient at $x = 2$ is a little less than $4.1$ โ€” in fact it is $2 \times 2 = 4$.

Question 2

Points $P$ and $Q$ on $y = x^2$ have $x$-coordinates $3$ and $3 + h$. Show that the gradient of $PQ$ is $6 + h$, and deduce the gradient of the curve at $P$.

โ–ถ Show solution

$\dfrac{(3+h)^2 - 9}{h} = \dfrac{9 + 6h + h^2 - 9}{h} = \dfrac{6h + h^2}{h} = 6 + h$.

As $h \to 0$, the gradient tends to $6$.

Question 3

Differentiate $\mathrm{f}(x) = 3x^2$ from first principles.

โ–ถ Show solution

$\mathrm{f}(x+h) = 3x^2 + 6xh + 3h^2$

$\dfrac{\mathrm{f}(x+h) - \mathrm{f}(x)}{h} = \dfrac{6xh + 3h^2}{h} = 6x + 3h$

$\mathrm{f}'(x) = \displaystyle\lim_{h\to0}(6x + 3h) = 6x$

Question 4

Differentiate $\mathrm{f}(x) = x^2 + 5x$ from first principles.

โ–ถ Show solution

$\mathrm{f}(x+h) = x^2 + 2xh + h^2 + 5x + 5h$

$\mathrm{f}(x+h) - \mathrm{f}(x) = 2xh + h^2 + 5h$

Divide by $h$: $2x + h + 5$

$\mathrm{f}'(x) = \displaystyle\lim_{h\to0}(2x + h + 5) = 2x + 5$

Question 5

Use first principles to show that the gradient of $y = 4x - 7$ is $4$ everywhere.

โ–ถ Show solution

$\dfrac{4(x+h) - 7 - (4x - 7)}{h} = \dfrac{4h}{h} = 4$

This does not depend on $h$, so the limit is $4$, for every $x$.

Question 6

Prove from first principles that the derivative of $x^3$ is $3x^2$.

โ–ถ Show solution

$\mathrm{f}(x+h) = (x+h)^3 = x^3 + 3x^2h + 3xh^2 + h^3$

$\dfrac{\mathrm{f}(x+h) - \mathrm{f}(x)}{h} = \dfrac{3x^2h + 3xh^2 + h^3}{h} = 3x^2 + 3xh + h^2$

$\mathrm{f}'(x) = \displaystyle\lim_{h\to0}\left(3x^2 + 3xh + h^2\right) = 3x^2$  $\blacksquare$

Question 7

Differentiate $\mathrm{f}(x) = 2x^3 - x$ from first principles.

โ–ถ Show solution

$\mathrm{f}(x+h) = 2\left(x^3 + 3x^2h + 3xh^2 + h^3\right) - x - h$

$\mathrm{f}(x+h) - \mathrm{f}(x) = 6x^2h + 6xh^2 + 2h^3 - h$

Divide by $h$: $6x^2 + 6xh + 2h^2 - 1$

$\mathrm{f}'(x) = \displaystyle\lim_{h\to0}\left(6x^2 + 6xh + 2h^2 - 1\right) = 6x^2 - 1$

Question 8

$P(1, 1)$ and $Q\left(1 + h,\, (1+h)^3\right)$ lie on $y = x^3$. (a) Show that the gradient of $PQ$ is $3 + 3h + h^2$. (b) Find the gradient when $h = 0.1$ and when $h = 0.01$. (c) State the gradient of the curve at $P$.

โ–ถ Show solution

(a) $\dfrac{(1+h)^3 - 1}{h} = \dfrac{1 + 3h + 3h^2 + h^3 - 1}{h} = 3 + 3h + h^2$

(b) $h = 0.1$: $3 + 0.3 + 0.01 = 3.31$.   $h = 0.01$: $3 + 0.03 + 0.0001 = 3.0301$.

(c) As $h \to 0$ the gradient tends to $3$.

Question 9

Prove from first principles that the derivative of $\dfrac{1}{x}$ is $-\dfrac{1}{x^2}$, for $x \neq 0$.

โ–ถ Show solution

$\dfrac{1}{x+h} - \dfrac{1}{x} = \dfrac{x - x - h}{x(x+h)} = \dfrac{-h}{x(x+h)}$

Dividing by $h$: $\dfrac{-1}{x(x+h)}$

$\mathrm{f}'(x) = \displaystyle\lim_{h\to0}\dfrac{-1}{x(x+h)} = -\dfrac{1}{x^2}$  $\blacksquare$

Question 10

Let $\mathrm{f}(x) = x^4$.

(a) Expand $(x + h)^4$.   (b) Hence prove from first principles that $\mathrm{f}'(x) = 4x^3$.   (c) Find the gradient of $y = x^4$ at $x = -2$.   (d) Using your results for $x^2$, $x^3$ and $x^4$, suggest the derivative of $x^n$, and explain briefly why the binomial expansion supports this.

โ–ถ Show solution

(a) Using coefficients $1, 4, 6, 4, 1$: $(x+h)^4 = x^4 + 4x^3h + 6x^2h^2 + 4xh^3 + h^4$.

(b) $\dfrac{(x+h)^4 - x^4}{h} = \dfrac{4x^3h + 6x^2h^2 + 4xh^3 + h^4}{h} = 4x^3 + 6x^2h + 4xh^2 + h^3$.

Every term except $4x^3$ contains $h$, so $\mathrm{f}'(x) = \displaystyle\lim_{h\to0}\left(4x^3 + 6x^2h + 4xh^2 + h^3\right) = 4x^3$.  $\blacksquare$

(c) $4(-2)^3 = -32$.

(d) $\dfrac{\mathrm{d}}{\mathrm{d}x}\left(x^n\right) = nx^{n-1}$. In $(x+h)^n = x^n + nx^{n-1}h + \ldots$ the second term is always $nx^{n-1}h$, and all later terms contain $h^2$ or higher. After subtracting $x^n$ and dividing by $h$, only $nx^{n-1}$ survives as $h \to 0$.

Differentiation from First Principles · A Level Maths Year 1 · Created with MathJax