Names:

LAB 2: POWER SERIES

Objective

To investigate the convergence and divergence of power series.

Instructions

Carefully read all instructions and examples. Ask questions if you need any help. It is expected that everyone will actively participate in solving every problem.

Input the answer to any question that is typed in MAGENTA text. Make it clear (with boldface or ALL CAPS or italics or use a different color ) where your answers are, so they will be easily found.

SAVE YOUR WORK OFTEN . Use a different file name (of the form "initials"lab2.mws) than the one on the original LAB. Save the file in your own directory. Enter above, the names of all individuals participating in this report. The lab should be handed in to X:\courses\ma201\handin\ "your_lab_name". You should be able to use Maple's File, Save As commands to place it there, once it is complete.

Introduction

The following lines of code look intimidating, but all you have to do is click anywhere in the red text and hit [Enter]. Then go on with the rest of the lab.

> with(plots):
with(plottools):
with(student):
par_sum := proc( TERM, INDEX::name=range )
local k, lo, hi, n;
k := lhs(INDEX);
lo := op(1,rhs(INDEX));
hi := op(2,rhs(INDEX));
seq( sum(TERM, k=lo..n), n=lo..hi )
end:
par_sum_plot := proc( TERM, INDEX::name=range, DOMAIN::name=range )
local opts;
opts := op( subsop(1=NULL,2=NULL,3=NULL, [args] ));
display( map( plot, [ par_sum( TERM, INDEX ) ], DOMAIN), opts )
end:

The commands above load 3 Maple packages (plots, plottools and student) which add certain useful command shortcuts to the Maple environment, as well as define 2 new procedures (Maple code for new functions or programs) which will help compute and visualize topics related to power series. Usage of both of these new procedures ( par_sum and par_sum_plot ) will be demonstrated below.

>

A series whose nth term is a number (called the nth coefficient and usually denoted [Maple Math] ) times [Maple Math] is called a power series . They are essentially infinite degree polynomials.

A power series:

[Maple Math] + . . .

It's important to realize that the coefficients, [Maple Math] , [Maple Math] , [Maple Math] , etc. are constants, and [Maple Math] is the only variable. Here are a few examples (in sigma or summation form):

> Sum(x^n,n=0..infinity);
Sum(x^n/n!,n=0..infinity);
Sum((-1)^n*3*x^(2*n)/8^n,n=0..infinity);

[Maple Math]

[Maple Math]

[Maple Math]

>

Along with the first 5 terms of each power series.

> sum('x^n','n'=0..4);
sum(x^n/n!,n=0..4);
sum((-1)^n*3*x^(2*n)/8^n,n=0..4);

[Maple Math]

[Maple Math]

[Maple Math]

We can interpret the odd term coefficients, in the last example as being zero. When one substitutes a value for the variable [Maple Math] , one obtains a regular series. Different [Maple Math] values yield different series. Thus, a power series is a function of [Maple Math] , with a twist. Instead of the usual simple computation of [Maple Math] , once one knows [Maple Math] , we must find the sum of a series, once we substitute a value for [Maple Math] . We are use to simple rules like [Maple Math] , once [Maple Math] is known, it's straightforward to compute [Maple Math] (just square [Maple Math] ). Luckily, the series that result by sticking in a value for [Maple Math] , tend to be some of the easier ones to sum. Furthermore, we don't have to stick in one value for [Maple Math] , and find the sum, then a different value for [Maple Math] and find it's sum, etc. We can often times find the sum of the power series for all [Maple Math] values with a single investigation. The first power series above always yields a geometric series with ratio equal to [Maple Math] . Based on what we know about geometric series, we can immediately conclude that for values of [Maple Math] between [Maple Math] and 1, the power series will sum to [Maple Math] . For values of [Maple Math] with absolute value bigger than or equal to 1, the power series will diverge. Thus, if we set

[Maple Math] , then it turns out that

[Maple Math]

