topic badge

8.03 Differentiation from first principles

Lesson

We now want to combine what we know about average and instantaneous rates of change with the use of limits, to be able to calculate the instantaneous rate of change at a point and the derivative - a function giving us the gradient of the tangent at any point on the graph. Previously we estimated the gradient of the tangent at point by calculating the gradient of the secant through the point and another point close by. The idea behind calculus it taking the limit as the second point becomes closer and closer to the point of interest.

Let's review the concepts so far. The average rate of change between $x=a$x=a and $x=b$x=b is the gradient of the secant through these points as shown below:

$\text{Average rate of change}=\frac{f\left(b\right)-f\left(a\right)}{b-a}$Average rate of change=f(b)f(a)ba

The instantaneous rate of change can be estimated by bringing the second point in closer to $A$A. The diagram below shows the tangent at point $A$A and three secants at progressively closer points $B$B. We can see the secants become a closer estimate for the tangent at $A$A as $B$B draws closer.

So to estimate the gradient of the tangent at $A$A, where $x=a$x=a, we make a second point $B$B close to this - say at $x=a+h$x=a+h where $h$h is small so the estimate is close. The smaller we make $h$h the closer the secant through $A$A and $B$B comes to matching the tangent at $A$A.

In the applet below you can visualise this by making $h$h close to zero and seeing how close the secant approximates the tangent.

We can see in the applet above that the gradient of the secant through $A$A and $B$B is given by:

$\text{Gradient of secant}$Gradient of secant $=$= $\frac{y_2-y_1}{x_2-x_1}$y2y1x2x1
  $=$= $\frac{f(a+h)-f(a)}{h}$f(a+h)f(a)h

To obtain the gradient of the tangent we require $h$h to approach zero. The secant does not exist at $h=0$h=0, when the two points lie on top of each other, as the gradient is not defined. However, if we use limits we can find the value that the gradient of the secant is approaching.

Hence, the gradient of the tangent to $f(x)$f(x) at $x=a$x=a, denoted $f'(a)$f(a) is given by:

$f'(a)=\lim_{h\rightarrow0}\frac{f\left(a+h\right)-f(a)}{h}$f(a)=limh0f(a+h)f(a)h

Using this formula to find or evaluate a derivative is called differentiation by first principles. There are many patterns and rules that allow us to find derivatives but using this limit is finding the gradient using the fundamental definition and hence, called from first principles. Let's see how this works in practice.

Worked example

Example 1

Find the gradient of the tangent to $f(x)=x^2+5$f(x)=x2+5 at $x=3$x=3.

Think: We are looking for $f'(a)$f(a) from our formula above with $a=3$a=3. Using first principles we require $f\left(3\right)$f(3)and $f\left(3+h\right)$f(3+h), it can be a good idea to find these first and simplify if possible before substituting into the formula.

Do: For $f(x)=x^2+5$f(x)=x2+5

$f(3)$f(3) $=$= $3^2+5$32+5             $f(3+h)$f(3+h) $=$= $(3+h)^2+5$(3+h)2+5
  $=$= $14$14     $=$= $9+6h+h^2+5$9+6h+h2+5
          $=$= $14+6h+h^2$14+6h+h2
Hence, $f'(3)$f(3) $=$= $\lim_{h\rightarrow0}\frac{f\left(3+h\right)-f(3)}{h}$limh0f(3+h)f(3)h  
  $=$= $\lim_{h\rightarrow0}\frac{14+6h+h^2-14}{h}$limh014+6h+h214h Substitute the expressions found above
  $=$= $\lim_{h\rightarrow0}\frac{6h+h^2}{h}$limh06h+h2h Simplify the numerator
  $=$= $\lim_{h\rightarrow0}\frac{h\left(6+h\right)}{h}$limh0h(6+h)h Factorise the numerator
  $=$= $\lim_{h\rightarrow0}\left(6+h\right)$limh0(6+h) Divide top and bottom by $h$h, to reveal the behaviour of the expression when $h\ne0$h0
  $=$= $6$6 Take the limit by substituting in $h=0$h=0

Hence, the gradient of the tangent to $f(x)=x^2+5$f(x)=x2+5 at $x=3$x=3 is $6$6.

