In this session, we're going to work through the derivation of Power Series representation of functions, which in short is the idea that you can use a series of increasing powers of x to re-express functions. Just to warm up by blowing your minds, we can take the function e to the x, which we met earlier in the course, and re-express it as the series 1 plus X plus X squared over two plus x cube over six, plus higher order terms. Now, I hope you would agree with me that this is pretty incredible, and hopefully by the end of this video you will understand how to build series like this for many other interesting functions. What the Taylor series method tells us is that if we know everything about the function at some point, whereby everything, I mean the functions value, its first derivative, second derivative, third derivative etc. Then we can use this information to reconstruct the function everywhere else. So, if I know everything about it at one place, I also know everything about it everywhere. However, this is only true for a certain type of function that we call well behaved, which means functions that are continuous and that you can differentiate as many times as you want. That said, we know lots of functions like that. So, it turns out to be a very useful tool indeed. So, now we're going to try and explain this concept graphically by looking at a graph of some arbitrary function f of x which looks like this, I'm building a sequence of gradually improving approximations. So, our first approximation, which we can call g0, we're going to build using just one piece of information from a function f of x which will be the value of the function at our point of interest, which in this case is just x equals 0. As you can imagine, if all we're going to build our function off is this one single value, then clearly our guess function isn't going to be able to capture a very complicated shape like this, and in fact, all it can be is a horizontal line at the point f at 0. So we can plot this first approximation and also write an expression for calculating g0 of x which is just f of 0. We call this our zeroth order approximation and clearly it's not very good. But also notice that as this line it's flat, it's actually not even a function of x. We can do better. So let's now find our first order approximation. For this, we're now going to use two pieces of information, the value of the function at x equal 0 but also the value of the gradient at x equals 0 which we will call f dash at 0. Using these we can build another straight line of the form y equals mx plus c where the vertical axis intercept c is just f of 0. But just substituting in for f dash of 0 as the gradient of our line. So, we can now plot our first order approximation to the function which has the same value of the gradient and of the function f of x. And we can also write down its expression g1 of x is f0, f dash of 0 times x. This thing clearly does a better job than g0 at approximating f of x near the point x equals 0. But it's still not great. Moving quickly onto our second order approximation g2 of x, we're going to use three pieces of information, f of 0, f dash of 0, and the second derivative f double dash of o. Now, to have a function that can make use of these three pieces of information, we're going to need a quadratic equation. So we can write y equals ax squared, plus bx, plus c. Differentiating this thing twice, we can just say well y prime equals 2ax, plus b, and y double prime equals 2a. Now what we want is for this function to be the same as f of x when we sub in it the point equals 0, x equals 0. So we can say okay at x equals 0, we want this thing to equal f double prime of 0. So clearly, our coefficient a, because this thing is not even a function of x. Therefore, a is just going to equal f double dash 0 divided by 2. Now, if we look up at this equation here we also want the first derivative to be equal to the function at 0. So, we can set this equal to f dash of 0 and with subbing in 0 for x here, so this term just disappears. So, we can now say that also b equals f dash at 0. Lastly, subbing in 0 here and here, and setting this thing just equal to f of 0, we can say that clearly c is also just equal to f of 0, c equals f at 0. So, we now have all 3 coefficients for our equation and we can say let's now go back to our graph and add our second order approximation which as it's just an x squared term will be a parabola. Notice that each time we update our approximation, the region in which it matches up with f of x grows a little. So, let's now take one more step down the rabbit hole and find the third order approximation. So, we can write y equals ax cubed plus bx squared plus cx plus d. As based on what we've already seen from the first three steps, it's only the coefficient a that we need to find as b,c and d will be the same as we found for g2. So let's now differentiate this thing three times, y prime equals 3ax squared plus 2bx plus c, y double prime equals 6ax plus 2b, and y3 is just going to be 6a. So clearly, we want this thing, the third derivative our approximation function to equal our function f of x when we differentiate it three times and evaluate it at the point x equals 0. So it's setting this x to 0 now there is no x and this bit, we can say f3 at 0 equals 6a. Therefore, a just equals f3 at 0 divided by 6. Finally, we can add this third order approximation to our graph and write out its expression. You can now see that not only has the approximation improved significantly, but also that we can add higher order terms piece wise and in each case the lower order terms remain the same. What we now want to build is a general expression for the series such that we could just write down the fourth order approximation without working through it. Notice that the one with the sixth coefficient in front of the cubic term was the result of having to differentiate a cubic term twice. So when we differentiate x to the fourth power three times, we are going to get four, times three, times two in front, leading to a curve fission of one divided by four times three times 2 which is one divided by 24. We have a name for the operation four times three times two which is four factorial. In fact all the terms can be thought of as having a factorial in front of them even 0 factorial which for reasons I won't go into here is in fact equal to 1. So, with this last piece of the puzzle in place, we can now say that the nth term in the approximation is just the nth derivative of f evaluated 0 divided by n factorial multiplied by x to the power of n. And therefore, the complete power series can be written as follows. So you can see it's the sum from n equals 0 to infinity of these terms. Although, what we've written here certainly does count as a tailless series because we're specifically looking at the point x equals 0, we often refer to this case as a Maclaurin series. So you're are still going to have to wait one more video before seeing the Taylor series expression in all its glory. In the rest of this module, we're going to be applying the concept of power series to some interesting cases as well as generalizing it to higher dimensions where rather than building approximation curves, we will be constructing approximation hyper surfaces. See you then.