%MIT OpenCourseWare: https://ocw.mit.edu
%18.100A / 18.1001 Real Analysis, Fall 2020
%License: Creative Commons BY-NC-SA 
%For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.

\noindent We continue our study of convergence tests.

\begin{theorem}[Ratio test]
Suppose $x_n \neq 0$ for all $n$ and 
\[
L = \lim_{n\to \infty} \frac{|x_{n+1}|}{|x_n|}
\]
exists. Then,
\begin{enumerate}
\item if $L<1$ then $\sum x_n$ converges absolutely. 
\item if $L>1$ then $\sum x_n$ diverges.
\end{enumerate}
\end{theorem}
\textbf{Proof}: We will first prove the second part of this theorem. 
\begin{enumerate}
    \item[2)] Suppose $L >1$ and $\alpha \in (1,L)$. Then, there exists $M_0 \in \NN$ such that for all $N\geq M_0$, $\frac{|x_{n+1}|}{|x_n|} \geq \alpha \geq 1$. Thus, for all $n\geq M_0$,
\[
|x_{n+1}| \geq |x_n| \implies \lim_{n\to \infty} |x_n| \neq 0.
\]
Therefore, $\sum x_n$ diverges.

\item[1)] Now suppose that $L<1$. Let $\alpha \in (L,1)$. Then, there exists $M_0 \in \NN$ such that $\forall n\geq M_0$, $\frac{|x_{n+1}|}{|x_n|}< \alpha$. Therefore,$\forall n\geq M_0$, $|x_{n+1}| \leq \alpha |x_n|$. In other words, for all $n\geq M_0$,
\[
|x_n| \leq \alpha |x_{n-1}| \leq\alpha^2 |x_{n-2}| \leq \dots \leq \alpha^{n-M_0} |x_{M_0}|.
\]

Let $m\in \NN$. Then, 
\begin{align*}
    \sum_{n=1}^m |x_n| &= \sum_{n=1}^{M_0-1} |x_n| + \sum_{n=M_0}^m |x_n| \\
    &\leq \sum_{n=1}^{M_0-1} |x_n| + |x_{M_0}|\sum_{n=M_0}^m \alpha^{n-M_0} \\
    &\leq \sum_{n=1}^{M_0-1} |x_n| + |x_{M_0}| \sum_{\ell = 0}^\infty \alpha^\ell \\
    &= \sum_{n=1}^{M_0-1} |x_n| + \frac{|x_{M_0}|}{1-\alpha}.
\end{align*}
Therefore, $\left\{\sum_{n=1}^m |x_n|\right\}_{m=1}^\infty$ is bounded, and thus $\sum |x_n|$ converges. Hence, $x_n$ is absolutely convergent.
\end{enumerate}\qed 

Let's consider two examples where we can use the Ratio test.
\begin{example}
Show the series $\sum_{n=1}^\infty \frac{(-1)^n}{n^2 + 1}$ converges absolutely.
\end{example}
\begin{proof}
Notice
    \[
    \left|\frac{(-1)^n}{n^2+1}\right| \leq \frac{1}{n^2 + 1} < \frac{1}{n^2},
    \]
    and hence 
    \[
    \lim_{n\to \infty} \left|\frac{\frac{(-1)^{n+1}}{(n+1)^2+1}}{\frac{(-1)^{n}}{n^2+1}}\right| < \lim_{n\to \infty} \frac{n^2}{(n+1)^2} = 1.
    \]
\end{proof}

\begin{example}
Show that $\forall x\in \RR$, $\sum_{n=0}^\infty \frac{x^n}{n!}$ converges absolutely. 
\end{example}
\begin{proof}
This immediately follows from the Ratio test, noting that
    \[
    \lim_{n\to \infty} \frac{|x|^{n+1}}{(n+1)!} \cdot \frac{n!}{|x|^n} = \lim_{n\to \infty} \frac{|x|}{n+1} = 0.
    \]
\end{proof}

\begin{remark}
As seen above, the Ratio test can be really helpful to use when we have a $(-1)^n$ or a factorial in the argument. Also note that if $L = 1$ then we the test doesn't apply.
\end{remark}

