The Limit Definition of The Derivative
A concise introduction to the derivative, developing it from average rate of change to the limit definition, with examples and key concepts such as secant lines, tangent lines, and differentiability. Directly addresses syllabus objective 2.1.
Edu Level: Unit1
Date: Dec 5 2025 - 8:28 AM
⏱️Read Time:
Refresher: The Gradient of a Straight Line
So far, you should be familiar with the following ideas:
- A straight line can be expressed as a linear function $f(x) = mx + c$ where $m$ is the gradient and $c$ is the $y$-intercept.
- The gradient of a straight line is constant everywhere along the line, meaning that it does not vary based on the value of $x$.
- The formula to calculate the gradient of a straight line, $m$, given two points $(x_1,y_1)$ and $(x_2,y_2)$ which lie on the line: $$m = \frac{\Delta y}{\Delta x} = \frac{y_2-y_1}{x_2-x_1}$$
But how can we calculate the gradient of another function? Would this method still work? Let's try it with the function $f(x) = x^2$, using two arbitrary points $(0,0)$ and $(1,1)$. $$ \begin{align*} \frac{\Delta y}{\Delta x} &= \frac{1-0}{1-0} \\ &= \frac{1}{1} \\ &= 1 \end{align*} $$ Okay, so we obtained $1$ as the gradient. Let's try it using another set of points: $(2,4)$ and $(3,9)$. $$ \begin{align*} \frac{\Delta y}{\Delta x} &= \frac{9-4}{3-2} \\ &= \frac{5}{1} \\ &= 5 \end{align*} $$ Hmm, now the gradient is $5$? How can this be?
Consider the graph of $y = x^2$ below (in blue), a line connecting $(0,0)$ and $(1,1)$ (in red) and a line connecting $(2,4)$ and $(3,9)$ (in purple).
Evidently, the slopes of these lines are different; the purple line is much steeper than the red line. We deduce an interesting conclusion from this experiment: the gradient of $y=x^2$ is variable and hence depends on which points are chosen to calculate the gradient.
Changing Gradients
Linear ($y=mx+c$) and constant ($y=c$) functions are the only functions whose gradients are constant for all values of $x$. Thus, regardless of which points we choose as $(x_1,y_1)$ and $(x_2,y_2)$, the gradient will always be the same.
However, for most other types of functions - including higher-order polynomials (of degree $\geq 2$), exponential, logarithmic and trigonometric functions - the gradient is not constant and changes depending on the chosen points.
Consider a function $f(x)$ which is continuous over the interval $[a, b]$. Now, let $(x, f(x))$ be any point within this interval. Now, consider a new point $h$ units adjacent to $(x, f(x))$. This point is $(x+h, f(x+h))$. Now, by applying the gradient formula for a straight line, we can calculate the average gradient between $(x,f(x))$ and $(x+h, f(x+h))$:
$$ \begin{align*} \frac{\Delta y}{\Delta x} &= \frac{f(x+h) - f(x)}{(x+h) - x} \\ \frac{\Delta y}{\Delta x} &= \frac{f(x+h) - f(x)}{h} \end{align*} $$
Graphically, this looks like:
Now, let's observe what happens as we let $h$ get closer to $0$ (which results in the distance between the two points becoming smaller).
Notice how, as the points get closer to each other, the secant line (connecting two points) drawn becomes more like a tangent line (touching only one point). As $h$ gets nearer to $0$, the resulting line closely approximates a tangent line at $(x, f(x))$.
Contrary to the average gradient $\displaystyle \frac{\Delta y}{\Delta x}$ found between $(x_1,y_1)$ and $(x_2,y_2)$, the gradient of the tangent line gives the instantaneous rate of change of the function at $(x, f(x))$ and is denoted by $\displaystyle \frac{\text{d}y}{\text{d}x}$ or $f'(x)$ (pronounced "f prime of x").
The instantaneous rate of change of the function is a measure of how much $y$ changes with respect to $x$ at the point $(x, f(x))$. Therefore, $\displaystyle \frac{\text{d}y}{\text{d}x}$ requires only one point - unlike $\displaystyle \frac{\Delta y}{\Delta x}$, which measures the average change of $y$ with respect to $x$ between two different points. This is a key distinction to note.
Defining the Derivative as a Limit
Recall, from our estimation of the gradient earlier,
$$\frac{\Delta y}{\Delta x} = \frac{f(x+h) - f(x)}{h}$$
Remember that the instantaneous rate of change is defined when $h$ becomes "infinitely close" to $0$. Formalizing this idea using limits, $$\frac{\text{d}y}{\text{d}x} = \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}$$
$\displaystyle \frac{\text{d}y}{\text{d}x}$ is called "the derivative of $y$ with respect to $x$" or "the gradient function". The process of obtaining a derivative is called differentiation and is denoted by the $\displaystyle \frac{\text{d}}{\text{d}x}$ operator, which means "to differentiate with respect to $x$". Thus, $$\frac{\text{d}}{\text{d}x}(y) = \frac{\text{d}y}{\text{d}x}$$
Later on, you will learn rules that simplify the process of differentiation. However, this article is focused on differentiation using the limit definition of the derivative. More specifically, this approach is called differentiation from first principles.
It should be noted that $\displaystyle \frac{\text{d}y}{\text{d}x}$ is a limit, not a fraction - although the notation might suggest otherwise. Later in the syllabus, when solving separable differential equations, however, you may find it useful to treat $\displaystyle \frac{\text{d}y}{\text{d}x}$ as a fraction.
A function is differentiable at a point $(a, f(a))$ if and only if the limit at $x=a$ exists. The value of the derivative at $(a, f(a))$ is denoted by $f'(a)$ or $\displaystyle \left.\frac{\text{d}y}{\text{d}x}\right|_{x=a}$ and is calculated by directly substituting $x=a$ into the gradient function.
Now that we have conceptually understood the theory behind derivatives, let us practice calculating the derivative of different functions from first principles.
Example 1: If $f(x) = x^2$, determine $f'(x)$. Recall $$ \begin{align*} f'(x) &= \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h} \\ f'(x) &= \lim_{h \rightarrow 0} \frac{(x+h)^2 - x^2}{h} \\ &= \lim_{h \rightarrow 0} \frac{\cancel{x^2} + 2hx + h^2 \cancel{- x^2}}{h} \\ &= \lim_{h \rightarrow 0} \frac{2hx + h^2}{h} \\ &= \lim_{h \rightarrow 0} \frac{\cancel{h}(2x + h)}{\cancel{h}} \\ &= \lim_{h \rightarrow 0} (2x + h) \\ &= 2x + 0 \\ f'(x) &= 2x \end{align*} $$
Example 2: If $f(x)=\sin{x}$, determine $f'(x)$. Hence, calculate $f'(\pi)$.
Recall $$ \begin{align*} f'(x) &= \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h} \\ f'(x) &= \lim_{h \rightarrow 0} \frac{\sin{(x+h)} - \sin{x}}{h} \\ &= \lim_{h \rightarrow 0} \frac{\sin{x}\cos{h} + \cos{x}\sin{h} - \sin{x}}{h} \text{ (Using the sum to product formula for }\sin{(A+B)}\text{)} \\ &= \lim_{h \rightarrow 0} \frac{\sin{x}\cos{h} - \sin{x} + \cos{x}\sin{h}}{h} \\ &= \lim_{h \rightarrow 0} \frac{\sin{x}\cos{h} - \sin{x}}{h} + \lim_{h \rightarrow 0} \frac{\cos{x}\sin{h}}{h} \\ &= \lim_{h \rightarrow 0} \frac{\sin{x}(\cos{h} - 1)}{h} + \lim_{h \rightarrow 0} \frac{\cos{x}\sin{h}}{h} \text{ (Factoring out }\sin{x}\text{)} \\ &= \sin{x} \lim_{h \rightarrow 0} \frac{\cos{h} - 1}{h} + \cos{x} \lim_{h \rightarrow 0} \frac{\sin{h}}{h} \text{ (Factoring }\sin{x}\text{ and } \cos{x} \text{ out of the limit since they do not depend on } h \text{)} \\ &= \sin{x} \cancelto{0}{\lim_{h \rightarrow 0} \frac{\cos{h} - 1}{h}} + \cos{x} \cancelto{1}{\lim_{h \rightarrow 0} \frac{\sin{h}}{h}} \\ f'(x) &= \cos{x} \\ \implies f'(\pi) &= \cos{\pi} \\ f'(\pi) &= -1 \end{align*} $$
Example 3: If $y = 3x^2 + x + 1$, show that $\displaystyle \left.\frac{\text{d}y}{\text{d}x}\right|_{x=5} = 31$.
Proof:
Recall $$ \begin{align*} \frac{\text{d}y}{\text{d}x} &= \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h} \\ \frac{\text{d}y}{\text{d}x} &= \lim_{h \rightarrow 0} \frac{(3(x+h)^2 + (x+h) + 1 - (3x^2 + x + 1)}{h} \\ &= \lim_{h \rightarrow 0} \frac{3(x^2 + 2hx + h^2) \cancel{+ x} + h \cancel{+ 1} - 3x^2 \cancel{- x} \cancel{- 1}}{h} \\ &= \lim_{h \rightarrow 0} \frac{\cancel{3x^2} + 6hx + 3h^2 + h - \cancel{3x^2}}{h} \\ &= \lim_{h \rightarrow 0} \frac{\cancel{h}(6x + 3h + 1)}{\cancel{h}} \\ &= \lim_{h \rightarrow 0} (6x + 3h + 1) \\ &= 6x + 3(0) + 1 \\ \frac{\text{d}y}{\text{d}x} &= 6x + 1 \\ \implies \left.\frac{\text{d}y}{\text{d}x} \right|_{x=5} &= 6(5) + 1 \\ \left.\frac{\text{d}y}{\text{d}x}\right|_{x=5} &= 31 \\ \text{Q.E.D.} \end{align*} $$
Example 4: If $y = \sqrt{x}$, find $\displaystyle \frac{\text{d}y}{\text{d}x}$.
Recall $$ \begin{align*} \frac{\text{d}y}{\text{d}x} &= \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h} \\ \frac{\text{d}y}{\text{d}x} &= \lim_{h \rightarrow 0} \frac{\sqrt{x+h} - \sqrt{x}}{h} \\ &= \lim_{h \rightarrow 0} \frac{(\sqrt{x+h} - \sqrt{x})(\sqrt{x+h} + \sqrt{x})}{h(\sqrt{x+h} + \sqrt{x})} \text{ (Rationalizing the numerator)} \\ &= \lim_{h \rightarrow 0} \frac{\cancel{x} + h \cancel{- x}}{h(\sqrt{x+h} + \sqrt{x})} \\ &= \lim_{h \rightarrow 0} \frac{\cancel{h}}{\cancel{h}(\sqrt{x+h} + \sqrt{x})} \\ &= \lim_{h \rightarrow 0} \frac{1}{\sqrt{x+h} + \sqrt{x}} \\ &= \frac{1}{\sqrt{x+0} + \sqrt{x}} \\ \frac{\text{d}y}{\text{d}x} &= \frac{1}{2\sqrt{x}} \end{align*} $$
Exercise 1: Differentiate the following functions from first principles.
- $f(x) = \sqrt{3x}$ (Answer: $\displaystyle \frac{3}{2\sqrt{3x}}$)
- $f(x) = \tan{2x}$ (Answer: $2\sec^2{2x}$)
- $f(x) = \cos{(-x)}$ (Answer: $-\sin{x}$)
- $\displaystyle f(x) = 2x^2 - \frac{1}{x}$ (Answer: $\displaystyle 4x + \frac{1}{x^2}$)
- $f(x) = \ln{(5\pi - \sqrt{3})}$ (Answer: $0$)
- $f(x) = \sec{x}$ (Answer: $\sec{x}\tan{x}$)
Exercise 2: Bonus Questions
- Prove that for a differentiable function $f(x)$ and an arbitrary constant $k$, $\displaystyle \frac{\text{d}}{\text{d}x}[kf(x)] = k\frac{\text{d}}{\text{d}x}[f(x)]$.
- Prove that for any two differentiable functions $f(x)$ and $g(x)$, $\displaystyle \frac{\text{d}}{\text{d}x}[f(x) \pm g(x)] = f'(x) \pm g'(x)$.
- Based on the derivatives you calculated in Exercise 1, do you think you can find a general formula for $\displaystyle \frac{\text{d}}{\text{d}x}(x^n)$ where $n$ is a constant?
- Why is the derivative of any constant function always equal to $0$?
- Given that $f(x) = |x|$ where $\displaystyle |x| = \begin{cases} x\text{, if }x \geq 0 \\ -x\text{, if }x < 0 \end{cases}$, explain why $f'(0)$ is undefined. (Hint: Consider what makes a function differentiable to begin with.)