Title: Default for 11.1 Introducing Differentiation
Course: HELM Workbooks 2023-2024

Introduction

Differentiation is a technique which can be used for analysing the way in which functions change. In particular, it measures how rapidly a function is changing at any point. In engineering applications the function may, for example, represent the magnetic field strength of a motor, the voltage across a capacitor, the temperature of a chemical mix, and it is often important to know how quickly these quantities change.

In this Section we explain what is meant by the gradient of a curve and introduce differentiation as a method for finding the gradient at any point.

Drawing tangents

Look at the graph shown below on the left. \(A\) and \(B\) are two points on the graph, and they have been joined by a straight line. The straight line segment \(AB\) is known as a chord. We have lengthened the chord on both sides so that it extends beyond both \(A\) and \(B\).

[Image]

In the figure in the middle, we have moved point \(B\) nearer to point \(A\) before drawing the extended chord. Imagine what would happen if we continue moving \(B\) nearer and nearer to \(A\). You can do this for yourself by drawing a sketch of the graph and drawing additional points onto it. Eventually, when \(B\) coincides with \(A\), the extended chord is a straight line which just touches the curve at \(A\). This line is now called the tangent to the curve at \(A\), and is shown in the figure on the right.

If we know the position of two points on the line we can find the gradient of the straight line and can calculate the gradient of the tangent. We define the gradient of the curve at \(A\) to be the gradient of the tangent there. If this gradient is large at a particular point, the rate at which the function is changing is large too. If the gradient is small, the rate at which the function is changing is small. This is illustrated in the figure below. Because of this, the gradient at \(A\) is also known as the instantaneous rate of change of the curve at \(A\). Recall from your knowledge of the straight line, that if the line slopes upwards as we look from left to right, the gradient of the line is positive, whereas if the line slopes downwards, the gradient is negative.

[Image]

Key Point

The gradient of the curve at a point,\(P\) , is equal to \(\tan \theta \) where \(\theta\) is the angle the tangent line at \(P\) makes with the positive \(x\) axis.

[Image]

Exercise

Draw in, by eye, tangents to the curve shown below, at points \(A\) to \(E\). State whether each tangent has positive, negative or zero gradient.

[Image: Image of a random function with 5 points A-e, for which you need to draw the tangent.]

Select your response from the drop down lists.

1. Point \(A\) has gradient.
2. Point \(B\) has gradient.
3. Point \(C\) has gradient.
4. Point \(D\) has gradient.
5. Point \(E\) has gradient.
Feedback: [Image: Image of a random function with 5 points A-e, for which you need to draw the tangent.] 1. The tangent at \(A\) slopes downwards as we look at it from left to right, therefore the gradient is negative. 2. The tangent at \(B\) is horizontal, i.e. it slopes neither upwards nor downwards. Therefore the gradient is zero. 3. The tangent at \(C\) slopes upwards as we look at it from left to right, therefore the gradient is positive. 4. The tangent at \(D\) is horizontal, i.e. it slopes neither upwards nor downwards. Therefore the gradient is zero. 5. The tangent at \(E\) slopes downwards as we look at it from left to right, therefore the gradient is negative.

Finding the gradient at a specific point

Here, we shall consider a simple function to illustrate the calculation of a gradient. Look at the graph of the function \(y(x) = x^2\) shown in the figure below. Notice that the gradient of the graph changes as we move from point to point. In some places the gradient is positive; at others it is negative. The gradient is greater at some points than at others. In fact the gradient changes from point to point as we move along the curve.

[Image]

Inspect the graph carefully and make the following observations:

(a) \(A\) is the point with coordinates \( (1, 1)\).

(b) \(B\) is the point with coordinates \( (4, 16)\).

(c) We can calculate the gradient of the line \(AB\) from the formula \[ \text{gradient} = \dfrac{ \text{difference between } y \text{ coordinates}}{ \text{difference between } x \text{ coordinates}} \] Therefore the gradient of chord \(AB\) is equal to \( \dfrac{16 - 1}{4 - 1} = \dfrac{15}{3} = 5\). The gradient of \(AB\) is not the same as the gradient of the graph at \(A\) but we can regard it as an approximation, or estimate of the gradient at \(A\).

