DOC PREVIEW
IIT MATH 152 - Lab 6 - SequencesSeries

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Math 152 Lab 6 - Sequences and Infinite SeriesIntroductionIn this notebook, we will learn about sequences, series, and convergence. First, we will use Mathematica to construct and plotterms of sequences, and to find the limits of sequences. We will see how Mathematica treats sequences that do not converge.Later, we will find the values of infinite series and construct partial sums. We will also show how to use the Integral Test toestimate the values of series.SequencesIn Mathematica, finite sequences can be generated using the Table command. The first argument is the expression that definesthe terms of the sequence, and the second argument is the range over which to evaluate the expressionIn[1]:=s@n_D := 1 ê n^2Table@s@nD, 8n, 1, 25<DOut[2]=:1,14,19,116,125,136,149,164,181,1100,1121,1144,1169,1196,1225,1256,1289,1324,1361,1400,1441,1484,1529,1576,1625>We can also define sequences recursively using RecurrenceTable. The first argument is a list of equations that must besatisfied (generally the recurrence relation and any initial conditions), the second argument is the dependent variable in theequations, and the final argument is the range over which to evaluate the expression:In[3]:=RecurrenceTable@8f@nD  f@n − 1Dê2 + 1, f@1D  5<,f,8n, 1, 25<DOut[3]=:5,72,114,198,3516,6732,13164,259128,515256,1027512,20511024,40992048,81954096,16 3878192,32 77116 384,65 53932 768,131 07565 536,262 147131 072,524 291262 144,1 048579524 288,2 0971551 048576,4 1943072 097152,8 3886114194304,16 7772198388608,33 55443516777216>We can visualize a sequence using the ListPlot command. Without any arguments, it produces a type of plot called a point plot:In[4]:=ListPlot@Table@s@nD, 8n, 1, 25<D, PlotRange → AllDOut[4]=5 10 15 20 250.20.40.60.81.0We can use the Filling option to make it more explicit which point goes where:In[5]:=ListPlot@Table@s@nD, 8n, 1, 25<D, Filling → Axis, PlotRange → AllDOut[5]=We can also use the BarChart fuction to display everything as boxes instead of points:2 Lab 6 - SequencesSeries.nbIn[6]:=BarChart@Table@s@nD, 8n, 1, 25<D, BarSpacing → NoneDOut[6]=Infinite sequences are generated the same way as functions.In[7]:=a@n_D := 7 ∗ n êHn^3 + 1La@1Da@2Da@3Da@4Da@5DOut[8]=72Out[9]=149Out[10]=34Out[11]=2865Out[12]=518In order for the function we've defined to be treated as a sequence, we have to specify the domain as the natural numbers. This isdone by passing the Assumptions option:In[13]:=b@n_D := Sin@Pi ∗ nDTable@b@nD, 8n, 1, 25<DLimit@b@nD,n→ InfinityDLimit@b@nD,n→ Infinity, Assumptions → 8Element@n, IntegersD,n≥ 0<DOut[14]=80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0<Out[15]=Interval@8− 1, 1<DOut[16]=0If a sequence is convergent, then its limit at infinity exists and is finite. A sequence is divergent if its limit at infinity is infinite. Asequence is neither convergent nor divergent if its limit at infinity does not exist, but isn't infinite either. When evaluating limits,Lab 6 - SequencesSeries.nb 3Mathematica handles convergent sequences by giving the limit, divergent sequences by giving ±¶, and neither convergent nordivergent sequences by giving the region over which the sequence varies.In[17]:=Limit@1 ê n, n → Infinity, Assumptions → 8Element@n, IntegersD,n≥ 0<DLimit@n, n → Infinity, Assumptions → 8Element@n, IntegersD,n≥ 0<DLimit@Sin@nD,n→ Infinity, Assumptions → 8Element@n, IntegersD,n≥ 0<DOut[17]=0Out[18]=∞Out[19]=Interval@8− 1, 1<DSeriesWe define infinite series in Mathematica the same way that we write them in class, by writing the upper limit of a sum as infinity:In[20]:=Sum@H1 ê 2L^n, 8n, 1, Infinity<DOut[20]=1Nonconvergent series are not handled the same way as with sequences:In[21]:=Sum@1 ê n, 8n, 1, Infinity<DSum@Sin@HPi ê 2L ∗ nD, 8n, 1, Infinity<DSum::div : Sum does not converge. àOut[21]=‚n=1∞1nSum::div : Sum does not converge. àOut[22]=‚n=1∞SinBn π2FRegardless of whether the series converges, we can define a sequence consisting of the partial sum of a series out to some numberof terms:In[23]:=partialsum@n_D := Sum@H1 ê 2L^i, 8i, 1, n<DN@partialsum@5DDOut[24]=0.96875We can then take the limit of this sequence to get some idea of how the series behaves:In[25]:=Limit@partialsum@nD,n→ InfinityDOut[25]=1A nonconvergent example would look like this:4 Lab 6 - SequencesSeries.nbIn[26]:=nonconvergentpartialsum@n_D := Sum@Sin@HPi ê 2L ∗ iD, 8i, 1, n<DLimit@nonconvergentpartialsum@nD,n→ InfinityDOut[27]=IntervalB:−12,32>FWe can check for convergence with the integral test:In[28]:=Limit@Integrate@H1 ê 2L^n, 8n, 1, x<D,x→ InfinityDLimit@Integrate@1 ê n, 8n, 1, x<D,x→ InfinityDLimit@Integrate@Sin@HPi ê 2L ∗ nD, 8n, 1, x<D,x→ InfinityDOut[28]=1Log@4DOut[29]=∞Out[30]=IntervalB:−2π,2π>FWe can also obtainan estimateof the error between a partial sum and the true sum using the integral test. Tounderstand how this works, let' s look at a plot of a function and the sequence generated from the function::In[31]:=a@x_D := 7 ∗ x êHx^3 + 1LShow@BarChart@Table@a@nD, 8n, 1, 50<D,PlotRange → 881, 50<, 80, 0.25<<, BarSpacing → NoneD,Plot@a@xD, 8x, 1, 50<, PlotStyle → Red, PlotRange → 881, 50<, 80, 0.25<<DDOut[32]=The sequence values are represented by the boxes, while the function values are represented by the red line. The series consistingof the sum over this sequence would be the area of the boxes. The integral would be the area under the red line. As we can see,the sequence and function correspond, but not the series and integral. However, the error between the series and the integraldepends on the function values. For convergent series, this means that the integral's value is a closer approximation for a series'value over the same regions, the further away from the origin we get.Let's look at the same plot from a different perspective:Lab 6 - SequencesSeries.nb 5In[33]:=Show@BarChart@8Table@a@nD, 8n, 1, 25<D, Table@a@nD, 8n, 26, 50<D<,PlotRange → 880, 50<, 80, 0.25<<, BarSpacing → None,ChartStyle → 88LightBlue, Blue<, None<D,Plot@a@xD, 8x, 0, 50<, PlotStyle → Red, PlotRange → 880, 50<, 80, 0.25<<DDOut[33]=Comparing the integral over the region from 1 to 25, to the area enclosed by the light blue rectangles, we see there are errors.However, if we compare the integral over the region from 26 to 50 to the dark blue rectangles, the errors are much less in magni-tude. If we extend the dark blue rectangles to infinity, then we can


View Full Document

IIT MATH 152 - Lab 6 - SequencesSeries

Download Lab 6 - SequencesSeries
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 6 - SequencesSeries and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 6 - SequencesSeries 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?