%% Created by Maple V Release 4 (APPLE_PPC_MAC)
%% Source Worksheet: PowerSeries.mws
%% Generated: Sat Nov  2 11:23:38 1996
%\documentclass{article}
%\usepackage{maple2e}
%\DefineParaStyle{Heading 1}
%\DefineParaStyle{Heading 2}
%\DefineParaStyle{Maple Output}
%\DefineParaStyle{Maple Plot}
%\DefineParaStyle{Title}
%\DefineCharStyle{2D Comment}
%\DefineCharStyle{2D Math}
%\DefineCharStyle{2D Output}
%\DefineCharStyle{Hyperlink}
%\begin{document}

\begin{maplegroup}
\begin{Title}
\QTR{Hyperlink}{Real Analysis with Maple}
\end{Title}

\end{maplegroup}

\setcounter{section}{6}
\section{Power Series and Convergence}

\subsection{Power Series}

A power series is a series of the form

\begin{center}
 
\mapleinline{inert}{2d}{f(x)=a[0] + Sum(a[k]*x^k, k=1..infinity)}{%
${\rm f}(x)={a_{0}} + (\sum _{k=1}^{\infty }\,{a_{k}}\,x^{k})$%
} 
\end{center}

(In Maple, it�s best to avoid 
\mapleinline{inert}{2d}{x^0}{%
$x^{0}$%
}.)

\subsection{Ratio Test}

