### 4 Differentiation of a general function from first principles

Consider the graph of $y=f\left(x\right)$ shown in Figure 7.

Figure 7 :

Carefully make the following observations:

1. Point $A$ has coordinates $\left(x,f\left(x\right)\right)$ .
2. Point $B$ has coordinates $\left(x+h,f\left(x+h\right)\right)$ .
3. The straight line $AB$ has gradient
$\frac{f\left(x+h\right)-f\left(x\right)}{h}$
4. If we let $h\to 0$ we can find the gradient of the graph of $y=f\left(x\right)$ at the arbitrary

point $A$ , provided we can evaluate the appropriate limit on $h$ . The resulting limit is the

derivative of $f$ with respect to $x$ and is written $\frac{df}{dx}$ or ${f}^{\prime }\left(x\right)$ .

##### Key Point 3

Definition of Derivative

Given $y=f\left(x\right)$ , its derivative is defined as

This is written
$\frac{df}{dx}=\underset{h\to 0}{lim}\frac{f\left(x+h\right)-f\left(x\right)}{h}$

In a graphical context, the value of $\frac{df}{dx}$ at $A$ is equal to $tan\theta$ which is the tangent of the angle that the gradient line makes with the positive $x$ -axis.

##### Example 1

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

##### Solution

$\phantom{\rule{2em}{0ex}}\frac{df}{dx}=\underset{h\to 0}{lim}\left\{\frac{f\left(x+h\right)-f\left(x\right)}{h}\right\}$

$\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}=\underset{h\to 0}{lim}\left\{\frac{\left[{\left(x+h\right)}^{2}+2\left(x+h\right)+3\right]-\left[{x}^{2}+2x+3\right]}{h}\right\}$

$\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}=\underset{h\to 0}{lim}\left\{\frac{\left[{x}^{2}+2xh+{h}^{2}+2x+2h+3-{x}^{2}-2x-3\right]}{h}\right\}$

$\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}=\underset{h\to 0}{lim}\left\{\frac{2xh+{h}^{2}+2h}{h}\right\}$

$\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}=\underset{h\to 0}{lim}\left\{2x+h+2\right\}$

$\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}=2x+2$

##### Exercises
1. Use the definition of the derivative to find $\frac{df}{dx}$ when
1. $f\left(x\right)=4{x}^{2}$ ,
2. $f\left(x\right)=2{x}^{3}$ ,
3. $f\left(x\right)=7x+3$ ,
4. $f\left(x\right)=\frac{1}{x}$ . (Harder: try
5. $f\left(x\right)=sinx$ and use the small angle approximation $sin\theta \approx \theta$ if $\theta$ is small and measured in radians.)
2. Using your results from Exercise 1 calculate the gradient of the following graphs at the given points:
1. $f\left(x\right)=4{x}^{2}$ at $x=-2$ ,
2. $f\left(x\right)=2{x}^{3}$ at $x=2$ ,
3. $f\left(x\right)=7x+3$ at $x=-5$ ,

4. $f\left(x\right)=\frac{1}{x}$ at $x=1∕2$ .
3. Find the rate of change of the function $y\left(x\right)=\frac{x}{x+3}$ at $x=3$ by considering the interval

$x=3$ to $x=3+h$ .

1. $8x$ ,
2. $6{x}^{2}$ ,
3. $7$ ,
4. $-1∕{x}^{2}$ ,
5. $cosx$ .
1. $-16$ ,
2. 24,
3. 7,
4. $-4$
1. $1∕12$