## Differentiation From First Principles

We know that the gradient of the tangent to a curve with equation \(y = f(x)\) at \(x=a\) can be determine using the formula:

We can use this formula to determine an expression that describes the gradient of the graph (or the gradient of the tangent to the graph) at any point on the graph. This expression (or gradient function) is called the derivative.

### Definition: Derivative

The derivative of a function \(f(x)\) is written as \({f}'(x)\) and is defined by:

\[{f}'(x)=\lim_{h\to 0}\cfrac{f(x+h)-f(x)}{h}\]

### Definition: Differentiation

The process of determining the derivative of a given function.

This method is called differentiation from first principles or using the definition.

## Example

### Question

Calculate the derivative of \(g(x)=2x-3\) from first principles.

### Write down the formula for finding the derivative using first principles

\[{g}'(x)=\lim_{h\to 0}\cfrac{g(x+h)-g(x)}{h}\]

### Determine \(g(x+h)\)

\begin{align*} g(x) &= 2x – 3 \\ & \\ g(x+h) &= 2(x+h) – 3 \\ &= 2x + 2h – 3 \end{align*}

### Substitute into the formula and simplify

\begin{align*} {g}'(x) & = \lim_{h\to 0}\cfrac{2x + 2h – 3 -(2x – 3)}{h} \\ & = \lim_{h\to 0}\cfrac{2h}{h} \\ & = \lim_{h\to 0} 2 \\ & = 2 \end{align*}

### Write the final answer

The derivative \({g}'(x) = 2\).

**Notation**

There are a few different notations used to refer to derivatives. It is very important that you learn to identify these different ways of denoting the derivative and that you are consistent in your usage of them when answering questions.

If we use the common notation \(y=f(x)\), where the dependent variable is \(y\) and the independent variable is \(x\), then some alternative notations for the derivative are as follows:

\[{f}'(x)={y}’=\cfrac{dy}{dx}=\cfrac{df}{dx}=\cfrac{d}{dx}[f(x)]=Df(x)={D}_{x}y\]

The symbols \(D\) and \(\cfrac{d}{dx}\) are called differential operators because they indicate the operation of differentiation.

\(\cfrac{dy}{dx}\) means \(y\) differentiated with respect to \(x\). Similarly, \(\cfrac{dp}{dx}\) means \(p\) differentiated with respect to \(x\).

**Important:** \(\cfrac{dy}{dx}\) is not a fraction and does not mean \(dy \div dx\).

## Example

### Question

- Find the derivative of \(f(x)=4x^{3}\) from first principles.
- Determine \({f}’ (\text{0.5})\) and interpret the answer.

### Write down the formula for finding the derivative from first principles

\[{f}'(x)=\lim_{h\to 0}\cfrac{f(x+h)-f(x)}{h}\]

### Substitute into the formula and simplify

\begin{align*} {f}'(x) & = \lim_{h\to 0}\cfrac{4(x + h)^{3} – 4x^{3}}{h} \\ & = \lim_{h\to 0}\cfrac{4(x^{3} + 3x^{2}h + 3xh^{2} + h^{3}) – 4x^{3}}{h} \\ & = \lim_{h\to 0}\cfrac{4x^{3} + 12x^{2}h + 12xh^{2} + 4h^{3} – 4x^{3}}{h} \\ & = \lim_{h\to 0}\cfrac{12x^{2}h + 12xh^{2} + 4h^{3}}{h} \\ & = \lim_{h\to 0}\cfrac{h (12x^{2} + 12xh + 4h^{2} )}{h} \\ & = \lim_{h\to 0} (12x^{2} + 12xh + 4h^{2}) \\ & = 12x^{2} \end{align*}

### Calculate \({f}’ (\text{0.5})\) and interpret the answer

\begin{align*} {f}'(x) & = 12x^{2} \\ \therefore {f}'(\text{0.5}) & = 12(\text{0.5})^{2} \\ &= 12( \cfrac{1}{4} ) \\ &= 3 \end{align*}

- The derivative of \(f(x)\) at \(x = \text{0.5}\) is \(\text{3}\).
- The gradient of the function \(f\) at \(x = \text{0.5}\) is equal to \(\text{3}\).
- The gradient of the tangent to \(f(x)\) at \(x = \text{0.5}\) is equal to \(\text{3}\).

## Example

### Question

Calculate \(\cfrac{dp}{dx}\) from first principles if \(p(x)= – \cfrac{2}{x}\).

### Write down the formula for finding the derivative using first principles

\[\cfrac{dp}{dx} =\lim_{h\to 0}\cfrac{p(x+h)-p(x)}{h}\]

### Substitute into the formula and simplify

\begin{align*} \cfrac{dp}{dx} & = \lim_{h\to 0}\cfrac{-\cfrac{2}{x + h} -(- \cfrac{2}{x})}{h} \end{align*}

It is sometimes easier to write the right-hand side of the equation as:

\begin{align*} \cfrac{dp}{dx} & = \lim_{h\to 0}\cfrac{1}{h} \left(\cfrac{-2}{x + h} + \cfrac{2}{x} ) \\ & = \lim_{h\to 0} \cfrac{1}{h} (\cfrac{-2x + 2(x + h)}{x(x + h)} ) \\ & = \lim_{h\to 0} \cfrac{1}{h} (\cfrac{-2x + 2x + 2h }{x(x + h)} ) \\ & = \lim_{h\to 0} \cfrac{1}{h} (\cfrac{2h }{x^{2} + xh} ) \\ & = \lim_{h\to 0} \cfrac{2}{x^{2} + xh} \\ & = \cfrac{2}{x^{2}} \end{align*}

Notice: even though \(h\) remains in the denominator, we can take the limit since it does not result in division by \(\text{0}\).

### Write the final answer

\[\cfrac{dp}{dx} = \cfrac{2}{x^{2}}\]

## Example

### Question

Differentiate \(g(x)= \cfrac{1}{4}\) from first principles and interpret the answer.

### Write down the formula for finding the derivative from first principles

\[{g}'(x)=\lim_{h\to 0}\cfrac{g(x+h)-g(x)}{h}\]

### Substitute into the formula and simplify

\begin{align*} {g}'(x) & = \lim_{h\to 0}\cfrac{ \cfrac{1}{4} – \cfrac{1}{4}}{h} \\ & = \lim_{h\to 0}\cfrac{0}{h} \\ & = \lim_{h\to 0} 0 \\ & = 0 \end{align*}

### Interpret the answer

The gradient of \(g(x)\) is equal to \(\text{0}\) at any point on the graph. The derivative of this constant function is equal to \(\text{0}\).