We now carry the last task further by introducing point \(D\) at \( (2, 4)\) and point \(E\) at \( (1.5, 2.25) \) as shown in the figure below. The gradient of \(AD\) is found to be \(3\) and the gradient of \(AE\) is \(2.5\).

[Image]

Observe that each time we carry out this procedure, and move the second point closer to \(A\), the gradient of the line drawn is getting closer and closer to the gradient of the tangent at \(A\). If we continue, the value we eventually obtain is the gradient of the tangent at \(A\) whose value is \(2\) as we will see shortly. This procedure illustrates how we define the gradient of the curve at \(A\).

Finding the gradient at a general point

We now carry out the previous procedure more mathematically. Consider the graph of \(y(x) = x^2\) in the Figure below. Let point \(A\) be any point with coordinates \( (a, a^2)\), and let point \(B\) be a second point with \(x\) coordinate \( (a + h)\).

[Image]

The \(y\) coordinate at \(A\) is \(a^2\), because \(A\) lies on the graph \(y = x^2\). Similarly the \(y\) coordinate at \(B\) is \( (a + h)^2\). Therefore the gradient of the chord \(AB\) is \[ \dfrac{ (a + h)^2 - a^2}{h} \]

This simplifies to \[ \dfrac{a^2 + 2ha + h^2 - a^2}{h} = \dfrac{2ha + h^2}{h} = \dfrac{h(2a + h)}{h} = 2a + h \]

This is the gradient of the line \(AB\). As we let \(B\) move closer to \(A\) the value of \(h\) gets smaller and smaller and eventually tends to zero. We write this as \( h \to 0\).

Now, as \(h \to 0\), the gradient of \(AB\) tends to \(2a\). Thus the gradient of the tangent to the curve at point \(A\) is \(2a\). Because \(A\) is an arbitrary point, this result gives us a formula for finding the gradient of the graph of \(y = x^2\) at any point: the gradient is simply twice the \(x\) coordinate there. For example when \(x = 3\) the gradient is \(2 \times 3\), that is \(6\), and when \(x = 1\) the gradient is \(2 \times 1\), that is \(2\) as we saw previously.

Continuing with the example \(y(x)=x^2\), rather than looking at one point at a time we can consider a general point whose coordinates are \((x,x^2)\), the work above shows that the gradient (of the tangent) is given by \(2x\).

The function, \(2x\) which gives the gradient of \(y = x^2\) is called the derivative of \(y\) with respect to \(x\). It has other names too including the rate of change of \(y\) with respect to \(x\).

