topic badge

8.03 Differentiation by first principles

Lesson

In the previous lesson, we looked at a geometric description of the derivative function $f'(x)$f(x). Now we will develop a method for algebraically finding the derivative function by connecting together existing concepts and skills. The algebraic representation of the gradient function provides us with a way to calculate the gradient at any point on a function.

We will also develop an understanding of what characteristics make a function differentiable.

Derivative notation

Before we do that though, some new notation needs to be introduced. Just as a function can be represented by $f(x),g(x),s(y)$f(x),g(x),s(y) and $y$y among countless other possibilities, so can the derivative function. We have learnt that the derivative function can be represented as $f'(x)$f(x) with the apostrophe denoting the derivative function.  The following table summarises the different notation used for the derivative function. Mathematical convention dictates that we use the same notation as we are provided in the problem being solved.

Function Derivative Function Comment
$f(x)$f(x) $f'(x)$f(x) Read as $f$f dash $x$x
$y$y $y'$y Read as $y$y dash
$y$y $\frac{dy}{dx}$dydx Read as $dy\ dx$dy dx and stands for the change in $y$y with respect to $x$x
$f(x)$f(x) $\frac{d(f(x))}{dx}$d(f(x))dx Read as $d\ f(x)\ dx$d f(x) dx and stands for the change in $f(x)$f(x) with respect to $x$x

Estimating gradient using a secant

We can use a secant to estimate the gradient at any point on a curve. The secant to a curve is defined as a line that intersects the curve at two points. In the applet below these points are denoted $A$A and $B$B. $B$B is $h$h units to the right of $A$A. Thus, $A$A is the point $(x,f(x))$(x,f(x)) and $B$B is the point $(x+h,f(x+h))$(x+h,f(x+h)).

We have a secant, but what we really want is a tangent at $A$A. If we move $B$B closer to $A$A we can see the secant becomes a closer estimate for 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
$\text{Gradient of secant}$Gradient of secant $=$= $\frac{f(x+h)-f(x)}{h}$f(x+h)f(x)h

The closer that $B$B moves to $A$A, the smaller the difference, $h$h. Of course $h$h can't actually be zero, because then we wouldn't have two points with which to find a gradient. But we can have $h$h approach zero, and use our understanding of limits from lesson $8.01$8.01, to calculate the gradient of a secant so infinitely small that we in fact have found the gradient at that point.

The process is called differentiation by first principles and results in the following formula:

Differentiation by first principles

Differentiation by first principles

 

 For a function $f(x)$f(x) , the derivative function can be found using: 

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

 

The following examples will demonstrate how to find the derivative function by first principles.

Worked examples

Example 1

For the function $f(x)=2x^2$f(x)=2x2

           a) Find $f(x+h)$f(x+h)

           b) Find $f(x+h)-f(x)$f(x+h)f(x)

           c) Find $\frac{f(x+h)-f(x)}{h}$f(x+h)f(x)h

           d) Hence find the derivative function $f'(x)$f(x)by evaluating$\lim_{h\rightarrow0}\frac{f\left(x+h\right)-f(x)}{h}$limh0f(x+h)f(x)h

Do: 

a) To find $f(x+h)$f(x+h):

Expand the perfect square and simplify:

$f(x+h)$f(x+h) $=$= $2(x+h)^2$2(x+h)2
$f(x+h)$f(x+h) $=$= $2(x^2+2xh+h^2)$2(x2+2xh+h2)
$f(x+h)$f(x+h) $=$= $2x^2+4xh+2h^2$2x2+4xh+2h2

b) To find $f(x+h)-f(x)$f(x+h)f(x):

$f(x+h)-f(x)$f(x+h)f(x) $=$= $2x^2+4xh+2h^2-2x^2$2x2+4xh+2h22x2
$f(x+h)-f(x)$f(x+h)f(x) $=$= $4xh+h^2$4xh+h2

c) To find $\frac{f(x+h)-f(x)}{h}$f(x+h)f(x)h:

Divide each term in the numerator by $h$h:

$\frac{f(x+h)-f(x)}{h}$f(x+h)f(x)h $=$= $\frac{4xh+h^2}{h}$4xh+h2h    
$\frac{f(x+h)-f(x)}{h}$f(x+h)f(x)h $=$= $4x+h$4x+h    

