Welcome to Calculus I'm Professor Griest. We're about to begin lecture four on computing Taylor series. >> We now have in hand the definition of the Taylor series but the question remains, what is the best way to compute them? In this lesson, we'll cover some methods for clean and quick computations of Taylor Series. In doing so, we'll see that this leads us to some new and interesting functions. >> Recall the definition of a Taylor Series. If you want to compute one of these, well you may have to take a lot of derivatives. But that's not your only choice. There are a few other methods as well, including substitution and combination. Let's begin with an example. The displays a substitution method. Consider the function, 1 over X times sine of x squared. Computing on the Taylor Series for this might be a lot of work. Having to differentiate this is not entirely trivial. However, we do know what sine of X is in terms of its Taylor series? Sine of X is X minus X cubed over 3 factorial, plus X to the fifth over 5 factorial, et cetera. If instead of using sine of X, we'll use sign of X squared plugging in X squared into the Taylor series for sin of x. And the multiplying that by 1 over X. Well, we obtain something that is going to work. A little bit of simplification gives X minus X to the fifth over 3 factorial, plus X to the ninth over 5 factorial. Etcetera. Another method for obtaining the same answer would be to take the full summation. As K goes from zero to infinity, of negative one to the K times X squared to the 2K plus 1 over 2K plus 1 quantity factorial. By adding up the coeeficients of the X term properly, we can in fact obtain the full Taylor series for this function. As sum K goes from 0 to infinity, negative 1 to the K, X to the 4 K plus 1. Over quantity 2K plus 1 factorial. That means in effect that we have all of the derivatives of this function evaluated at zero in one simple computation. There are other methods as well involving a combination of like terms. Consider the example of cosign squared, of X. We know the the Taylor series for cosign of X. It is the familiar one minus X squared over two factorial, etcetera. We can square that and then evaluate the product. How would we do so. If we consider these as very long polynomials, then we could apply what we know from polynomial multiplication. The lowest order term is equal to 1 that is 1 times 1. The next order term consists of 1 times negative X squared over 2 factorial. Plus negative X squared over 2 factorial times 1. The next order terms are of fourth order and consist of X squared over 2 factorial quantity squared. but there are a few others as well. There is an X to the fourth over 4 factorial term. And another X to the fourth over 4 factorial term. All of the other terms are going to be of higher order. One could continue multiplying although the multiplications would become a bit tedious. And now one must simplify these terms. With a little bit of work, it's easy to get the low order terms and to get 1 minus X squared plus X to the fourth divided by 3 minus X to the sixth times, 2/45, etcetera. If you want more terms, then you're going to have to do, a bit more work. The one thing that you can note however is that this must be one minus sin squared of X. And so, from this we obtain the Tailor series for sin squared of X as well. With these tools in hand let us consider a new class of functions, these are the hyperbolic trigs. The hyperbolic cosine of X or cosh of X is defined as e to the X plus e to the minus X over 2. The hyperbolic sign of X is defined as e to the X minus e to the minus X over 2. What do these functions look like? Well, they don't look anything like a sine or a cosine. They both grow very rapidly and X due to the exponentials. And their definitions. Nevertheless, these are very important and useful functions. There are others as well, such as the hyperbolic tangent or tanh of X. As you might guess, this is really sinh of X over cosh of X. That is E to the X minus E to the minus X over E to the X plus E to the minus X. Now, some of the rules that you're familiar with from trigonometry hold in this hyperbolic setting but with a bit of a twist. For example, cosh squared of X minus sinh squared of X is equal to 1. One can compare that with the familiar formula, cosine squared plus sine squared equals 1. What does this formula mean? well, we know the relationship between cosine, sine and points on a unit circle. Namely cosine is the X coordinate, the sine is the y coordinate. Of a point moving along that unit circle. In the hyperbolic trigonometric setting, the same is true but for a hyperbola instead of, for a circle. As you might suspect, there are also hyperbolic secant, co-secant and cotangent functions. Let's investigate these hyperbolic trig functions form the point of view of Taylor series co-secant. For example, if we consider the hyperbolic cosine of X as one half E to the X plus one half E to the minus X. Then it's clear how to compute the Taylor's series. Instead of trying to take derivatives, we'll simply substitute in the known series for e to the X, multiplied by one half and then add to it, 1 1/2 times the series for e to the minus X. Which, of course is the Taylor series for e to the X, with minus X substituted in. Leaving negative signs at the odd powers of X. By combining terms according to degree, we see that all of the odd degree terms cancel. And we are left with only the even degree terms. The same as in the expansion of E to the X 1 plus X squared over 2 factorial plus X to the fourth over 4 factorial, etcetera. If we wish to write this out in summation notation, it would be the sum K goes from 0 to infinity X to the 2 K over 2 K quantity factorial. Notice that just like the Taylor series for cosine of X, COSH of X consists of the even powers but with no alternating sign. That is another relationship between the trigonometric and the hyperbolic trigonometric functions. Does the same hold for the hyperbolic SINH. Well let's investigate and see. Following the same method as before we will use the Taylor series for E to the X. And then the Taylor series for E to the minus X but now instead of adding these two terms together, we are going to subtract the ladder from the former. This leads to a cancellation of all the even powered terms and distributing the minus sign through and adding, we obtain all of the odd degree terms in the Taylor Series for E to the X. Thus the sum K goes from 0 to infinity. X to the 2K plus 1 over 2K plus 1 quantity factorial. Just like sign. We can continue our exploration of these functions by proceeding as if the Taylor series are like long polynomials. Hence computing things like integrals or derivatives can be done, term by term. Let's consider what the derivative of the hyperbolic sine of X would be. Well, we can differentiate the terms of the Taylor Series. Since the derivative of X to the 2K plus 1 equals 2K plus 1 times X to the 2K. We can see by dividing by 2K plus 1 quantity factorial and summing as K goes from 0 to infinity. That, the derivative is the sum. K goes from 0 to infinity of X to the 2K over 2K, quantity factorial. That is simply the hyperbolic cosine of X. In similarity to what happens with trig functions the derivative of sinh is cosh. Likewise, what is the derivative of cosh of X? If we differentiate term by term we can see that the derivative of X to the 2K is 2K times X to the 2K minus 1. Now we have to perform a shift in the index, here. In order to avoid problems with what happens when K equals 0. Re-indexing properly gives us the sum, K goes from 0 to infinity of X to the 2 K plus 1 over 2 K plus 1 quantity factorial. That is the hyperbolic sine of X. And so we see that the hyperbolic trade functions are very nice. The derivative of sinh is cosh. The derivative of cosh is sinh. And this becomes clear from the Taylor series. Now we're used to writing out the Taylor series. Term by term, of course, since there are infinitely many, we can't write them all. We typically use a plus .... or an ellipses to conote what happens in the tail of the series. But, there's another terminology that we will begin using. That of H O T or Higher Order Terms. This is an informal way of saying, etcetera and it can be a bit helpful. For example, you might say that cosine of X is 1 minus X squared over 2 plus Higher Order Terms. We could say that sign of X is X plus higher order terms or X minus X cubed over 3 factorial plus HOT. And we could stop whenever we feel like. That's a convenient thing to do when performing computations on Taylor series. We'll use a more formal bookkeeping mechanism soon. Let's look at this in the context of a simple example. 1 minus 2 X times E to the sine of X squared. We'll begin with the Taylor series for sine of X squared, which is simply X squared minus X to the sixth over 6 plus higher order terms. What happens when we exponentiate this? We use the Taylor series for e to the X, 1 plus our quantity above plus 1 1/2 times that quantity squared plus one 1 1/6 times that quantity cubed, etcetera. Notice that I am using plus higher order terms liberally in order to ignore things that aren't going to matter for the first few terms. To simplify this, we go degree by degree. The constant term is one. There's only 1 quadratic term, namely X squared. Are there any fourth order terms? Well, yes there is. 1/2 times X to the fourth. In the sixth degree terms there are two of them. But notice, the coefficients balance each other out. And so the coefficient of the sixth order term is 0. We are left with a Taylor series of 1 plus X squared plus X to the fourth over 2 plus higher order terms. Now to get the Taylor series for our original function f. We simply take 1 and subtract 2X times the quantity obtained above. I'll let you show, with a little simplification, that this is 1 minus 2X minus 2X cubed minus X to the fifth plus higher order terms. If you want more terms, you can get them, it will take more work. >> We've now learned not only what Taylor series are but how to compute them quickly and cleanly. Along the way, we've been introduced to two new characters in our story. The hyperbolic sine and cosine. In our next lesson we're going to consider what happens when things don't work out so well. We'll deal with issues of convergence.