Toggle Main Menu Toggle Search

Differentiation from First Principles


Given a function $y=f(x)$ its first derivative – the rate of change of $y$ with respect to $x$ – is defined by:

\[\frac{\mathrm{d} y}{\mathrm{d} x}=\lim_{\large{h\to0} }\left[\frac{f(x+h)-f(x)}{h}\right].\]

Finding the derivative of a function by computing this limit is known as differentiation from first principles.

Example 1

Differentiate $y=\sin{x}$ from first principles.


Recall that the first derivative of a function $y=f(x)$ is given by:

\[\dfrac{\mathrm{d} y}{\mathrm{d} x}=\lim_{\large{h \to 0} }\Biggl[\dfrac{f(x+h)-f(x)}{h}\Biggl].\]

Here $f(x)=\sin{x}$, so $f(x+h)=\sin{(x+h)}$ and:

\[\dfrac{f(x+h)-f(x)}{h}=\dfrac{\sin{(x+h)}-\sin{x} }{h}.\]

Recall the trigonometric identity $\sin{A}-\sin{B}=2\cos{\left(\dfrac{A+B}{2}\right)}\sin{\left(\dfrac{A-B}{2}\right)}$.

Setting $A=x+h$ and $B=x$ gives:

\begin{align} \sin{(x+h)}-\sin{x} &=2 \cos{\left(\dfrac{x+h+x}{2}\right)}\sin{\left(\dfrac{x+h-x}{2}\right)} \\ &=2\cos{\left(x+\dfrac{h}{2}\right)}\sin{\left(\dfrac{h}{2}\right)}. \end{align}

Substituting this back into the numerator gives:

\[\dfrac{f(x+h)-f(x)}{h}=\dfrac{2\cos{\left(x+\frac{h}{2}\right)}\sin{\left(\frac{h}{2}\right)} }{h}.\]

This can be expressed in a more convenient form by dividing both numerator and denominator by $2$:

\begin{align} \dfrac{f(x+h)-f(x)}{h} &=\dfrac{\cos{\left(x+\frac{h}{2}\right)}\sin{\left(\frac{h}{2}\right)} }{\frac{h}{2} } \\ &= \cos{\left(x+\frac{h}{2}\right)}\dfrac{\sin{\left(\frac{h}{2}\right)} }{\frac{h}{2} } \end{align}

The derivative of $\sin{x}$ is the limit of this function as $h\to0$.

By the properties of limits, \[\lim_{\large{x\to a} }\left[f(x)\cdot g(x)\right]=\lim_{\large{x\to a} }\left[f(x)\right]\lim_{\large{x\to a} }\left[g(x)\right],\] so the limits of the $\sin$ and $\cos$ terms can be considered separately.

The limit of the $\cos$ term can be found immediately:

\[\lim_{\large{h\to0} }\left[\cos{\left(x+\dfrac{h}{2}\right)}\right]=\cos{x}.\]

To evaluate the limit of the $\sin$ term, first note that $\sin{\theta}\approx\theta$ for $\theta\ll1$, that is, $\sin \theta$ is approximately equal to $\theta$ when $\theta$ is very small. Hence the limit of $\frac{\sin{\theta} }{\theta}$ is:

\[\lim_{\large{\theta\to0} }\left[\dfrac{\sin{\theta} }{\theta}\right]=1.\]

The limit of the $\sin$ term is therefore:

\[\lim_{\large{h\to0} }\left[\dfrac{\sin{\frac{h}{2} } }{\frac{h}{2} }\right]=1.\]

Finally, the derivative $\dfrac{\mathrm{d} y}{\mathrm{d} x}$ of $\sin{x}$ is the product of these two limits:

\begin{align} \dfrac{\mathrm{d} y}{\mathrm{d} x} &= \lim_{\large{h\to0} }\left[\cos{\left(x+\dfrac{h}{2}\right)}\right]\lim_{\large{h\to0} }\left[\dfrac{\sin{\frac{h}{2} } }{\frac{h}{2} }\right] \\ &=1\cdot\cos{x}\\ &=\cos{x}. \end{align}

Video Examples

Example 1

Prof. Robin Johnson differentiates $y=x^3$ from first principles.

Example 2

Prof. Robin Johnson differentiates $y=\sqrt{x}$ from first principles.


This workbook produced by HELM is a good revision aid, containing key points for revision and many worked examples.

External Resources

Whiteboard maths

More Support

You can get one-to-one support from Maths-Aid.