10.1 Definition of the derivative

For a single-variable function, e.g. f(x)f(x), the derivative tells us the "gradient" at any given point on a function. It can also be thought of as a ratio which specifies how much the value of f(x)f(x) changes when we change xx.

Another way to think about the gradient is to think about the slope that the tangent 11 1 A tangent to a curve is a straight line which touches the curve at only a single point. to the curve at a given point would have. This is the same as the gradient at that point.

For example, in the curve below, the straight line (in grey) is a tangent to the curve at the point x=1x=1.

00.50.5111.51.5228-86-64-42-2022xxyyx2+3x8x^{2}+3x-8

The derivative gives us a formula for the gradient of a tangent to the curve at any point on the curve 22 2 Technically, the derivative of some functions are not defined for the whole function, but that’s not relevant here.. It initially looks difficult to compute this. A good approach is to attempt to approximate this.

First, let’s think about what we’re trying to find. The gradient of a straight line which goes through the points (x1,y1)(x_{1},y_{1}) and (x2,y2)(x_{2},y_{2}) is given by the formula below. 33 3 This is explained further up in the document. TODO: actually explain this

m\displaystyle m =ΔyΔx\displaystyle=\frac{\Delta y}{\Delta x} (10.1)
=y2y1x2x1\displaystyle=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} (10.2)

Because we don’t know how to find the gradient at one point on the curve, a good way to approximate this is to find the gradient of the curve using points which are close to each other.

Let’s pick some points and work out the corresponding gradients.

x1x_{1} f(x1)f(x_{1}) x2x_{2} f(x2)f(x_{2}) hh gradient
1 -4 1.1 -3.49 0.1 5.1
1 -4 1.01 -3.9499 0.01 5.01
1 -4 1.001 -3.994999 0.001 5.001
1 -4 1.0001 -3.9995 0.0001 5.0001
1 -4 1.00001 -3.99995 1E-05 5.00001

As we pick values of x2x_{2} which are closer and closer to the point x=1x=1 at which we are trying to find the gradient, it is clear that the gradient gets closer and closer to 55. The lines we draw (if you sketch them) 44 4 Or, if you look at these diagrams. also become closer and closer to the tangent line.

This is how we compute derivatives, but before we can do that, we need to introduce some new mathematics, called the "limit." The idea of a limit is that it gives us the value of a function, as the independent variable approaches a given value.

For example,

limx33x=9\lim_{x\to 3}3x=9 (10.3)

Which means that as we get close to x=3x=3 (but not necessarily, at x=3x=3) the value of the function tends to 99. Limits are most useful for functions where we don’t know the value at a given point, but we do know the values around that point. For example, suppose we had a function f(x)=3xf(x)=3x, except at x=3x=3 where it was undefined. In that case f(3)f(3) is undefined, but limx3f(x)=3\lim_{x\to 3}f(x)=3.

The derivative of a function f(x)f(x), is defined as a limit.

limh0f(x+h)f(x)h\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} (10.4)

Let’s work out the derivative of f(x)=x2+3x8f(x)=x^{2}+3x-8 at any point on the curve.

limh0f(x+h)f(x)h\displaystyle\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} =limh0((x+h)2+3(x+h)8)(x2+3x8)h\displaystyle=\lim_{h\to 0}\frac{((x+h)^{2}+3(x+h)-8)-(x^{2}+3x-8)}{h} (10.5)
=limh0x2+2hx+h2+3x+3h8x23x+8h\displaystyle=\lim_{h\to 0}\frac{x^{2}+2hx+h^{2}+3x+3h-8-x^{2}-3x+8}{h} (10.6)
=limh02hx+h2+3hh\displaystyle=\lim_{h\to 0}\frac{2hx+h^{2}+3h}{h} (10.7)
=limh02x+h+3\displaystyle=\lim_{h\to 0}2x+h+3 (10.8)
=2x+3\displaystyle=2x+3 (10.9)

This gives us a formula for the gradient anywhere on this polynomial!

We can write the derivative in a number of ways. The best55 5 Fight me. is

dydx\frac{dy}{dx}

Where "dydy" means a really small change in yy (or an infinitesimal of yy), and "dxdx" means (you guessed it) a really small change in xx (or an infinitesimal of xx).

Note that the variables don’t have to be yy and xx! They could be any function and its dependent variable, for example if we had a function q(o)=o2+24o100q(o)=o^{2}+24o-100 we could write its derivative in either of the forms below. Note that the second form is a handy way for denoting the derivative of an expression.

dq(o)do=ddo[o2+24o100]\frac{dq(o)}{do}=\frac{d}{do}[o^{2}+24o-100] (10.10)

There are also a bunch of other ways which are usually worse, but are still used (usually for brevity, because they’re much shorter than writing out dydx\frac{dy}{dx} every time).

y˙ or y or y(x)\dot{y}\text{ or }y^{\prime}\text{ or }y^{\prime}(x)

Again, the function could be called something other than y(x)y(x). For example in the case of q(o)q(o) we’d write

(˙q) or q or q(x)\dot{(}q)\text{ or }q^{\prime}\text{ or }q^{\prime}(x)