Manipulating Taylor Series

by Justin Skycak (@justinskycak) on

To find the Taylor series of complicated functions, it's often easiest to manipulate the Taylor series of simpler functions.

This post is part of the book Justin Math: Calculus. Suggested citation: Skycak, J. (2019). Manipulating Taylor Series. In Justin Math: Calculus. https://justinmath.com/manipulating-taylor-series/

Want to get notified about new posts? Join the mailing list and follow on X/Twitter.


To find the Taylor series of complicated functions, it’s often easiest to manipulate the Taylor series of simpler functions, such as those given below.

11βˆ’x=βˆžβˆ‘n=0xn(βˆ’1<x<1)ex=βˆžβˆ‘n=0xnn!(βˆ’βˆž<x<∞)ln(1+x)=βˆžβˆ‘n=1(βˆ’1)n+1nxn(βˆ’1<x≀1)sinx=βˆžβˆ‘n=0(βˆ’1)n(2n+1)!x2n+1(βˆ’βˆž<x<∞)cosx=βˆžβˆ‘n=0(βˆ’1)n(2n)!x2n(βˆ’βˆž<x<∞)arctanx=βˆžβˆ‘n=0(βˆ’1)n2n+1x2n+1(βˆ’1≀x≀1)


Multiplying by a Constant

For example, to compute the Taylor series of xex centered at x=0, we can take the elementary Taylor series ex=βˆ‘βˆžn=0xnn! and multiply it by x.

xex=xβˆžβˆ‘n=0xnn!=βˆžβˆ‘n=0xn+1n!


Though not strictly necessary, we can make the exponent on the match the index of summation by changing the index of summation to k=n+1.

xex=βˆžβˆ‘k=1xk(kβˆ’1)!


In this case, since we are multiplying the series by a constant, the interval of convergence of the series will stay the same: βˆ’βˆž<x<∞.

This is because a convergent series has a finite sum, and multiplying by a constant cannot cause a finite number to become infinite; whereas a divergent series has an infinite sum, and multiplying by a constant cannot cause an infinite number to become finite.

Multiplying Two Series

Similarly, to compute the Taylor series of ex1βˆ’x around x=0, we can multiply the two elementary Taylor series ex=βˆ‘βˆžn=0xnn! and 11βˆ’x=βˆ‘βˆžn=0xnn!.

ex1βˆ’x=(βˆžβˆ‘n=0xnn!)(βˆžβˆ‘k=0xk)=βˆžβˆ‘n,k=0xn+kn!


Defining a new index of summation m=n+k, we can write the series in order of increasing powers of x.

ex1βˆ’x=βˆžβˆ‘n,k=0xn+kn!=βˆžβˆ‘m,k=0xm(mβˆ’k)!=βˆžβˆ‘m=0(mβˆ‘k=01(mβˆ’k)!)xm


The interval of convergence of a product of series is at least the intersection of the series’ individual intervals of convergence.

Here, recalling that the interval of convergence of the Taylor series of ex is (βˆ’βˆž,∞) and the interval of convergence of the Taylor series of 11βˆ’x is (βˆ’βˆž,∞), we determine that the interval of convergence for the Taylor series of ex1βˆ’x must be at least the intersection (βˆ’βˆž,∞)∩(βˆ’1,1)=(βˆ’1,1).

If we go through the trouble of performing a test of convergence, it’s possible that we might find a larger interval of convergence – but just based on the intervals of convergence of the two series being multiplied, we can say with certainty that the product converges for at least βˆ’1<x<1, without needing to perform any tests of convergence.

Adding Two Series

Sometimes, we can take advantage of the fact that it’s easier to add or subtract series than to multiply series.

For example, to find the Taylor series of ex(1βˆ’ex) around x=0, one option is to multiply the Taylor series of ex and 1βˆ’ex.

However, an easier route is to simplify the expression to exβˆ’e2x, and then subtract the Taylor series of e2x from the Taylor series of ex. To compute the Taylor series of e2x, we can substitute 2x for x in the Taylor series of ex.

ex=βˆžβˆ‘n=0xnn!e2x=βˆžβˆ‘n=0(2x)nn!e2x=βˆžβˆ‘n=02nn!xn


Then, we can proceed with subtracting the Taylor series.

ex(1βˆ’ex)=exβˆ’e2x=βˆžβˆ‘n=0xnn!βˆ’βˆžβˆ‘n=02nn!xn=βˆžβˆ‘n=0xnn!βˆ’2nn!xn=βˆžβˆ‘n=0(1n!βˆ’2nn!)xn=βˆžβˆ‘n=01βˆ’2nn!xn


Again, the interval of convergence of a sum or difference of series is at least the intersection of the series’ individual intervals of convergence.