Here's the Maple command to subs titute a different value into an expression, and an illustration that we always get geometric series using the example above. I'll define [Maple Math] to be the expression for this power series. Note, to Maple Sum (with a capital S) means "print out the symbols representing the sum", while sum (with a lowercase s) means "evaluate the sum".

> f:=Sum(x^n,n=0..infinity);

>

[Maple Math]

Then, subs titute in a few different values for x:

> subs(x=1/2,f);
subs(x=3,f);
subs(x=-1/4,f);

[Maple Math]

[Maple Math]

[Maple Math]

Different [Maple Math] values give different series. Some [Maple Math] values yield convergent series, some yield series which diverge. Determining which values lead to convergent series, and which lead to divergent series is the main topic of this lab. The key will be to examine this question for all values of [Maple Math] simultaneously. All series converge if and only if the sequence of partial sums converge, that is the official definition. For power series, partial sums are just regular polynomials. We'll look at these partial sums graphically, to illustrate certain properties, then apply the ratio test. Finally we'll investigate a small number (zero, one or two in almost all cases) of specific [Maple Math] values by hand. These exceptional [Maple Math] values define the radius of convergence for the power series, and they are the values of [Maple Math] where the ratio test yields a limit of 1 (the no information case).

Go back up the page a ways and execute (by placing the cursor in the command and pressing [ENTER] ) the definition of [Maple Math] . Then below, substitute in the values x = 1, and x = [Maple Math] , and decide by looking whether or not the 2 resulting series converge or diverge. Describe the partial sums one obtains for x = 1, and x = [Maple Math] , they should be different, and this difference will be reflected in the graphical investigation below.

>

>

>

>

Using Maple to Investigate the Partial Sums of Power Series

The Maple procedures par_sum and par_sum_plot are designed to help compute and graph the partial sums of a power series. The defining commands must be executed before they will work. Once you execute a Maple command, it will remain in effect (in all Maple windows that are open) until you quit Maple (well almost, you can execute the restart command, which clears all Maple definitions). If you quit Maple, come back later and re-open your lab file, you must re-execute the commands that define these procedures.

Let's start with the par_sum command. It requires 2 inputs, a formula for the nth term of the series, followed by the values of n for which one desires the partial sums, in the standard Maple start . . end description of a range. For example, the first (or zero-th?) through fourth (maybe 5th?) partial sums of the geometric example above come from:

> par_sum(x^n,n=0..4);

[Maple Math]

Notice that this says that the n = 0 partial sum is the polynomial [Maple Math] , the n = 1 partial sum is the polynomial [Maple Math] , the n = 2 partial sum is the polynomial [Maple Math] and so on. It is still the case that the n + 1-st partial sum is the n-th partial sum plus one more term .

Compute the n = 0 to n = 4 partial sums for the other two examples of power series given above.

>

>

>

>

>

>

Before we look at the geometric example [Maple Math] graphically, let's summarize what we know, so that we can see how these properties show up in the graphs.

The power series will converge to [Maple Math] for [Maple Math] < [Maple Math] < 1

The power series will diverge for [Maple Math] < [Maple Math] and [Maple Math] > 1

The divergence for x = [Maple Math] and x = 1 is different (and described in your answer above). Actually, the type of divergence at x = 1, happens for all values of [Maple Math] bigger than or equal to one, and the type of divergence at x = [Maple Math] happens for all [Maple Math] .

Thus, we can expect the following behavior in our graphs of the partial sums:

As we take larger and larger values of [Maple Math] in our partial sums, the graphs of these partial sum polynomials should look more and more like the function [Maple Math] , for values of [Maple Math] strictly between [Maple Math] and 1.

As [Maple Math] increases, the [Maple Math] th partial sum polynomial at x = 1 should reflect the type of divergence of the power series at x = 1.

As [Maple Math] increases, the [Maple Math] th partial sum polynomial at x = [Maple Math] should reflect the type of divergence of the power series at x = [Maple Math] .

