Taylor and Maclaurin Series
Here we apply what we've learned about infinite series, and particularly power series: the application is to represent functions as power series. This is useful for a variety of reasons; for instance, it allows us to write a transcendental function like ex as what is essentially an infinite polynomial. As we have seen in many contexts by now, polynomials are very friendly, so it can greatly simplify things to rewrite a more complicated function as a power series.
Two Assumptions:
- The function f(x) that we're dealing with in a particular problem has a power series representation about some center x=a. Basically, we aren't going to try any functions for which this won't work.
- This function f(x) has derivatives of every order (first derivative, second, etc.) and we can find them. This is crucial.
The Basic Idea
Ok, so how do we come up with a power series to represent a function? In other words, start with the following (just using the general form of a power series:
f(x)=n=0∑∞cn(x−a)n
How do we figure out what those coefficients cn are? If we know what those are, we're done; that's the whole game.
In a moment, we'll go through and find a formula for them, and that's all you'll need to know to do the problems; you can memorize that and move on. But again, I like to show you where things like this come from, so we're going to derive that formula. Here's the basic idea, though: we pick a center point a (the center of the power series' interval of convergence), and we decide that AT THAT POINT, we want the function and the power series to agree. Simple enough, right? It turns out that that condition gives us the first coefficient. Then, we decide that at that point, we want the first derivative of the function and the first derivative of the power series to agree. This, as we'll see, gives us the second coefficient. We do the same with the second derivative to get the third coefficient, and so on.
It may help to try the following demo: (click to follow the link to Desmos)
Try entering cosx, sinx, and ex into the function box. Then vary D, the degree of the matching polynomial (if this D were infinite, it would be the power series). Notice that if D=1, f(x) and the polynomial agree at the center point, and their slope agree. Then, if D=2, they agree, their slopes agree, and their concavities agree. Every time you increase D, the matching polynomial starts to line up more and more closely with f(x).
Finding the Coefficients
To find the coefficients, as I said, we'll start taking derivatives of both the function f(x)
and the power series, and each time we do, we'll set them equal when x=a. To differentiate the power series, all we need is the Power Rule (and technically the Chain Rule, but it's pretty simple). You should double-check the table below (note that to write the nth derivative of f, we write f(n), so we don't get stuck writing a bunch of apostrophes; for instance, the fifth derivative would be written f(5)(x)).
At x=aFirst DerivativeAt x=aSecond DerivativeAt x=aThird DerivativeAt x=a⋮nth DerivativeAt x=aThe Functionf(x)f(a)f′(x)f′(a)f′′(x)f′′(a)f′′′(x)f′′′(a)⋮f(n)(x)f(n)(a)The Power Series∑n=0∞cn(x−a)n=c0+c1(x−a)+c2(x−a)2+c3(x−a)3+c4(x−a)4+…c0c1+2c2(x−a)+3c3(x−a)2+4c4(x−a)3+…c12c2+3⋅2c3(x−a)+4⋅3c4(x−a)2+…2c23⋅2c3+4⋅3⋅2c4(x−a)+…3⋅2c3⋮n!cn+(n+1)!cn+1(x−a)+…n!cn
This table gives us the coefficients (which is all we were after, remember). The key takeaway is that
cn=n!f(n)(a)
Summary
If a power series representation of a function f(x) exists about a point x=a, then the Taylor Series for this function about this point is given by
f(x)=n=0∑∞n!f(n)(a)(x−a)n.
If the center point is a=0, this is called a Maclaurin Series:
f(x)=n=0∑∞n!f(n)(0)xn.
As you'll see, doing a problem in this section simply consists of finding a pattern for these coefficients, which we'll do by taking derivatives and plugging in that center point.
Exponential Function
Find the Maclaurin Series for f(x)=ex.
Solution
Since we're finding the Maclaurin Series, a=0, so
f(x)=ex=n=0∑∞n!f(n)(0)xn.
All that we have to do is find the pattern in the derivatives evaluated at 0. This is easy, since all the derivatives are equal:
f(x)=ex⟶f(0)f′(x)=ex⟶f′(0)f′′(0)f′′′(0)f(n)(0)=e0=1=e0=1=1=1⋮=1
Therefore,
ex=n=0∑∞n!1xn
Interval of Convergence
When it comes to a Taylor or Maclaurin Series, the interval of convergence is important because this is the interval on which the function and the power series are equal. In other words, this is the interval of x values where the function can be evaluated by evaluating the power series.
To find the interval of convergence, use the Ratio Test:
p=n→∞lim∣∣∣∣∣∣∣∣n!xn(n+1)!xn+1∣∣∣∣∣∣∣∣=n→∞lim∣∣∣∣(n+1)!xn+1⋅xnn!∣∣∣∣=n→∞lim∣∣∣∣x⋅n+11∣∣∣∣
Making sure this limit is less than 1:
n→∞lim∣∣∣∣x⋅n+11∣∣∣∣∣x∣n→∞limn+11<1<1
Since that limit is 0, the left hand side is always less than 1, no matter what x is, so the interval of convergence is
(−∞,∞).
Find the Maclaurin Series for f(x)=e−x.
e−x=n=0∑∞n!(−1)nxn
Find the Taylor Series for f(x)=x21 centered about x=−1.
Solution
We start by taking derivatives and evaluating them at x=−1.
f(x)=x21=x−2f′(x)=−2x−3f′′(x)=(3)(2)x−4f′′′(x)=−(4)(3)(2)x−5f(n)(−1)⟶f(−1)=1⟶f′(−1)=2⟶f′′(−1)=(3)(2)⟶f′′′(−1)=(4)(3)(2)⋮=(n+1)!
Plugging this into the Taylor Series formula:
f(x)=x21=n=0∑∞n!f(n)(−1)(x+1)n=n=0∑∞n!(n+1)!(x+1)n
Simplify by noting that n!(n+1)!=n+1:
x21=n=0∑∞(n+1)(x+1)n
Interval of Convergence
To find the interval of convergence, use the Ratio Test:
p=n→∞lim∣∣∣∣(n+1)(x+1)n(n+2)(x+1)n+1∣∣∣∣=n→∞lim∣∣∣∣(x+1)⋅n+1n+2∣∣∣∣
Making sure this limit is less than 1:
n→∞lim∣∣∣∣(x+1)⋅n+1n+2∣∣∣∣∣x+1∣n→∞limn+1n+2<1<1
Since this limit is equal to 1:
∣x+1∣n→∞limn+1n+2∣x+1∣<1<1
−2<x<0
The series diverges at both endpoints, based on the Divergence Test, so the interval of convergence is
(−2,0).
Sine Function
Find the Maclaurin Series for f(x)=sinx.
Solution
This one is a bit trickier, but we start the same way, by taking derivatives and plugging 0 into them to spot a pattern. The pattern is pretty clear, but the tricky part is writing an expression that matches this pattern. To do so, we'll drop off all the terms that equal 0 and write an expression for what remains.
f(x)=sinxf′(x)=cosxf′′(x)=−sinxf′′′(x)=−cosxf(4)(x)=sinxf(5)(x)=cosx⟶f(0)=0⟶f′(0)=1⟶f′′(0)=0⟶f′′′(0)=−1⟶f(4)(0)=0⟶f(5)(0)=1
Plugging this into the Maclaurin Series:
sinx=n=0∑∞n!f(n)(0)xn=0!0x0+1!1x1+2!0x2+3!−1x3+4!0x4+5!1x5+…=1!1x1+3!−1x3+5!1x5+…
To find the pattern for this series, first note that it alternates, and the negative terms are the odd ones (if n
starts at 0, the second term listed is when n=1), so we'll need (−1)n in the expression. Then notice that the power on x and the factorial in the denominator are the same for each term, and they are the odd numbers, which, as we've seen before, can be expressed by 2n+1. Therefore, the Maclaurin Series looks like
sinx=n=0∑∞(−1)n⋅(2n+1)!x2n+1
Find the Maclaurin Series for f(x)=cosx.
cosx=n=0∑∞(−1)n⋅(2n)!x2n
Most Common Maclaurin Series
We've now derived the three most common Maclaurin Series, and you will probably want to memorize the following:
exsinxcosx=n=0∑∞n!1xn=n=0∑∞(−1)n⋅(2n+1)!x2n+1=n=0∑∞(−1)n⋅(2n)!x2n
Note
The applicability of Taylor/Maclaurin Series is very broad, but one easy application is to use them to verify derivatives that you already know. I won't work this out for you, but you should be able to write out the first few terms of each of the three series above and take the derivative, term by term, to show that the derivative of the exponential function is itself, the derivative of the sine function is the cosine function, and the derivative of the cosine function is the negative of the sine function. Take a moment and try it.