The series for ex converges for βˆ’βˆž<x<∞, so the series for e2x converges for βˆ’βˆž<2x<∞, which simplifies to βˆ’βˆž<x<∞. The intersection is given by (βˆ’βˆž,∞)∩(βˆ’βˆž,∞)=(βˆ’βˆž,∞), so the interval of convergence of the series for exβˆ’e2x is at least βˆ’βˆž<x<∞.

Note that this interval contains all real numbers, so the interval can’t get any bigger. Thus, the interval of convergence of the series for exβˆ’e2x is βˆ’βˆž<x<∞.

Using Differentiation and Integration

We can also use differentiation and integration to simplify the process of finding Taylor series. For example, to find the Taylor series of sin2x, one option is to multiply the series of sinx by itself – but an easier option is to differentiate to yield a simpler result, then find the Taylor series of the simpler result, and then integrate the Taylor series to get back to the original function.

(sin2x)β€²=2sinxcosx(sin2x)β€²=sin2x(sin2x)β€²=βˆžβˆ‘n=0(βˆ’1)n(2n+1)!(2x)2n+1(sin2x)β€²=βˆžβˆ‘n=0(βˆ’1)n22n+1(2n+1)!x2n+1∫(sin2x)β€²dx=βˆ«βˆžβˆ‘n=0(βˆ’1)n(2)2n+1(2n+1)!x2n+1dxsin2x=C+βˆžβˆ‘n=0(βˆ’1)n(2)2n+1(2n+1)!(2n+2)x2n+2sin2x=C+βˆžβˆ‘n=0(βˆ’1)n(2)2n+1(2n+2)!x2n+2


To solve for the constant of integration, we can substitute x=0.

sin20=C+βˆžβˆ‘n=0(βˆ’1)n(2)2n+1(2n+2)!(0)2n+20=C+βˆžβˆ‘n=000=C


Thus, we have

sin2x=βˆžβˆ‘n=0(βˆ’1)n(2)2n+1(2n+2)!x2n+2.


Though not strictly necessary, we can clean up the series a bit by changing the index of summation to k=n+1.

sin2x=βˆžβˆ‘k=0(βˆ’1)kβˆ’1(2)2kβˆ’1(2k)!x2k


Neither differentiating nor integrating a Taylor series changes its interval of convergence, so the interval of convergence of the series for sin2x is the same as the interval of convergence of the series for sin2x, which is βˆ’βˆž<x<∞.

Substitution

In the previous examples, we computed the series for sin2x and e2x by substituting 2x for x in the series for sinx and ex. We can extend this idea to more clever substitutions.

For example, to compute the series of the function 12+x5, we can substitute βˆ’x52 for x in the elementary series 11βˆ’x=βˆ‘βˆžn=0xn.

12+x5=12β‹…11βˆ’(βˆ’x52)=12βˆžβˆ‘n=0(βˆ’x52)n=βˆžβˆ‘n=0(βˆ’1)n2n+1x5n


After substitution, the interval of convergence becomes βˆ’1<βˆ’x52<1, which simplifies to βˆ’5√2<x<5√2.

Exercises

Compute the Taylor series for the following functions, centered at x=0. (You can view the solution by clicking on the problem.)

1)f(x)=xln(1+x2)
Solution:
βˆžβˆ‘n=1(βˆ’1)n+1nx2n+1βˆ’1<x≀1


2)f(x)=1x2arctan(2x3)
Solution:
βˆžβˆ‘n=0(βˆ’1)n22n+12n+1x6n+1βˆ’3√12≀x≀3√12


3)f(x)=11+2x
Solution:
βˆžβˆ‘n=0(βˆ’2)nxnβˆ’12<x<12


4)f(x)=cos(βˆšΟ€x)
Solution:
βˆžβˆ‘n=0(βˆ’1)nΟ€n(2n)!xn0≀xβ‰€βˆž


5)f(x)=ln(e+x)
Solution:
1+βˆžβˆ‘n=1(βˆ’1)n+1nenxnβˆ’e<x≀e


6)f(x)=(cosx+sinx)(cosxβˆ’sinx)
Solution:
βˆžβˆ‘n=0(βˆ’1)n22n(2n)!x2nβˆ’βˆž<x<∞


7)f(x)=sin2(3x)
Solution:
βˆžβˆ‘n=1(βˆ’1)n+132n22nβˆ’1(2n)!x2nβˆ’βˆž<x<∞


8)f(x)=cos2(Ο€x)
Solution:
1+βˆžβˆ‘n=1(βˆ’1)nΟ€2n22nβˆ’1(2n)!x2nβˆ’βˆž<x<∞



This post is part of the book Justin Math: Calculus. Suggested citation: Skycak, J. (2019). Manipulating Taylor Series. In Justin Math: Calculus. https://justinmath.com/manipulating-taylor-series/


Want to get notified about new posts? Join the mailing list and follow on X/Twitter.