What happens for x > 1 (in the partial sum plots) should differ from the behavior of the partial sum plots for x < [Maple Math] .

Thus, in the plots below, values of [Maple Math] strictly between [Maple Math] and 1, should exhibit typical "power series convergence" behavior. Values of [Maple Math] , should exhibit typical "power series divergence (of one type)", while values of x bigger than or equal to 1, should exhibit typical "power series divergence" of another type. The command par_sum_plot , plots several partial sum polynomials together. The graphs get pretty crowded pretty fast, and we'll fix this later. Here's an example of the syntax for the command, followed by it's output, than an explanation of the syntax.

> par_sum_plot(x^n,n=0..5,x=-1.5..1.5,view=[-1.5..1.5,-3..3]);

[Maple Plot]

Like I said, the plots get crowded. The input to the par_sum_plot command is the formula for the nth term of the power series, followed by the range of n values for which you desire the partial sums plotted, the [Maple Math] values over which you'd like to see the plots of the partial sums, and then any regular plot options you desire. I told Maple to plot the partial sums for values of [Maple Math] from 0 to 5, running [Maple Math] from [Maple Math] to 1.5, and then display the plots using a view ing window that runs from [Maple Math] to 1.5 in the [Maple Math] direction and [Maple Math] to 3 in the [Maple Math] direction.

>

Adding the option insequence = true , will tell Maple to plot the partial sums as an animation (or movie), or one at a time, depending on which animation buttons we press. Here's the same command as above, with this new option and a few more partial sums.

> par_sum_plot(x^n,n=0..10,x=-1.5..1.5,view=[-1.5..1.5,-3..3],insequence=true);

[Maple Plot]

You should see just a single partial sum plotted above (the one for n = 0, namely [Maple Math] ).

Click on the graph above. A frame should appear around the plot, and the text buttons near the top of the window should change into animation buttons.

The buttons are (from left to right) STOP, a square; PLAY, a right triangle; FRAME PLAY, a right arrow hitting a wall; REVERSE, a left arrow; FORWARD, a right arrow; SLOW DOWN, 2 left triangles; SPEED UP, two right triangles; SINGLE CYCLE, a left-right arrow; and LOOP, a circular arrow.

The stop, forward and single cycle buttons should be selected (they look as if they are pressed in). To step through the plots one frame at a time, press the frame play button repeatedly.

Press the slow down button several times and then the play button. The movie may run too fast.

To rewind the movie, press the reverse button, then the play button.

I've cut the y values off, so you can see the behavior of convergence better. Reset the view to run from [Maple Math] to 10 in the [Maple Math] direction (just edit the [Maple Math] ..3 part of the view option above), and replay the movie so you see what's happening for x values larger than 1.

The 3 types of behavior you should see might be described as

jumps around like an excited dog's tail

seems to stop moving as n gets bigger, and

just keeps on growing.

For values of [Maple Math] between [Maple Math] and 1, which type of behavior do the graphs suggest?

For x = [Maple Math] , which type of behavior do the graphs show?

For x = 1, which type of behavior do the graphs show?

>

>

Here are numeric values for the first 11 partial sums for x = [Maple Math] (note the use of evalf , to tell Maple that decimal outputs are desired).

> par_sum(evalf((1/2)^n),n=0..10);

[Maple Math]
[Maple Math]

They appear to be settling down, or converging, or not moving very much as n gets bigger.

Look at the first 11 partial sums for x = 1 and x = [Maple Math] . Are these numeric values consistent with the graphical behaviors above?

>

>

>

>

>

>

