[MUSIC] In this video, we're going to put our understanding of power series to the test by looking at two interesting examples. First off, we're going to build a Maclaurin series expansion of the cosine function. Cosine is the epitome of a well behaved function, as it is certainly continuous everywhere as well as being infinitely differentiable. As we're building a Maclaurin series, we're going to want to find out everything about the function at the point x = 0. So let's start by doing some differentiation. And what we get, if you remember from earlier in the course, is this cyclic pattern of cosines and sines, positive and negative. Which takes us back to the cosine again after four steps. If we now evaluate this derivative at point x = 0, we see that the cosine terms are either 1 or -1, and the sine terms are all 0. This must mean from a power series perspective, that every other term will have a zero coefficient. Notice that these 0s will occur whenever we differentiate an odd number of times. Which means that all the odd powers of x like x to the one, x cubed, x to the five, etc. will all be absent from the series. The even powers of x are all what we call even functions, which means that they're all symmetrical around the vertical axis, just like cosine is. So, we can now bring back our general expression for the Maclaurin series and just start writing out the terms. The icing on the cake is that at this point, we just noticed that we can build a neat summation notation which fully describes this series without having to write out all the terms. Notice that this expression doesn't even contain any reference to cosine, as all that we need to know is captured by the minus one to the power of n, which just keeps flipping from negative to positive and negative again. Now that we've done all the hard work, we can simply ask our computer to plot this sequence of increasingly accurate Macclaurin series. Which hopefully, starting from a horizontal line of y = 1, will line up with your expectations. Notice that outside of the region fairly close to the point, x = 0. The approximation explodes off and becomes useless. By the time we get our 16th order approximation, we've pretty much nailed the region shown in our graph here. Although just outside of these axes, the function would also be growing hugely positive. So you must always be careful when handling series approximations that you know the domain in which it's acceptable. In the second example, we're going to take a look at the function f(x) = 1/x which of course, looks like this. It's a nice simple function but notice the discontinuity at x = 0. This is absolutely not a well behaved function. In fact, it's so badly behaved that when we even try and build the zeroth order approximation, we immediately run into problems. Because we have to perform the operation 1 divided by 0 which is not defined. And if you try to ask you computer to do this, it may give you back the answer NAN, which stands for, not a number. So, we're going to need to try a different angle of attack. Clearly, we aren't going to have much luck at the point x = 0. So why not try going somewhere else, anywhere else. Let's look at the point x = 1. Certainly, it passes the first test of being able to evaluate the function at this point. However, moving away from x = 0 means that we're now going to need to use the Taylor Series instead of the Maclaurin Series. So we now need to find a few derivatives of the function and see if we can spot a pattern. When we evaluate these functions at the point x = 1, hopefully, you'll recognise that we get a sequence of factorials emerging, just as we did when deriving the power series formula in the first place. So if we now substitute these values into our Taylor series formula, the factorial terms will cancel and all we are left with is a sum of x- 1 to the power of n terms with alternating signs. Which we can simply to this neat summation notation. So once again, let's now pass this formula to the computer and ask it to plot a sequence of improving approximation starting as ever with a horizontal line. But this time starting at the height of the function at x = 1. There are several really interesting features of this particular example, which tell you interesting things about the power series more generally. Firstly, the approximations ignore the asymptote, going straight across it. And furthermore, the region of the function where x is less than 0 is not described at all by the approximations. Secondly, although the function is gradually improving for larger values of x, you can see the tail wildly flailing around as the sign of each additional term flips from positive to negative and back again. I hope these two examples have made it clear both how the Taylor series manages to reconstruct well behaved functions like cosine x. But also why they can struggle to deal with something badly behaved like 1/x. As we bring this video to a close, let's now watch an action replay of these two sequences of improving approximations. In the next video, we're going to talk briefly about what it means to linearise a function, and see how this relates to the Taylor series analysis that we've seen so far. See you then.