d) To find $f'(x)$f(x):

Evaluate the limit by substituting $0$0 in for $h$h:

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

Therefore, the gradient function $f'(x)=\ 4x$f(x)= 4x. This means that we can find the gradient of the tangent at any $x$x value for the original function $f(x)=2x^2$f(x)=2x2.

Example 2

Use first principles to find the gradient of $f(x)=x^2+5$f(x)=x2+5 at the point where $x=3$x=3.

Think: We are looking for $f'(x)$f(x) from our formula above with $x=3$x=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
  $=$= $14$14
$f(3+h)$f(3+h) $=$= $(3+h)^2+5$(3+h)2+5
  $=$= $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
      $=$= $6$6 Take the limit by substituting in $h=0$h=0

 

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

Functions and continuity

A function is only differentiable at points in its domain where it is considered smooth and continuous. A function is considered smooth if there are no sharp points within its domain. A function is considered continuous if there are no jumps, breaks or discontinuities within its domain. It is best to illustrate this with a few examples.

The parabola in the applet is considered smooth and continuous because we can always draw a tangent line at any point in its domain.

 

Functions that are not smooth form sharp points at one or more parts of the graph, where tangent lines can no longer be defined. For example, the function $f\left(x\right)=\left|x\right|$f(x)=|x| is continuous but clearly not smooth since the tangent line at the point $x=0$x=0 is undefined.

$f\left(x\right)=\left|x\right|$f(x)=|x| is not smooth

 

 

A hyperbola is considered discontinuous as it has a break between the two sections. Its is only differentiable across its domain, not at the point of discontinuity.

Careful!

If a function is smooth then it is continuous over its domain. However not all continuous functions are smooth.

 

Worked example

Example 3

Draw the graph of the following function and state whether it is continuous and smooth and hence state the domain over which it is differentiable.

   

$2$2


$x+2$x+2

when $x<0$x<0


when $x\ge0$x0

$f\left(x\right)$f(x) $=$=
 

Think: The graph of the function describes the pieces of two distinct lines. The function describes the line $y=x+2$y=x+2 but restricted to the domain $x\ge0$x0. The other describes the horizontal line $y=2$y=2 but restricted to the domain $x<0$x<0.

Do: Drawing each of the pieces, we get the following graph of $f\left(x\right)$f(x):

Graph of the function $y=f\left(x\right)$y=f(x)

 

Since the graph of the function has no 'jumps' in its domain, the function is continuous over its domain. However, the function is not smooth since it contains a sharp point at $x=0$x=0. Hence the function can be differentiated over the domain $(-\infty,0)\ \cup\ (0,\infty)$(,0)  (0,).

Practice questions

Question 1

Consider the graph of the function $f\left(x\right)=2x+5$f(x)=2x+5 shown below.

Loading Graph...

  1. Are there any points within its domain where the function is discontinuous?

    Yes

    A

    No

    B
  2. As such, is the function continuous over its domain?

    Yes

    A

    No

    B
  3. Is the function smooth?

    Yes

    A

    No

    B

Question 2

Consider the graph of the function $f\left(x\right)$f(x) $=$= $\frac{x^3-x}{x^2-1}$x3xx21 when $x\ne\pm1$x±1
$1$1 when $x=-1$x=1
$2$2 when $x=1$x=1

Loading Graph...

  1. Are there any points within its domain where the function is discontinuous?

    Yes

    A

    No

    B
  2. As such, is the function continuous over its domain?

    Yes

    A

    No

    B

Question 3

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

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

    Give your answer 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.

Question 4

Use first principles to find the gradient of $f\left(x\right)=3x^3$f(x)=3x3 at the point $\left(-4,-192\right)$(4,192).

That is, determine the limit $\lim_{h\to0}\left(\frac{3\left(-4+h\right)^3-3\left(-4\right)^3}{h}\right)$limh0(3(4+h)33(4)3h).

Show all steps of working.

 

Outcomes

MA11-1

uses algebraic and graphical techniques to solve, and where appropriate, compare alternative solutions to problems

MA11-5

interprets the meaning of the derivative, determines the derivative of functions and applies these to solve simple practical problems

What is Mathspace

About Mathspace