Topic 11 Infinite Sequences and Series
11.1 Introduction to Sequences and Series
A sequence is a list of numbers in a definite order (indexed by integers). A series may be considered as the limit of the sequence of partial sums.
When the sequence is explicitly defined by an mathematical expression , Maple has the following command to list numbers of the sequence seq(f, i=m..n, step)
.
Example 11.1 Find the first 10 terms of the sequence . Determine whether the sequence is convergent or divergent.
Solution.
# using seq
seq(1/(n*(n+1)), n=1..10)
The sequence converges to .
For a series , normally it is not easy to find explicit expression for the partial sum . However, if sequence is defined by an mathematical expression , we may find values of partial sums recursively use a for/from loop
statement in Maple:
for *counter* from *initial* by *increment* to *final* do
statement_sequence;
end do;
Example 11.2 Find the first 20 partial sums of the infinite series Determine whether the series is convergent or divergent.
Solution.
# Set up s when n=0
s:=1
# Find 10 terms using `for/from loop`
for n from 1 to 10 do
s:=s+1/(2^n);
end do;
The series converges to 2.
Of course, we may also use for/from loop
to list numbers of a sequence.
Solution. Second solution to example 11.1.
# using `for/from loop`
for n from 1 to 10 do
1/(n*(n+1);
end do;
When the sequence is defined by a recurrence formula like the Fibonacci sequence, we will need to Maple how to interpret the formula. For that purpose, we use a procedure, which encloses a sequence of statements between proc(...)
and end proc
, to define the formula in Maple.
For example, the following is a procedure that defines a function :
a:=proc(x) sqrt(x)-1/sqrt{x}; end proc;
To structure codes in a procedure, you may use Code Edit Region
which can be find in the Insert menu
.
To execute codes within this region, click Execute Code
from the Edit
menu, or use the shortcut command Ctrl+E
.
Example 11.3 The Fibonacci sequence is defined by , and . Find the first 20 Fibonacci numbers.
Solution. We first define a function which returns the -th Fibonacci number.
fib := proc (n::nonnegint)
if 2 <= n then
return fib(n-1)+fib(n-2):
else
return n:
end if;
end proc
Now we can use either seq()
or for/from loop
.
seq(fib(n), n=0..19)
Exercise 11.1 Find the first 20 terms of the sequence Determine whether the sequence is convergent or divergent.
Exercise 11.2 Find the first 20 partial sums of the infinite series Determine whether the series is convergent or divergent.
Exercise 11.3 Find the 20th to 30th Fibonacci numbers.
11.2 Power Series
A power series is a series with a variable :
More generally, a series of the form
is called a power series at .
We call a positive number the radius of convergence of the power series (11.1) if the power series converges whenever and diverges whenever .
If a function has a power series representation, i.e. then its coefficients are given by
Example 11.4 Find the interval of convergence of the power series
Solution.
# Find the abs(a_{n+1}/a_n)
q:=abs((-2)^(n+1)(n+1)^3/(-2)^(n+1)(n+1)^3);
# Find the limit of q
r:=limit(simplify(q), n=infinity)
# Find the interval of convergence
solve(abs(x)<1/r, x)
Example 11.5 Find the Taylor expansion of the function at up to the 5-th order. Plot and the -th order Taylor polynomial together.
Solution.
# Find the Taylor expansion.
ftaylor:=taylor(1/(x-2), x = 0, 5)
# convert the Taylor series into a polynomial
fpoly:=convert(ftaylor, polynom)
# Plot the functions
plot([1/(x-2), fpoly], x=-1..1)
Exercise 11.4 Find the interval of convergence of the power series
Exercise 11.5 Find the Taylor expansion of the function at up to the 5-th order. Plot and the -th order Taylor polynomial together over the interval .
11.3 Taylor Expansion
Let be a function. Assume that the -th order derivatives exist for . The polynomial is called the -th degree Taylor polynomial of at .
Let be a function has derivative at up to all orders. Set which is called the reminder of the Taylor series
If for , then is the sum of the Taylor series on the interval, that is
If for , then the reminder satisfies the follow inequality
Roughly speaking, the absolute value of the reminder determines how accurate the Taylor polynomial approximation.
Example 11.6 Approximate function by the degree 3 Taylor polynomial at .
Solution.
# Find the Taylor series.
fTs:=taylor(sin(x), x = 0, 4)
# Convert the Taylor series into a polynomial
fTp:=convert(fTs, polynom)
# Evaluate the Taylor polynomial at 1
subs(x=1, fpolyapprox)
Example 11.7 Plot the function and its 5-th order Taylor polynomial over the domain . What can you conclude?
Solution.
# Define a piece-wisely defined function.
g:=piecewise(x!=0, exp(-1/x^2), 0)
# Find Taylor polynomial of degree 5.
for n to 5 do T := (eval(diff(g(x), x$n), x = 0))*x^n/factorial(n)+T end do
# Plot the functions
plot([g,T],x=-2..2, color=[red, blue])
The graphs of the functions are shown in the picture.

A non-analytic smooth function
In the solution, x$n
is a shortcut option for x, x, x, x, x
in the diff
command.
Exercise 11.6 Approximate function by the degree 5 Taylor polynomial at .
Exercise 11.7 Compare the function with its degree 10 Taylor polynomial at .