Notice:

  • The limit expression needs to remain until the final step of taking the limit by substituting in $h=0$h=0.
  • To be able to substitute in $h=0$h=0 in our last step we must remove the $h$h from the denominator - so after simplifying the numerator you should always be able take out a factor $h$h for any function you are expected to use this technique for.

 

Finding the derivative by first principles

In our previous example we found the gradient of the tangent at a particular point. If we were to do this for many points on the same function we may notice they follow a pattern. 

For example, the table below shows the gradient of the tangent at several points for the function $f(x)=x^2+5$f(x)=x2+5:

$x$x $1$1 $2$2 $3$3 $4$4 $5$5
$f'(x)$f(x) $2$2 $4$4 $6$6 $8$8 $10$10

From this table we could make the conjecture that $f'(x)=2x$f(x)=2x, that is the gradient of the tangent at any point is double the value of the $x$x-coordinate. However, how can we be sure? How can we prove that the derivative is indeed $f'(x)=2x$f(x)=2x.

We can again use first principles but rather than a set point $x=a$x=a, use a general point $x$x.

Differentiation by first principles

For a function $f(x)$f(x), the derivative (or gradient function) is given by:

$f'(x)=\lim_{h\rightarrow0}\frac{f\left(x+h\right)-f(x)}{h}$f(x)=limh0f(x+h)f(x)h 

Did you know?

Recall from the investigation on notation, that an alternate and commonly used notation for the derivative is Leibniz's notation of $\frac{dy}{dx}$dydx. And that the Greek letter delta is used to symbolise "change in". Thus, we can also describe average rates of change and the instantaneous rate of change using this alternate notation. For a function $y=f(x)$y=f(x), we have:

Average rate of change - gradient of secant

$\text{Gradient between two points}$Gradient between two points $=$= $\frac{\Delta y}{\Delta x}$ΔyΔx
  $=$= $\frac{f\left(x+\Delta x\right)-f(x)}{\Delta x}$f(x+Δx)f(x)Δx

Instantaneous rate of change - gradient of tangent

$\frac{dy}{dx}$dydx $=$= $\lim_{\Delta x\rightarrow0}\frac{\Delta y}{\Delta x}$limΔx0ΔyΔx
  $=$= $\lim_{\Delta x\rightarrow0}\frac{f\left(x+\Delta x\right)-f(x)}{\Delta x}$limΔx0f(x+Δx)f(x)Δx


This can be written with upper case delta $\Delta$Δ or lower case $\delta$δ (meaning small change in). We can see this notation replaces $h$h with the term $\Delta x$Δx denoting the change in $x$x.

 

Worked examples

Example 2

Using first principles show that the derivative of $f(x)=x^2+5$f(x)=x2+5 is $f'(x)=2x$f(x)=2x. And hence, find the gradient of the tangent at $x=10$x=10.

Think: Using first principles we require $f\left(x\right)$f(x) and $f\left(x+h\right)$f(x+h), let's state these first and simplify if possible before substituting into the formula.

Do: We have $f(x)=x^2+5$f(x)=x2+5 and

$f(x+h)$f(x+h) $=$= $(x+h)^2+5$(x+h)2+5
  $=$= $x^2+2xh+h^2+5$x2+2xh+h2+5
  $=$= $14+6h+h^2$14+6h+h2
Hence, $f'(x)$f(x) $=$= $\lim_{h\rightarrow0}\frac{f\left(x+h\right)-f(x)}{h}$limh0f(x+h)f(x)h  
  $=$= $\lim_{h\rightarrow0}\frac{x^2+2xh+h^2+5-\left(x^2+5\right)}{h}$limh0x2+2xh+h2+5(x2+5)h Substitute the expressions found above
  $=$= $\lim_{h\rightarrow0}\frac{2xh+h^2}{h}$limh02xh+h2h Simplify the numerator, careful to subtract all terms in the bracket
  $=$= $\lim_{h\rightarrow0}\frac{h\left(2x+h\right)}{h}$limh0h(2x+h)h Factorise the numerator
  $=$= $\lim_{h\rightarrow0}\left(2x+h\right)$limh0(2x+h) Divide top and bottom by $h$h
  $=$= $2x$2x Take the limit by substituting in $h=0$h=0

Hence, the derivative of $f(x)=x^2+5$f(x)=x2+5 is $f'(x)=2x$f(x)=2x.

