Section 17.2 Defining and Evaluating Series
We use the capitalized
Sum() command to display the summation notation for a series symbolically. This also makes it possible to assign a name to the sum and use it in other commands later. Much like with sequences, we need an expression for a generic term in the series using an index, such as \(k\text{.}\) We then specify the range for the index that generates the terms in that sequence that are to be summed.
For a simple example, we can add the five values from the sequence \(\left\lbrace2k^2-k\right\rbrace_{k=1}^5\) in SectionΒ 17.1. This is a finite series, since only finitely many terms are summed.
> s1 := Sum(2*k^2-k, k=1..5);
\begin{equation*}
\displaystyle s\mathit{1}\, := \,\sum _{k=1}^{5}2\,{k}^{2}-k
\end{equation*}
We may use the
value() command on the result of a capitalized Sum() command to display the result. Alternatively, the lowercase sum() command directly evaluates the value of the sum, without displaying the series.
> value(s1);
\begin{equation*}
\displaystyle 95
\end{equation*}
> sum(2*k^2-k, k=1..5);
\begin{equation*}
\displaystyle 95
\end{equation*}
To determine the value of an infinite sequence, we can use
infinity as the a bound on the index. The value of an infinite sum may be a value (in the case of a convergent sum) or \(\pm\infty\) (in the case of a divergent sum).
> Sum((2/3)^k, k=0..infinity); value(%);
\begin{equation*}
\displaystyle \sum _{k=0}^{\infty } \left( 2/3 \right) ^{k}
\end{equation*}
\begin{equation*}
\displaystyle 3
\end{equation*}
This infinite series gives us a finite sum, so it is said to be convergent.
> Sum(sin(k)+1, k=1..infinity); value(%)
\begin{equation*}
\displaystyle \sum _{k=1}^{\infty }\sin \left( k \right) +1
\end{equation*}
\begin{equation*}
\displaystyle \infty
\end{equation*}
The infinite sum \(\,\,\,\,\displaystyle\sum_{k=1}^{\infty} (\sin(k)+1)\) is said to be divergent.
