Module 10 : Series
1004 : General Power Series
O B J E C T I V E
Maple contains a power package of commands created to deal with power series. Using this package, we can create arbitrary power series, perform operations on them, and evaluate them for convergence.
> restart; with(powseries):
___________________________________________________________________________________
A. Defining Series
___________________________________________________________________________________
In the previous module, we learned how to create series for arbitrary functions using the series command. Now we are going to turn this process around, and define power series by defining what their coefficients should look like - without necessarily knowing what function if any, they represent.
To create a power series, we simply define a function that defines the coefficients. And then to view the series, we use the tpsform command which renders the series as a "truncated power series". The parameter 8 tells us how many terms to display.
truncated power series
> powcreate( a(n) = 1/2^n); tpsform(a, x, 8);
> powcreate( b(n) = 1/3^n); tpsform(b, x, 8);
We don't need to compute everything from scratch. There are some for the more important functions' series built in to the powseries package.
> s := powsin( x ): tpsform( s, x, 12);
> c := powcos( x ): tpsform( c, x, 12);
> e := powexp( x ): tpsform( e, x, 8);
___________________________________________________________________________________
B. Evaluating A Power Series
___________________________________________________________________________________
To evaluate a series at a value, we need to follow two steps. After defining the series, we name the truncated power series, then evaluate it at a particular using the eval command.
> s := powsin( x ): sx := tpsform( s, x, 12);
> eval( sx, x = a + b);
> eval( sx, x = Pi/4); evalf(%);
> evalf( sin( Pi/4));
___________________________________________________________________________________
C. Operations
___________________________________________________________________________________
One of the features which makes the power series package so powerful is the ability to perform arithmetic operations with series.
> s := powadd( a,b ): tpsform( s, x, 8);
> d := subtract( a, b ): tpsform(d, x,8);
> m := multiply( a, b ): tpsform( m, x, 8);
> q := quotient( a,b ): tpsform(q,x,8);
> sm := multiply( s,m): tpsform( sm, x, 12);
We can use these operations to verify some common identities. For example, lets demonstrate the validity of cos(2*x) = cos(x)^2 - sin(x)^2;
> s := powsin( x): tpsform(s,x,12);
> c := powcos(x): tpsform(c, x,12);
> s2 := multiply( s,s): tpsform( s2, x, 12);
> c2 := multiply( c,c): tpsform( c2, x, 12);
> c2s2 := subtract( c2, s2): tpsform( c2s2, x, 12);
> c2x := powcos( 2*x): tpsform( c2x, x, 12);
> difference := subtract( c2s2, c2x): tpsform( difference, x, 12);
Here is a famous demonstration of the fact that e^ix = cos(x) + i*sin(x)
> c := powcos( x ): tpsform(s, x, 12);
> si := multconst( s, I): tpsform(si, x, 12);
> cis := powadd( c, si): tpsform( cis, x, 12);
> e := powexp( I*x): tpsform(e, x, 12);
> difference := subtract( cis, e): tpsform( difference, x, 12);
Another operation is the composition of tow series. This is similar to taking the composition of two functions f(g(x)). For example, lets compose the series for e^x with sin(x).
> es := compose( e,s ): tpsform(es, x, 8);
> series( exp( sin(x)), x, 8);
Using the normal series command, we verify that we get the same result.
___________________________________________________________________________________
D. The Radius of Convergence
___________________________________________________________________________________
In any use of power series, we must consider the interval of convergence, outside of which, the power series has no relevance. If we define the coefficients of a power series, how do we know the radius of convergence?
First we re-initialize the variable c, and we define the series.
> c := 'c';
> powcreate( c(n) = 11*(n^2)/(2^n)): tpsform( c, x, 10);
Then we express the terms c^n+1, and c^n in a standard way. This step, which might be difficult to understand , is necessary because of the way Maple stores the coefficients. what we are doing is substitute n for the interal parameter used by Maple
> subs(_k = n, c(_k)); subs(_k = n + 1, c(_k) );
Next we take the ratio, the absolute value of its simplification, the limit as n approaches infinity, and finally the radius of convergence.
> % / %%;
> abs( simplify( %));
> ratio := abs( limit( %, n = infinity));
> RadConv := 1/ ratio;
Here is another example. The series is entirely different.
> powcreate( t(n) = ( 3^n )/n!): tpsform(t,x,10);
> subs(_k = n, t(_k)); subs(_k = n + 1, t(_k));
> %/%%;
> abs(simplify( %));
> ratio := abs( limit( %, n = infinity));
> RadConv := limit( 1/r, r = ratio);
We use a limit to define the radius of convergence since the ratio is zero.
>