A special notation is used to represent the derivative. It is not a particularly user-friendly notation but it is important to get used to it anyway. We write the derivative as \( \dfrac{dy}{dx} \), pronounced `dee \(y\) over dee \(x\)' or `dee \(y\) by dee \(x\)' or even `dee \(y\), dee \(x\)'. \( \dfrac{dy}{dx} \) is not a fraction - so you can't do things like cancel the \(d\)'s - just remember that it is the symbol or notation for the derivative. An alternative notation for the derivative is \(y'\).

Key Point

The derivative of \(y(x)\) is written \( \dfrac{dy}{dx} \) or \( y'(x)\) or simply \(y'\)

Exercise

1. Carry out the procedure above for the function \( y = [value]x^2 \):
(1) Let \(A\) be the point \( (a, [value]a^2)\).
(2) Let \(B\) be the point \( (a + h, [value](a + h)^2) \).
(3) Find the gradient of the line \(AB\).
(4) Let \(h \to 0\) to find the gradient of the curve at \(A\).
\( \dfrac{dy}{dx} \) =
2. Carry out the procedure above for the function \( y = x^[value] \):
(1) Let \(A\) be the point \( (a, a^[value])\).
(2) Let \(B\) be the point \( (a + h, (a + h)^[value]) \).
(3) Find the gradient of the line \(AB\).
(4) Let \(h \to 0\) to find the gradient of the curve at \(A\).
\( \dfrac{dy}{dx} \) =
Feedback: 1. The gradient of the line \(AB\) is \[ \dfrac{ [value](a + h)^2 - [value]a^2 }{h} = \dfrac{ [value](a^2 + 2ah + h^2) - [value]a^2}{h} = \dfrac{ [value](2ah + h^2)}{h} = [value]a + h \] Letting \( h \to 0 \) gives the gradient at \(A\) as \([value]a\). Thus \( \dfrac{dy}{dx} = [value] \) 2. The gradient of the line \(AB\) is \[ \dfrac{ (a + h)^[value] - a^[value] }{h} = \dfrac{ [value] - a^[value]}{h} = \dfrac{ [value] }{h} = [value] \] Letting \( h \to 0 \) gives the gradient at \(A\) as \([value]a^[value] \). Thus \( \dfrac{dy}{dx} = [value] \)

Differentiation of a general function from first principles

Consider the graph of \(y = f(x)\) shown in the Figure below.

[Image]

Carefully make the following observations:

(a) Point \(A\) has coordinates \( (x, f(x)) \).

(b) Point B has coordinates \( (x + h, f(x + h)) \).

(c) The straight line \(AB\) has gradient \[ \dfrac{f(x + h) - f(x)}{h} \]

(d) If we let \(h \to 0\) we can find the gradient of the graph of \(y = f(x)\) 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 \( \dfrac{df}{dx} \) or \(f'(x)\).

Key Point

Definition of Derivative

Given \(y = f(x)\), its derivative is defined as \[ \dfrac{df}{dx} = \dfrac{f(x + h) - f(x)}{h} \] in the limit as \(h\) tends to \(0\). This is written \[ \dfrac{df}{dx} = \lim_{h \to 0} \dfrac{f(x + h) - f(x)}{h} \] In a graphical context, the value of \( \dfrac{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

Differentiate \(f(x) = x^2 + 2x + 3\) from first principles.

Solution

\begin{align} \dfrac{df}{dx} &= \lim_{h \to 0} \left\{ \dfrac{f(x + h) - f(x)}{h} \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [(x + h)^2 + 2(x+h) + 3] - [x^2 + 2x + 3]}{h} \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ x^2 + 2xh + h^2 + 2x + 2h + 3 - x^2 - 2x -3}{h} \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ 2xh + h^2 + 2h}{h} \right\} \\ &= \lim_{h \to 0} \left\{ 2x + h + 2 \right\} \\ &= 2x + 2 \end{align}

Exercise

Use the definition of the derivative to find \( \dfrac{df}{dx}\) when:
1. \( f(x) = [value] \)
\( \dfrac{df}{dx} \) =
2. \( f(x) = [value] \)
\( \dfrac{df}{dx} \) =
3. \( f(x) = [value] \)
\( \dfrac{df}{dx} \) =
4. \( f(x) = \displaystyle [value] \)
\( \dfrac{df}{dx} \) =
5. \( f(x) = [value] \)
\( \dfrac{df}{dx} \) =
Use the small angle approximation \( \sin \theta \approx \theta \) if \(\theta\) is small and measured in radians.
Feedback: 1. We have \(\begin{align} \dfrac{df}{dx} &= \lim_{h \to 0} \left\{ \dfrac{ f(x+h) - f(x)}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] }{ h } \right\} \\ &= \lim_{h \to 0} \left\{ [value] \right\} \\ &= [value] \end{align}\) 2. We have \(\begin{align} \dfrac{df}{dx} &= \lim_{h \to 0} \left\{ \dfrac{ f(x+h) - f(x)}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] }{ h } \right\} \\ &= \lim_{h \to 0} \left\{ [value] \right\} \\ &= [value] \end{align}\) 3. We have \(\begin{align} \dfrac{df}{dx} &= \lim_{h \to 0} \left\{ \dfrac{ f(x+h) - f(x)}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] }{ h } \right\} \\ &= \lim_{h \to 0} \left\{ [value] \right\} \\ &= [value] \end{align}\) 4. We have \(\begin{align} \dfrac{df}{dx} &= \lim_{h \to 0} \left\{ \dfrac{ f(x+h) - f(x)}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ [value] \right\} \\ &= [value] \end{align}\) 5. We have \(\begin{align} \dfrac{df}{dx} &= \lim_{h \to 0} \left\{ \dfrac{ f(x+h) - f(x)}{ h } \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ [value] - [value]}{ h } \right\} \\ \end{align}\) We now use the trigonometric identity \[ \sin(A)−\sin(B)=2 \cos\left(\dfrac{A+B}{2}\right) \sin\left(\dfrac{A−B}{2}\right). \] On setting \(A = x+h\) and \(B=x\) we have \(\begin{align} \lim_{h \to 0} \left\{ \dfrac{ [value] - [value] }{ h } \right\} &= \lim_{h \to 0} \left\{ \dfrac{ 2 \cos \left( \dfrac{x + h + x}{2} \right) \sin \left( \dfrac{x + h - x}{2} \right) }{h} \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ 2 \cos \left( \dfrac{2x + h }{2} \right) \sin \left( \dfrac{h}{2} \right) }{h} \right\} \\ &= \lim_{h \to 0} \left\{ \dfrac{ 2 \cos \left( \dfrac{2x + h }{2} \right) \dfrac{h}{2} }{h} \right\} \end{align}\) by using the small angle approximation, \( \sin \left( \dfrac{h}{2} \right) \approx \dfrac{h}{2} \). Finally, \(\begin{align} \lim_{h \to 0} \left\{ \dfrac{ 2 \cos \left( \dfrac{2x + h }{2} \right) \dfrac{h}{2} }{h} \right\} &= \lim_{h \to 0} \left\{ \dfrac{ 2 \cos \left( \dfrac{2x + h }{2} \right) }{2} \right\} \\ &=\lim_{h \to 0} \left\{ \cos \left( \dfrac{2x + h }{2} \right) \right\} \\ &= \cos(x) \end{align}\)