We can now find the gradient of the tangent at any value of $x$x by substituting into this rule. So the gradient of the tangent at $x=10$x=10 is:

$f'(10)$f(10) $=$= $2\times10$2×10
  $=$= $20$20
Example 3

Differentiate $f(x)=3x^2+4x-5$f(x)=3x2+4x5.

Think: Using first principles we require $f\left(x\right)$f(x)and $f\left(x+h\right)$f(x+h), let's find these first and simplify if possible before substituting into the formula.

Do: We have $f(x)=3x^2+4x-5$f(x)=3x2+4x5 and

$f(x+h)$f(x+h) $=$= $3(x+h)^2+4(x+h)-5$3(x+h)2+4(x+h)5
  $=$= $3(x^2+2xh+h^2)+4x+4h-5$3(x2+2xh+h2)+4x+4h5
  $=$= $3x^2+6xh+3h^2+4x+4h-5$3x2+6xh+3h2+4x+4h5
Hence, $f'(x)$f(x) $=$= $\lim_{h\rightarrow0}\frac{f\left(x+h\right)-f(x)}{h}$limh0f(x+h)f(x)h  
  $=$= $\lim_{h\rightarrow0}\frac{\left[3x^2+6xh+3h^2+4x+4h-5\right]-\left[3x^2+4x-5\right]}{h}$limh0[3x2+6xh+3h2+4x+4h5][3x2+4x5]h Substitute the expressions found above
  $=$= $\lim_{h\rightarrow0}\frac{6xh+3h^2+4h}{h}$limh06xh+3h2+4hh Simplify the numerator
  $=$= $\lim_{h\rightarrow0}\frac{h\left(6x+3h+4\right)}{h}$limh0h(6x+3h+4)h Factorise the numerator
  $=$= $\lim_{h\rightarrow0}\left(6x+3h+4\right)$limh0(6x+3h+4) Divide top and bottom by $h$h
  $=$= $6x+4$6x+4 Take the limit by substituting in $h=0$h=0

Hence, the gradient function of $f(x)=3x^2+4x-5$f(x)=3x2+4x5 is $f'(x)=6x+4$f(x)=6x+4.

Practice questions

Question 1

Consider the function $f\left(x\right)=-5x+4$f(x)=5x+4.

  1. Find $f\left(x+h\right)$f(x+h).

  2. Find $f\left(x+h\right)-f\left(x\right)$f(x+h)f(x).

  3. Find $\frac{f\left(x+h\right)-f\left(x\right)}{h}$f(x+h)f(x)h.

Question 2

We want to find the derivative of $f\left(x\right)=-6x^2$f(x)=6x2 from first principles.

  1. Find $f\left(x+h\right)$f(x+h) in expanded form.

  2. Find $f\left(x+h\right)-f\left(x\right)$f(x+h)f(x).

  3. Find $\frac{f\left(x+h\right)-f\left(x\right)}{h}$f(x+h)f(x)h.

  4. Hence find $f'\left(x\right)$f(x) by evaluating $\lim_{h\to0}\left(\frac{f\left(x+h\right)-f\left(x\right)}{h}\right)$limh0(f(x+h)f(x)h).

Question 3

Consider the function $f\left(x\right)=\left(x+6\right)\left(x+2\right)$f(x)=(x+6)(x+2).

  1. Determine the gradient function of $f\left(x\right)=\left(x+6\right)\left(x+2\right)$f(x)=(x+6)(x+2) from first principles.

    Show all steps of working.

  2. Determine the gradient at the point where $x=3$x=3.

Outcomes

2.4.1.1

explore average and instantaneous rate of change in a variety of practical contexts

2.4.1.2

use a numerical technique to estimate a limit or an average rate of change

2.4.1.3

examine the behaviour of the difference quotient [𝑓(𝑥+ℎ)−𝑓(𝑥)]/h ℎ as ℎ→0 as an informal introduction to the concept of a limit

2.4.1.4

differentiate simple power functions and polynomial functions from first principles

2.4.1.5

interpret the derivative as the instantaneous rate of change

2.4.1.6

interpret the derivative as the gradient of a tangent line of the graph of 𝑦=𝑓(𝑥)

What is Mathspace

About Mathspace