Power series and Taylor series 

Power series and convergence intervals 

A power series is best thought of as a function. It turns each value of a variable x into the sum of a series. The variable always appears as (x-a)^nwithin the series. In this example, the center point a=0. 

> c:= n->(-3)^n/sqrt(n+1);
 

proc (n) options operator, arrow; (-3)^n/sqrt(n+1) end proc 

> s:= x-> sum(c(n)*x^n,n=0..infinity);
 

proc (x) options operator, arrow; sum(c(n)*x^n, n = 0 .. infinity) end proc 

> s(x);
 

sum((-3)^n*x^n/(n+1)^(1/2), n = 0 .. infinity) 

Maple can give a little insight about a power series through a graph. 

> plot(s(x),x=-0.5..0.5);
 

Plot 

From the graph, it appears unlikely that the series is convergent all the way down to x=-0.5. Maple can help you identify what the radius of convergence is. Often the Ratio Test is useful in this respect. 

> abs( (c(n+1)*x^(n+1)) / (c(n)*x^n) );
 

abs((-3)^(n+1)*x^(n+1)*(n+1)^(1/2)/((n+2)^(1/2)*(-3)^n*x^n)) 

> simplify( % );
 

3*abs(x*(n+1)^(1/2)/(n+2)^(1/2)) 

> L:= limit( %, n=infinity );
 

3*abs(x) 

> solve( L<1, x );
 

RealRange(Open(-1/3), Open(1/3)) 

Notice how solve can solve inequalities. The radius of convergence is 1/3. Observe that in the graph above, Maple computed "values" of the power series outside its interval of convergence. These values have to be regarded as suspect at best. 

The endpoints of the interval of convergence always must be checked independently. At the right end, 

> simplify( s(1/3) );
 

sum((-1)^n/(n+1)^(1/2), n = 0 .. infinity) 

This is a convergent alternating series. At the left end, 

> simplify( s(-1/3) );
 

infinity 

It is now clear that the interval of convergence is the half-open interval (-1/3,1/3]. 

 

Taylor series and Taylor polynomials 

The most important type of power series is a Taylor series. It is a different way to express a function f(x). 

> taylor( exp(x), x=0 );
 

series(1+x+1/2*x^2+1/6*x^3+1/24*x^4+1/120*x^5+O(x^6),x,6) 

The term O(x^6)in the above is Maple's way of showing the power of the first nonzero term it left out. You can ask for more or fewer terms. 

> taylor( exp(x), x=0, 10 );
 

series(1+x+1/2*x^2+1/6*x^3+1/24*x^4+1/120*x^5+1/720*x^6+1/5040*x^7+1/40320*x^8+1/362880*x^9+O(x^10),x,10)
series(1+x+1/2*x^2+1/6*x^3+1/24*x^4+1/120*x^5+1/720*x^6+1/5040*x^7+1/40320*x^8+1/362880*x^9+O(x^10),x,10)
 

While Maple can compute as many terms as you like, it's not so simple to get it to say what we write: It's basically up to you to find the pattern to express things this way when possible.  

The expansion point of the series has an important effect. 

> taylor( exp(x), x=1 );
 

series(exp(1)+exp(1)*(x-1)+1/2*exp(1)*(x-1)^2+1/6*exp(1)*(x-1)^3+1/24*exp(1)*(x-1)^4+1/120*exp(1)*(x-1)^5+O((x-1)^6),x = 1,6)
series(exp(1)+exp(1)*(x-1)+1/2*exp(1)*(x-1)^2+1/6*exp(1)*(x-1)^3+1/24*exp(1)*(x-1)^4+1/120*exp(1)*(x-1)^5+O((x-1)^6),x = 1,6)
 

> taylor( exp(x), x=-2 );
 

series(exp(-2)+exp(-2)*(x+2)+1/2*exp(-2)*(x+2)^2+1/6*exp(-2)*(x+2)^3+1/24*exp(-2)*(x+2)^4+1/120*exp(-2)*(x+2)^5+O((x+2)^6),x = -2,6)
series(exp(-2)+exp(-2)*(x+2)+1/2*exp(-2)*(x+2)^2+1/6*exp(-2)*(x+2)^3+1/24*exp(-2)*(x+2)^4+1/120*exp(-2)*(x+2)^5+O((x+2)^6),x = -2,6)
 

> taylor( cos(x), x=0 );
 

series(1-1/2*x^2+1/24*x^4+O(x^6),x,6) 

> taylor( cos(x), x=Pi/2 );
 

series(-(x-1/2*Pi)+1/6*(x-1/2*Pi)^3-1/120*(x-1/2*Pi)^5+O((x-1/2*Pi)^6),x = 1/2*Pi,6) 

If we keep just the first n+1 terms of a Taylor series and drop the rest, we get the nth degree polynomial known as a Taylor polynomial, This is the only polynomial of degree n or less that matches the value of f and its first n derivatives at the expansion point x=a. We can ask Maple to convert a Taylor series it found into a Taylor polynomial. 

> f:= cos(x)-sin(5*x);
 

cos(x)-sin(5*x) 

> taylor( f, x=Pi/2, 4 );
 

series(-1-(x-1/2*Pi)+25/2*(x-1/2*Pi)^2+1/6*(x-1/2*Pi)^3+O((x-1/2*Pi)^4),x = 1/2*Pi,4) 

> T3:= convert( %, polynom );
 

-1-x+1/2*Pi+25/2*(x-1/2*Pi)^2+1/6*(x-1/2*Pi)^3 

> eval( [f, T3], x=Pi/2 );
 

[-1, -1] 

> eval( [diff(f,x), diff(T3,x)], x=Pi/2 );
 

[-1, -1] 

> eval( [diff(f,x,x), diff(T3,x,x)], x=Pi/2 );
 

[25, 25] 

> eval( [diff(f,x,x,x), diff(T3,x,x,x)], x=Pi/2 );
 

[1, 1] 

Close to the value x=a, T[n](x) can be a very good approximation to the original f. In fact it is a generalization of the familiar tangent line approximation. 

> T1:= convert( taylor(f,x=Pi/2,2), polynom );
 

-1-x+1/2*Pi 

> plot( [f,T1,T3], x=Pi/2-1/2..Pi/2+1/2, color=[black,blue,red] );
 

Plot