\begin{theorem}[Root test]
Let $\sum x_n$ be a series and suppose that 
\[
L = \lim_{n\to \infty} |x_n|^{1/n}
\]
exists. Then,
\begin{enumerate}
\item if $L<1$ then $\sum x_n$ converges absolutely. 
\item if $L>1$ then $\sum x_n$ diverges.
\end{enumerate}
\end{theorem}
\textbf{Proof}: 
\begin{enumerate}
    \item Suppose $L<1$. Let $L < r < 1$. Then, since $|x_n|^{1/n} \to L$,  $\exists M \in \NN$ such that $\forall n \geq M$, $|x_n|^{1/n} < r$. Therefore, for all $n\geq M$, $|x_n| \leq r^n$. Thus, for all $m\in \NN$,
\begin{align*}
    \sum_{n=1}^m |x_n| &= \sum_{n=1}^{M-1} |x_n| + \sum_{n=M}^m |x_n| \\
    &\leq \sum_{n=1}^{M-1} |x_n| + \sum_{n=M}^m r^n \\
    &\leq \sum_{n=1}^{M-1}|x_n| + \sum_{n=M}^\infty r^n \\
    &= \sum_{n=1}^{M-1} |x_n| + \frac{r^M}{1-r}.
\end{align*}
Thus, $\left\{\sum_{n=1}^m |x_n|\right\}_{m=1}^\infty$ is bounded, and thus $\sum |x_n|$ converges.

    \item Suppose $L>1$. Then, since $|x_n|^{1/n}\to L>1$, there exists an $M\in \NN$ such that for all $n\geq M$, $|x_n|^{1/n} >1$. In other words, for all $n\geq M$, $|x_n| >1$. Therefore, $\lim_{n\to \infty} x_n \neq 0$, and thus $\sum x_n$ diverges.
\end{enumerate}
\qed 

\begin{remark}
Again, note that if $L = 1$ then the test doesn't apply.
\end{remark}

\begin{theorem}[Alternating Series test]
Let $\{x_n\}$ be a monotone decreasing sequence such that $x_n \to 0.$ Then, $\sum (-1)^n x_n$ converges.
\end{theorem}
\textbf{Proof}: Let $s_m = \sum_{n=1}^m (-1)^n x_n$. Then,
\begin{align*}
    s_{2k} &= \sum_{n=1}^{2k} (-1)^n x_n \\
    &= (x_2 - x_1) + (x_4-x_3) + \dots + (x_{2k} - x_{2k-1}) \\
    &\geq (x_2-x_1) + \dots + (x_{2k}-x_{2k-1}) + (x_{2k+2} -x_{2k+1}) \\
    &= s_{2(k+1)}
\end{align*}
as $\{x_n\}$ is a monotone decreasing sequence. Thus, $\{s_{2k}\}_{k=1}^\infty$ is monotone decreasing. Furthermore, 
\[
s_{2k} = -x_1 + (x_2-x_3) + (x_4-x_5) + \dots + (x_{2k-2}-x_{2k-1}) + x_{2k} \geq -x_1.
\]
In other words, $\{s_{2k}\}$ is a bounded below monotone decreasing sequence. Thus, $\{s_{2k}\}_{k=1}^\infty$ converges. Let $s = \lim_{k\to \infty} s_{2k}.$ We now prove $\{s_m\}_{m=1}^\infty$ converges to $s$.

Let $\epsilon>0$. Since $s_{2k}\to s$, $\exists M_0 \in \NN$ such that for all $k\geq M_0$, 
\[
|s_{2k}-s| < \frac{\epsilon}{2}.
\]
Since $x_n \to 0$, $\exists M_1 \in \NN$ such that $\forall n\geq M_1$, 
\[
|x_n|< \frac{\epsilon}{2}.
\]
Choose $M = \max\{2M_+0+1, M_1\}$. Suppose $m\geq M$. If $m$ is even, then $\frac{m}{2} \geq M_0 + 1/2 \geq M_0$. Therefore, 
\[
|s_m - s| = |s_{2\cdot \frac{m}{2}} - s| < \frac{\epsilon}{2} < \epsilon.
\]
If $m$ is odd, let $k = \frac{m-1}{2}$ so $m = 2k+1$. Then, $m\geq M\implies k\geq M_0$ and $m\geq M_1$. Then,
\begin{align*}
    |s_m-s| &= |s_{m-1} + x_m - s| \\
    &\leq |s_{2k}-s + x_m| \\
    &\leq |s_{2k}-s| + |x_m| < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon.
