I haven't changed anything conceptually,

I've just written an x everywhere where we used to have a p.

And we can now of course also rewrite our Taylor series expression in this new

form with just x and delta x.

So we're in good shape to talk about approximations.

What I now want to know is, when I use the first order approximation,

instead of evaluating the base function, how big should I expect the error to be?

You can see, for example, that the gap between the white and

green lines grows as we move along the x-axis away from the point x.

Well, one way to think about it is that we know our function can be exactly

represented by this infinitely long series.

So although we won't be able to evaluate all of the terms,

we do know that the next term along, i.e. the first term that we ignore, when we're

using our first order of approximation, has a delta x squared in it.

This means that if we can say that delta x is a small number,

then delta x squared must be a really small number, and similarly,

delta x cubed must be a ridiculously small number.

So we can now rewrite our first order approximation to include an error term,

which we just say is on the order of delta x squared, or

equally that it is second order accurate.

This process of taking a function and ignoring the terms above delta x is

referred as linearisation and I hope it's now clear to you why that's the case.

We've taken some potentially very nasty function and

just approximated it with a straight line.

The last idea that I'm going to share with you in this video

is perhaps the most interesting, as it brings us right back to our

rise over run approximation that we met at the beginning of the course.

The green line is our first order, Taylor series approximation to the function

at the point x, which is of course also the tangent to the curve at x.

But let's now add another line which is the approximation to the gradient at x

using our rise over run method with a second point delta x away.

We use this forward different method to help us build

the definition of a derivative at the beginning of the course.

And we noticed that as delta x goes to 0, the approximation becomes exact.

However, what happens if delta x does not go to 0 and

the second point remains some finite distance away from x?

Well, your calculated gradient will now contain an error.

And once again, we can rearrange the full Taylor series to work out how big

we'd expect that error to be.

With a bit of slightly fiddly algebra, we can rearrange the expression such that

the gradient term f dash of x is isolated on the left-hand side.

Because this series is infinite, this is still an exact expression for

the gradient at x.

But what we get on the right-hand side is something that looks suspiciously like

the rise over run expression plus a collection of higher order terms.

If we notice that the first of the higher order terms has a delta x in it.

We know that we can now lump them all together and say that

using the rise of a run method between two points with a finite separation will give

us an approximation to the gradient that contains an error proportional to delta x.

Or more simply put, the forward difference method is first order accurate.

That's all for this video.

It might seem a little odd to go to all that trouble just to get an idea of

the error in an approximation.

But it turns out to be a hugely important concept when,

as is typical, we ask computers to solve numerically rather than analytically.

See you next time.

[MUSIC]