The ratio test is easy to implement.

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{a := n -> n!*(2*n)!/(3*n)!;}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
a := n\rightarrow {\displaystyle \frac {n{\rm !}\,(2\,n){\rm !}}{
(3\,n){\rm !}}} 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{r := a(n+1)*x^(n+1)/(a(n)*x^n);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
r := {\displaystyle \frac {(n + 1){\rm !}\,(2\,n + 2){\rm !}\,x^{
(n + 1)}\,(3\,n){\rm !}}{(3\,n + 3){\rm !}\,n{\rm !}\,(2\,n){\rm 
!}\,x^{n}}} 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{rho := limit(r, n=infinity);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
\rho  := {\displaystyle \frac {4}{27}} \,x
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{solve(abs(rho)<1, x);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
{\rm RealRange}({\rm Open}({\displaystyle \frac {-27}{4}} ), \,
{\rm Open}({\displaystyle \frac {27}{4}} ))
\]
\end{maplelatex}

\end{maplegroup}
Since the ratio is less than 1, the power series converges for 
\mapleinline{inert}{2d}{abs(x)<1}{%
$ \left|  \! \,x\, \!  \right|  < 1$%
}. Does it converge to a well-known function?

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{1+sum(a(n)*x^n, n=1..infinity);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
1 + {\displaystyle \frac {1}{3}} \,x\,{\rm hypergeom}([2, \,1, \,
{\displaystyle \frac {3}{2}} ], \,[{\displaystyle \frac {5}{3}} 
, \,{\displaystyle \frac {4}{3}} ], \,{\displaystyle \frac {4}{27
}} \,x)
\]
\end{maplelatex}

\end{maplegroup}
Yes and no!

\subsection{Root Test}

The root test is just as easy to implement.

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{rt := a(n)^(1/n);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
{\it rt} := ({\displaystyle \frac {n{\rm !}\,(2\,n){\rm !}}{(3\,n
){\rm !}}} )^{(\frac {1}{n})}
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{rho := limit(rt*x, n=infinity);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
\rho  := {\displaystyle \frac {4}{27}} \,x
\]
\end{maplelatex}

\end{maplegroup}
And the rest is the same.

\subsection{Limit Comparison Test}

One of the most useful tests is the Limit Comparison test.

Let

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{a := n -> (sin(n)+n)/(2*n^2+n+1);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
a := n\rightarrow {\displaystyle \frac {{\rm sin}(n) + n}{2\,n^{2
} + n + 1}} 
\]
\end{maplelatex}

\end{maplegroup}
Since 
\mapleinline{inert}{2d}{sum(1/n,n=1..infinity)}{%
$\sum _{n=1}^{\infty }\,\frac {1}{n}$%
} diverges and

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{limit(a(n)/(1/n), n=infinity);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
{\displaystyle \frac {1}{2}} 
\]
\end{maplelatex}

\end{maplegroup}
Then 
\mapleinline{inert}{2d}{sum(a[n])}{%
$\sum _{}\,{a_{n}}$%
} diverges.

On the other hand,

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{b := n -> (2+n)/(2*n^3+n+1);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
b := n\rightarrow {\displaystyle \frac {2 + n}{2\,n^{3} + n + 1}
} 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{limit(b(n)/(1/n^2), n=infinity);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
{\displaystyle \frac {1}{2}} 
\]
\end{maplelatex}

\end{maplegroup}
shows that 
\mapleinline{inert}{2d}{sum(b[n])}{%
$\sum _{}\,{b_{n}}$%
} converges.

\subsection{Integral Test}

The Integral test quickly becomes a student�s favorite with Maple.

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{c := n -> sin(n)/n;}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
c := n\rightarrow {\displaystyle \frac {{\rm sin}(n)}{n}} 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{sum(c(n), n=1..infinity);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
{\displaystyle \sum _{n=1}^{\infty }} \,{\displaystyle \frac {
{\rm sin}(n)}{n}} 
\]
\end{maplelatex}

\end{maplegroup}
\textit{What do you think}?

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{evalf(Int(c(x),x=1..infinity));}{%
}
\end{mapleinput}

\end{maplegroup}

\subsection{Fourier Series}

The Fourier Series of a function 
\mapleinline{inert}{2d}{f(x)}{%
${\rm f}(x)$%
} is given by

\begin{center}
 
\mapleinline{inert}{2d}{F(x)=a[0]/2+sum(a[k]*cos(k*x)+b[k]*sin(k*x),k=
1..infinity)}{%
${\rm F}(x)=\frac {{a_{0}}}{2} + (\sum _{k=1}^{\infty }\,({a_{k}}
\,{\rm cos}(k\,x) + {b_{k}}\,{\rm sin}(k\,x)))$%
} 
\end{center}

where

\begin{center}
 
\mapleinline{inert}{2d}{a[k] = 1/Pi}{%
${a_{k}}=\frac {1}{\pi }$%
} 
\mapleinline{inert}{2d}{int(cos(k*t)*f(t),t=-Pi..Pi)}{%
$\int _{ - \pi }^{\pi }{\rm cos}(k\,t)\,{\rm f}(t)\,dt$%
}   and   
\mapleinline{inert}{2d}{b[k] = 1/Pi}{%
${b_{k}}=\frac {1}{\pi }$%
} 
\mapleinline{inert}{2d}{int(sin(k*t)*f(t),t=-Pi..Pi)}{%
$\int _{ - \pi }^{\pi }{\rm sin}(k\,t)\,{\rm f}(t)\,dt$%
} 
\end{center}

What is the Fourier series of the Heaviside function?

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{a := (f,k) -> int(cos(k*t)*f(t),t=-Pi..Pi)/Pi;}{}
\mapleinline{active}{1d}{b := (f,k) -> int(sin(k*t)*f(t),t=-Pi..Pi)/Pi;}{}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
a := (f, \,k)\rightarrow {\displaystyle \frac {{\displaystyle 
\int _{ - \pi }^{\pi }} {\rm cos}(k\,t)\,f(t)\,dt}{\pi }} 
\]
\end{maplelatex}

\begin{maplelatex}
\[
b := (f, \,k)\rightarrow {\displaystyle \frac {{\displaystyle 
\int _{ - \pi }^{\pi }} {\rm sin}(k\,t)\,f(t)\,dt}{\pi }} 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{U := Heaviside:
a(U,k);
normal(b(U,k));}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
{\displaystyle \frac {{\rm sin}(\pi \,k)}{k\,\pi }} 
\]
\end{maplelatex}

\begin{maplelatex}
\[
 - {\displaystyle \frac {{\rm cos}(\pi \,k) - 1}{k\,\pi }} 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{F := (N,x) -> a(U,0)/2 + 
  sum(a(U,k)*cos(k*x)+b(U,k)*sin(k*x), k=1..N);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
F := (N, \,x)\rightarrow {\displaystyle \frac {1}{2}} \,{\rm a}(U
, \,0) + ({\displaystyle \sum _{k=1}^{N}} \,({\rm a}(U, \,k)\,
{\rm cos}(k\,x) + {\rm b}(U, \,k)\,{\rm sin}(k\,x)))
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{\{F(3,x),F(5,x),F(10,x)\};}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\begin{eqnarray*}
\lefteqn{\{{\displaystyle \frac {1}{2}}  + 2\,{\displaystyle 
\frac {{\rm sin}(x)}{\pi }}  + {\displaystyle \frac {2}{3}} \,
{\displaystyle \frac {{\rm sin}(3\,x)}{\pi }}  + {\displaystyle 
\frac {2}{5}} \,{\displaystyle \frac {{\rm sin}(5\,x)}{\pi }} , 
\,{\displaystyle \frac {1}{2}}  + 2\,{\displaystyle \frac {{\rm 
sin}(x)}{\pi }}  + {\displaystyle \frac {2}{3}} \,{\displaystyle 
\frac {{\rm sin}(3\,x)}{\pi }} , } \\
 & & {\displaystyle \frac {1}{2}}  + 2\,{\displaystyle \frac {
{\rm sin}(x)}{\pi }}  + {\displaystyle \frac {2}{3}} \,
{\displaystyle \frac {{\rm sin}(3\,x)}{\pi }}  + {\displaystyle 
\frac {2}{5}} \,{\displaystyle \frac {{\rm sin}(5\,x)}{\pi }}  + 
{\displaystyle \frac {2}{7}} \,{\displaystyle \frac {{\rm sin}(7
\,x)}{\pi }}  + {\displaystyle \frac {2}{9}} \,{\displaystyle 
\frac {{\rm sin}(9\,x)}{\pi }} \}\mbox{\hspace{6pt}}
\end{eqnarray*}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plot(\{U(x)\} union ", x=-Pi..Pi);}{%
}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{7_Powe01.eps}
\end{center}

\end{maplegroup}
Anyone for \textit{Gibb�s phenomenon}?

\subsection{Additional Activities}

Examine the following series:

\begin{center}
 
\mapleinline{inert}{2d}{S(x)=sum(sin(n*x)/ln(n),n=2..infinity)}{%
${\rm S}(x)=\sum _{n=2}^{\infty }\,\frac {{\rm sin}(n\,x)}{{\rm 
ln}(n)}$%
} 
\end{center}

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{b := n -> sin(n*x)/ln(n);}{%
}
\end{mapleinput}

\end{maplegroup}
Plot partial sums ...

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{S := (N,x) -> sum(b(n), n=2..N);}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plots[animate](S(2*k,x), x=0..10, k=1..5);}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plots[display]([seq(plot(S(2*k,x),x=0..10),
k=1..9)], insequence=true);}{%
}
\end{mapleinput}

\end{maplegroup}
The ratio test:

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{r := b(n+1)/b(n);
rho := limit(r, n=infinity);
solve(abs(rho)<1, x);}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
The root test:

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{r := b(n)^(1/n);
rho := limit(r, n=infinity);
solve(abs(rho)<1, x);}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plot(S(150,x),x=0..10);}{%
}
\end{mapleinput}

\end{maplegroup}
What�s the problem?

%\end{document}
%% End of Maple V Output