Exercise

Find the gradient of the following graphs at the given points:
1. \( f(x) = [value] \) at \(x = [value]\)
gradient =
2. \( f(x) = [value] \) at \(x = [value]\)
gradient =
3. \( f(x) = [value] \) at \(x = [value]\)
gradient =
4. \( f(x) = \displaystyle [value] \) at \(x = [value]\)
gradient =
Feedback: 1. We have \[ \dfrac{df}{dx}= [value] \] which, when evaluated at \( x = [value] \) is \( [value]\) 2. We have \[ \dfrac{df}{dx} = [value] \] which, when evaluated at \( x = [value] \) is \( [value]\) 3. We have \[ \dfrac{df}{dx} = [value] \] which, when evaluated at \( x = [value] \) is \( [value]\) 4. We have \[ \dfrac{df}{dx} = [value] \] which, when evaluated at \( x = [value] \) is \( [value]\)

Exercise

Find the rate of change of the function \(y(x) = \dfrac{x}{x + [value]}\) at \(x = [value]\) by considering the interval \( x = [value]\) to \(x = [value] + h\). Enter your answer as a fraction.

Rate of change = (Your answer should be a rational number.)
Feedback: We have: \(\begin{align} y'([value]) &= \lim_{h \to 0} \left\{ \dfrac{1}{h} \left[ \dfrac{[value]+h}{[value] + h + [value]} - \dfrac{ [value]}{[value] + [value]} \right] \right\} \\ &=\lim_{h \to 0} \left\{ \dfrac{1}{h} \left[ \dfrac{[value]+h}{[value] + h} - \dfrac{ [value]}{[value]} \right] \right\} \\ &=\lim_{h \to 0} \left\{ \dfrac{1}{h} \left[ \dfrac{ [value]([value]+h) - ([value] + h)[value] }{[value]([value] + h)} \right] \right\} \\ &=\lim_{h \to 0} \left\{ \dfrac{1}{h} \left[ \dfrac{ [value]h }{[value]([value] + h)} \right] \right\} \\ &=\lim_{h \to 0} \left\{ \dfrac{ [value] }{[value]([value] + h)} \right\} \\ &= \dfrac{ [value] }{[value]([value])} \\ &= \dfrac{ 1 }{ [value] } \\ \end{align}\)