\end{align*}
Thus, $s_m\to s$, and thus $\sum (-1)^n x_n$ converges. \qed 

\begin{corollary}
We already showed that $\sum \frac{(-1)^n}{n}$ does not absolutely converge. However, $\sum \frac{(-1)^n}{n}$ converges.
\end{corollary}
\textbf{Proof}: This follows immediately from the Alternating Series test.

\begin{theorem}
Suppose $\sum x_n$ converges absolutely and $\sum x_n = x$. Let $\sigma: \NN \to \NN$ be a bijective function. Then, $\sum x_{\sigma(n)}$ is absolutely convergent and $\sum x_{\sigma(n)} = x$. In other words, absolute convergence implies if we rearrange the sequence the new  series will still converge to the same value of the original series.
\end{theorem}
\textbf{Proof}: We first show $\sum |x_{\sigma(n)}|$ converges, which is equivalent to showing the partial sums $\sum_{n=1}^m |x_{\sigma(n)}|$ is bounded. Since $\sum x_n$ converges, $\exists B\geq 0$ such that for all $\ell \in \NN$, 
\[
\sum_{n=1}^\ell |x_n| \leq B.
\]
Let $m\in \NN$. Then, $\sigma(\{1,\dots, m\})$ is a finite subset of $\NN$. Thus, there exists an $\ell \in \NN$ such that 
\[
\sigma(\{1,\dots, m\}) \subset \{1,\dots, \ell\}.
\]
Thus, 
\[
    \sum_{n=1}^m |x_{\sigma(n)}| = \sum_{n\in \sigma(\{1,\dots, m\})} |x_n| \leq \sum_{n=1}^\ell |x_n| \leq B.
\]
Therefore, $\sum |x_{\sigma(n)}|$ converges. Let $x = \sum_{n=1}^\infty x_n$, and let $\epsilon>0$. Then, $\exists M_0 \in \NN$ such that $\forall m\geq M_0$, 
\[
\left|\sum_{n=1}^m x_n - x\right| < \frac{\epsilon}{2}.
\]
Since $\sum |x_n|$ converges, $\exists M_1\in \NN$ such that for all $\ell>m\geq M_1$, 
\[
\sum_{n=m+1}^\ell |x_n| < \frac{\epsilon}{2}.
\]
Let $M_2 = \max \{M_0, M_1\}$. Then, $\forall \ell > m \geq M_2$, 
\[
\left|\sum_{n=1}^m x_n-x\right| < \frac{\epsilon}{2} \hspace{.25cm} \text{and} \hspace{.25cm} \sum_{n=m+1}^\ell |x_n| < \frac{\epsilon}{2}.
\]
Since $\sigma^{-1}(\{1,\dots, M_2\})$ is a finite set, $\exists M_3 \in \NN$ such that 
\[
\{1,\dots, M_2\}\subset \sigma(\{1,\dots, M_3\}).
\]
Choose $M = M_3$. Thus, if $m'\geq M$, 
\begin{align*}
    \left|\sum_{n'=1}^{m'} x_{\sigma(n')}-x\right| &= \left|\sum_{n\in \sigma(\{1,\dots, m'\})} x_n - x\right| \\
    &= \left|\sum_{n=1}^M x_n - x + \sum_{n\in \sigma(\{1,\dots, m'\})\setminus \{1,\dots, M\}} x_n\right| \\
    &\leq \left|\sum_{n=1}^M x_n - x\right| + \sum_{n=M+1}^{\max \sigma(\{1,\dots, m'\})} |x_n| \\
    &\leq \left|\sum_{n=1}^M x_n - x\right| + \sum_{n=M+1}^{\ell} |x_n| \\
    &< \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon.
\end{align*}\qed 

%stopped 6:50