[MUSIC] I began our last session by training to motivate you with the fact that we can re-express the function, e to the x, as a power series. So I want to make sure that your mind is well and and truly blown by showing you that when we differentiate this function term by term. Which isn't very difficult to do it's just a polynomial, something rather satisfying happens. Where just as we'd expect for the derivative of e to the x, this infinitely long series remains unchanged, which I think is pretty awesome. So now, finally, you're going to get to see the Taylor series. Fundamentally, we are applying the same logic as the Maclaurin series that we derived previously. But whereas the Maclaurin series says that if you know everything about a function at the point x equals zero, then you can reconstruct everything about it everywhere. The Taylor series simply acknowledges that there is nothing special about the point x equals zero. And so says that if you know everything about the function at any point, then you can reconstruct the function anywhere. So a small change but an important one. Let's look again at the function e to the x as well as the first four approximation functions. Now, using our understanding of the Maclaurin series, we can also rewrite this in a compact summation notation. Such that we could, if we wanted to, build a polynomial approximation function to arbitrary degree of accuracy. So what if now instead of expanding around the point x equals 0, we wanted to start off from the point x equals p. Well, to begin with, let's have a look at the first four approximation functions at this point. The expressions to describe these approximations are still going to require the value of the function, as well as all of its derivatives at this point. But how do we now adjust our general equation to allow for an arbitrary expansion point, x equals p? Well clearly the zeroth order term, this is just straight forward, it's going to be a horizontal line that just uses the point f of p everywhere. But what if we take a closer look at the first order approximation. This should give us enough insight that we'll then be able to tackle all the other higher order terms. So we're essentially looking to build a tangent to the curve at point p. All straight lines are in the form y equals mx plus c. So let's now work through this by putting in place all the information that's available to us. So we can say, okay, here is some nice function that we're going to deal with. And if we're looking at the point p here, this is of course at f of p height. So its coordinates of this point are p, f of p. And we want to build an approximation function that is first order. So it's got a y-axis intercept and it's got a gradient. And it's going to look something like this, okay? The same gradient and the same height of the function at that point. So of course, that green line is going to have the equation y = mx + c. Now we know immediately that m is the gradient of this straight line. And we know the gradient of our function here is just f dash of p. So we can say y = f dash (p)x+c. So all that's left is for us to find c, and to do that we're going to need to know x and y, but we do know a point on our line, the point p, f(p). So we just sub these in. f(p) = f dash (p) p + c. Rearranging for c, we can just see that c = f(p)- f dash (p) p. Subbing the c back into our general equation, we can now bring it round and say, well this line has the equation y = m, which is just f dash of p, times x plus c, which is just f(p) - f dash of p multiplied by p, okay? Now the last thing I'm going to do is take this and factorise this f dash of p out. And that'll leave you with a nice form of this expression. y = f dash of p multiplied by, there's an x of it here, and there's a minus p of it here. So we can say x- p +, just this down here, f (p). What this shows us is that by building our approximation around the point p, when we use our gradient term f dash of p, rather than applying it directly x, we instead now apply it to x- p. Which you can think of as, how far are you away from p? So we can now write down our first two approximation functions to f(x) at the point p, the zeroth and the first. Thinking back to Maclaurin series from the previous video, all we need to do to convert to Taylor series is use the second derivative at p rather than 0, and also replace x with x- p. But notice that the factor of one-half still remains. So we can now look at our concise summation notation for the Maclaurin Series and upgrade the whole thing to the more general Taylor Series form. Noticing of course that if we decide to set p to 0 then the expressions would actually become identical. So we now have our one dimensional Taylor series expression in all its glory, which will allow us to conveniently re-express functions into a polynomial series. In the remainder of this module we're going to play around with this result as well as extending it to higher dimensions. See you then. [MUSIC]