Now some high powered Maple graphics to better illustrate what's happening. I'll display with each partial sum, the function that the sums are converging to, and a label stating what value [Maple Math] has. By changing certain pieces of this Maple code (I'll explain which later) you can do similar investigations. For now, don't concern yourself with the Maple code, you can answer all the questions simply by watching the output .

> xmin:=-1.5:
xmax:=1.5:
ymin:=-2:
ymax:=5:
nmin:=0:
nmax:=20:
TERMS:=x^n:
limfcn:=1/(1-x):
background:=plot(limfcn,x=xmin..xmax,view=[xmin..xmax,ymin..ymax],color=black,
discont=true):
parsums:=[par_sum(TERMS,n=nmin..nmax)]:
graphs:=[seq(plot(parsums[k],x=xmin..xmax,view=[xmin..xmax,ymin..ymax],
color=red,axes=normal),k=1..nops(parsums))]:
frames:=seq(display([background,graphs[k],TEXT([.2*xmax,.8*ymax],`n = `,
ALIGNLEFT), TEXT([.2*xmax,.8*ymax],convert(nmin+k-1,name),ALIGNRIGHT)]), k=1..nops(graphs)):
display(frames,insequence=true,view=[xmin..xmax,ymin..ymax]);

[Maple Plot]

>

Click on the plot above, slow down the speed and play the movie, or step by frames through the animation. Notice that even though the limiting function [Maple Math] is well behaved for x less than or equal to [Maple Math] , the partial sums of the power series are not. If you look closely, you'll see the [Maple Math] value where the dog's tail attaches to the graph of the limiting function move towards x = [Maple Math] . Partial sums for larger and larger [Maple Math] values would eventually move this point as close as you'd like to [Maple Math] , but it will never reach [Maple Math] . The power series diverges at [Maple Math] via oscillation, while it diverges at x = 1 simply by growing larger and larger. This is illustrated by the graphs.

>

If we apply the ratio test to the power series, we get algebraic proof of these graphical predictions. Here's the ratio test via Maple. Start by defining the n-th term as a function of n.

> a:=n->x^n;

[Maple Math]

Compute the ratio:

> ratio1:=abs(a(n+1)/a(n));

[Maple Math]

Tell Maple that n is a positive integer and ask Maple to simplify the ratio:

> assume(n,posint):
simplify(ratio1);

[Maple Math]

Now let n go to infinity. Since n disappeared, we get L = [Maple Math] . When L is less than 1 we have absolute convergence; when L is larger than 1, we have divergence; when L = 1, the ratio test gives no information, and we investigate by hand the convergence for these [Maple Math] values.

Substituting x = 1, and [Maple Math] into the power series yields:

> case1:=subs(x=1,Sum(a(n),n=0..infinity));
caseminus1:=subs(x=-1,Sum(a(n),n=0..infinity));

[Maple Math]

[Maple Math]

And the first several partial sums for each case show the divergence patterns.

> par_sum(1^n,n=0..10);
par_sum((-1)^n,n=0..10);

[Maple Math]

[Maple Math]

Now, remove the assumption that [Maple Math] is a positive integer (use the single quote, not the back quote):

> n:='n';

[Maple Math]

When a power series is expressed with pure powers of [Maple Math] (as opposed to something like powers of ( [Maple Math] ) ), the power series will converge absolutely for an interval of [Maple Math] values, say -R < x < R, with the center of the interval being [Maple Math] . R is called the radius of convergence , and what happens at x = R and x = [Maple Math] , must be investigated "by hand". Normally, the radius of convergence comes from applying the ratio test and setting L < 1. When L is less than one regardless of the value of [Maple Math] , the radius of convergence is infinite, so the power series converges for all [Maple Math] .

Apply the ratio test to the second series, [Maple Math] . You should get an infinite radius of convergence.

>

>

>

>

The plot below is an animation of the first 15 partial sums of a power series. The function to which the partial sums are converging, is not shown however.

Make a rough guess of the radius of convergence (the value of R so that one sees "converging behavior" for [Maple Math] < x < [Maple Math] ).

> par_sum_plot(3*(-1)^n*x^(2*n)/(8^n),n=0..15,x=-3..3,insequence=true);

[Maple Plot]

>

>

Next time, we'll work on calculating this power series' radius of convergence, and finding the magic formula for which function it converges to!

>