% This is lecture no. 2 of MH1101/: Calculus II.

\chapter{Limit Evaluation}%
\label{cha:limit_evaluation}

\section{Properties of Limits}%
\label{sec:properties_of_limits}

\begin{thrm}
	Interchange Order.
	Suppose $\lim_{n \to \infty}a_n = L$ and $f$ is continuous at $L$.
	Then:
	\[
		\lim_{n \to \infty}f(a_{n}) = f\left(\lim_{n \to \infty}a_n\right) = f(L)
	.\]
\end{thrm}
\begin{exmp}
	Evaluate $\lim_{n \to \infty}\sin(\frac{1}{n})$.
	\[
		\lim_{n \to \infty}\sin\left(\frac{1}{n}\right) = \sin\left(\lim_{n \to \infty}\left(\frac{1}{n}\right)\right) = \sin 0 = 0
	.\]
	
\end{exmp}
\begin{exmp}
	Evaluate $\lim_{n \to \infty}e^{\frac{1}{n}}$.
	\[
	\lim_{n \to \infty}e^{\frac{1}{n}} = e^{\lim_{n \to \infty}\frac{1}{n}} = e^{0} = 1
	.\]
\end{exmp}
\begin{exmp}
	Evaluate $\lim_{n \to \infty}\left(\frac{n^2}{n^2+3}\right)^3$.
	\[
		\lim_{n \to \infty}\left(\frac{n^2}{n^2+3}\right)^3 = \left(\lim_{n \to \infty}\frac{n^2}{n^2+3}\right)^3 = 1^3 = 1
	.\]
\end{exmp}
\begin{proof}
	Interchange Order.
	Let $\epsilon >0$.
	Since $f(x)$ is continuous at $x=L$, $\exists\delta>0$ such that:
	\[
		|x-L|<\delta \implies |f(x)-f(L)|<\epsilon
	.\]
	and this can be rewritten in context to:
	\begin{equation}
		\label{by_1}
		|a_n-L|<\delta \implies |f(a_n)-f(L)|<\epsilon
	\end{equation}
	Since $\lim_{n \to \infty}a_n=L$, $\exists N\in \mathbb{Z}$ such that:
	\begin{align*}
		n > N & \implies |a_n-L|<\delta\\
		      & \implies |f(a_n)-f(L)|<\epsilon && \text{by \cref{by_1}}
	\end{align*}
	And therefore we have proven that:
	\[
		\lim_{n \to \infty}f(a_n) = f(L) = f\left(\lim_{n \to \infty}a_n\right)
	.\]
\end{proof}

\section{Subsequences}%
\label{sec:subsequences}

\begin{definition}
	Subsequence.
	A \textbf{subsequence} (denoted as $\{a_{n_{k}}\}_{k}$) of $\{a_n\}_{n}$ is a sequence obtained from the sequence ${a_n}$, such that:
	\[
	n_1 < n_2 < n_3 \dotsb
	.\]
\end{definition}
\begin{exmp}
	State the terms of the subsequence $\{a_{n^2}\}$:
	\[
	\{a_{n^2}\} = a_1, a_4, a_9, a_{16}, \dotsc
	.\]
\end{exmp}
\begin{exmp}
	State the terms of the subsequence $\{a_{n+3}\}$:
	\[
	\{a_{n+3}\} = a_4, a_5, a_6, a_{7}, \dotsc
	.\]
\end{exmp}
\begin{thrm}
	Convergence of subsequences.
	If $\lim_{n \to \infty}a_n=L$, then every subsequence of $\{a_n\}$ converges to $L$.
\end{thrm}
\begin{exmp}
	We know that:
	\[
	\lim_{n \to \infty}\frac{n}{n+1}=1
	.\]
	Therefore, by the convergence of subsequences, the following limits are true:
	\begin{align*}
		\lim_{n \to \infty}\frac{2n}{2n+1}&=1\\
		\lim_{n \to \infty}\frac{5n+1}{(5n+1) + 1}&=1\\
		\lim_{n \to \infty}\frac{n^2}{n^2+1}&=1
	\end{align*}
\end{exmp}
\begin{proof}
	We want to prove that:
	\[
	\lim_{n \to \infty}a_n=L \implies \lim_{n \to \infty}a_{n_{k}}=L
	.\]
	\begin{note}
		$\{a_{n_{k}}\}$ is a subsequence of $\{a_n\}$.
	\end{note}
	We also know that since $n_k$ is strictly increasing, that the following inequality must hold true:
	\[
	k \leqslant n_k
	.\]
	Now, let $\epsilon>0$.
	We want to show that  $\exists k_0 \in\mathbb{Z}$ such that:
	\[
	|a_{n_{k}}-L|<\epsilon\ \forall k > k_0
	.\]
	Since $\lim_{n \to \infty}a_n=L$:
	\[
		\exists N \in \mathbb{Z}\text{ such that }n>N \implies |a_n-L|<\epsilon
	.\]
	And since $n_k\geqslant k$, for $k>N$, we have $n_k>N$ and therefore:
	\[
	n_k > N \implies |a_{n_{k}}-L|<\epsilon
	.\]
	Proving that:
	\[
	\lim_{n \to \infty}a_{n_{k}}=L
	.\]
\end{proof}

As a consequence, we can conclude that $\lim_{n \to \infty}a_n$ does not exist in the following cases:
\begin{enumerate}
	\item There is a divergent subsequence of $\{a_n\}$.
	\item There are two convergent subsequences of $\{a_n\}$ with different limits.
\end{enumerate}
\begin{exmp}
	Consider the following sequence:
	\[
	a_n =
	\begin{cases}
		\ln\left(\frac{1}{n}\right) & \text{if } n=3k,\\
		\pi & \text{if } n\neq 3k.\\
	\end{cases}
	\]
	Here the subsequence $\{a_{3n}\}=\left\{\ln\left(\frac{1}{3n}\right)\right\}$. Thus it diverges, and therefore the sequence $\{a_n\}$ diverges.
\end{exmp}
\begin{exmp}
	Consider the following sequence:
	\[
		\{a_n\}=\{(-1)^{n}\}
	.\]
	The odd subsequence $\{a_{2n-1}\}=\{-1\}$ while the even subsequence $\{a_{2n}\}=\{1\}$.
	Thus the sequence diverges.
\end{exmp}

\begin{thrm}
	Convergence of odd and even subsequences to the same limit.
	When the odd subsequence and the even subsequence converge to the same limit, then the sequence converges to that same limit.
	\[
	\lim_{n \to \infty}a_{2n} = \lim_{n \to \infty}a_{2n-1}=L
	\iff
	\lim_{n \to \infty}a_n=L
	.\]
\end{thrm}
\begin{exmp}
	Determine the convergence of the following sequence:
	\[
	a_n =
	\begin{cases}
		\frac{2k}{2k+1} & \text{if } n=2k,\\
		e^{1/(2k-1)} & \text{if } n=2k-1.\\
	\end{cases}
	\]
	Evaluating the even subsequence:
	\[
		\lim_{n \to \infty}a_{2n}=\lim_{n \to \infty}\left(\frac{2n}{2n+1}\right)=1
	.\]
	And evaluating the odd subsequence:
	\[
	\lim_{n \to \infty}a_{2n-1}=\lim_{n \to \infty}e^{1/(2k-1)} = e^{\lim_{n \to \infty}\frac{1}{2n-1}}=e^{0}=1
	.\]
	Since both the odd and even subsequences converge to 1, we can conclude:
	\[
	\lim_{n \to \infty}a_n=1
	.\]
\end{exmp}

\section{Techniques}%
\label{sec:techniques}

\subsection{Dividing by the highest power of $n$ in the denominator}%
\label{sub:dividing_by_the_highest_power_of_n_in_the_denominator}

When evaluating the limit of a sequence that is expressed as a fraction, we can divide both the numerator and the denominator by the highest power of $n$ in the denominator:
\begin{exmp}
	Determine if the following sequence converges, and if so, find its limit:
	\[
		a_n = \frac{1+n}{2+n}
	.\]
	Dividing by the highest power of $n$ in the denominator:
	\[
		\lim_{n \to \infty}\frac{1+n}{2+n}
		=
		\lim_{n \to \infty}\frac{1+n}{2+n} \cdot \frac{\frac{1}{n}}{\frac{1}{n}}
		=
		\lim_{n \to \infty}\frac{\frac{1}{n}+1}{\frac{2}{n}+1}
		=
		\frac{0+1}{0+1}=1
	.\]
\end{exmp}
\begin{exmp}
	Determine if the following sequence converges, and if so, find its limit:
	\[
		a_n=\frac{n^2+n+3}{5+n}
	.\]
	Note that:
	\[
		\lim_{n \to \infty}\frac{n^2+n+3}{5+n}
		=
		\lim_{n \to \infty}\frac{n^2+n+3}{5+n}\cdot \frac{\frac{1}{n^2}}{\frac{1}{n^2}}
		=
		\lim_{n \to \infty}\frac{1+\frac{1}{n}+\frac{3}{n^2}}{\frac{5}{n^2}+\frac{1}{n}}
		=\infty
	.\]
	And therefore we can conclude that the sequence diverges.
\end{exmp}
\subsection{Multiplying by the conjugate}%
\label{sub:multiplying_by_the_conjugate}

Certain limits can be rationalised by multiplying them by their conjugate:
\begin{exmp}
	Determine if the following sequence converges, and if so, find its limit:
	\[
		a_n = \sqrt{n^2+2021}-\sqrt{n^2+1101n}
	.\]
	Note that:
	\[
	\lim_{n \to \infty} \sqrt{n^2+2021}-\sqrt{n^2+1101n}\cdot \frac{\sqrt{n^2+2021}+\sqrt{n^2+1101n}}{\sqrt{n^2+2021}+\sqrt{n^2+1101n}}
	.\]
	Evaluates to:
	\[
	\lim_{n \to \infty}\frac{(n^2+2021)-(n^2+1101n)}{\sqrt{n^2+2021}+\sqrt{n^2+1101n}}
	.\]
	And the $n^2$ term cancels out to give:
	\[
	\lim_{n \to \infty}\frac{2021-1101n}{\sqrt{n^2+2021}+\sqrt{n^2+1101n}}
	.\]
	From here we can use the technique in \cref{sub:dividing_by_the_highest_power_of_n_in_the_denominator}:
	\[
	\lim_{n \to \infty}\frac{2021-1101n}{\sqrt{n^2+2021}+\sqrt{n^2+1101n}}\cdot \frac{\frac{1}{n}}{\frac{1}{n}}
	=
	\lim_{n \to \infty}\frac{\frac{2021}{n}-1101}{\sqrt{1+\frac{2021}{n^2}}+\sqrt{1+\frac{1101}{n}}}
	.\]
	And therefore:
	\[
	\lim_{n \to \infty}a_n=-\frac{1101}{2}
	.\]
\end{exmp}

\section{Squeeze Theorem}%
\label{sec:squeeze_theorem}

\begin{thrm}
	Squeeze Theorem.
	Given three sequences $\{a_n\}, \{b_n\}, \{c_n\}$, if there is an integer  $N_0$ such that $\forall n\geqslant N_0$:
	\[
	a_n\leqslant b_n\leqslant c_n
	.\]
	and
	\[
	\lim_{n \to \infty}a_n = \lim_{n \to \infty}c_{n}=L
	.\]
	then:
	\[
	\lim_{n \to \infty}b_n=L
	.\]
\end{thrm}
\begin{exmp}
	Does the following limit exist, and if so, what is its limit?
	\[
	\lim_{n \to \infty}\frac{\cos n}{n}
	.\]
	\begin{note}
		We cannot use the product rule of limits since the rule follows the assumption that the sequences being multiplied together are both convergent, and we know that $\cos n$ is divergent.
	\end{note}
	For $n\geqslant 1$, we have the following inequality:
	\[
	-1\leqslant \cos n \leqslant 1
	.\]
	Multiplying throughout by $\frac{1}{n}$ we obtain:
	\[
	-\frac{1}{n}\leqslant \frac{\cos n}{n} \leqslant \frac{1}{n}
	.\]
	Since we know that:
	\[
	\lim_{n \to \infty}\frac{1}{n}=0=\lim_{n \to \infty}-\frac{1}{n}
	.\]
	By the squeeze theorem, we can conclude that:
	\[
		\lim_{n \to \infty}\frac{\cos n}{n}=0
	.\]
\end{exmp}
\begin{exmp}
	Does the following limit exist, and if so, what is its limit?
	\[
	\lim_{n \to \infty}\frac{3^{n}}{n!}
	.\]
	For $n\geqslant 4$, we have:
	\[
	0< \frac{3^{n}}{n!}=\frac{3}{1} \frac{3}{2} \frac{3}{3} \underbrace{\frac{3}{4} \cdots \frac{3}{n-1}}_{<1} \frac{3}{n}
	.\]
	By replacing terms where $n\geqslant 4$ with 1, we see the following inequality:
	\[
	\frac{3}{1} \frac{3}{2} \frac{3}{3} \underbrace{\frac{3}{4} \cdots \frac{3}{n-1}}_{<1} \frac{3}{n}
	\leqslant
	\frac{3}{1} \frac{3}{2} \frac{3}{3} \underbrace{1 \cdots 1}_{=1} \frac{3}{n}
	= \frac{27}{2n}
	.\]
	Which gives us the following result:
	\[
	0< \frac{3^{n}}{n!} \leqslant \frac{27}{2n}
	.\]
	and we know that:
	\[
	\lim_{n \to \infty}0=\lim_{n \to \infty}\frac{27}{2n}=0
	.\]
	By the squeeze theorem, we can conclude that:
	\[
	\lim_{n \to \infty}\frac{3^{n}}{n!}=0
	.\]
\end{exmp}

\section{Fitting with a Function}%
\label{sec:fitting_with_a_function}

\begin{thrm}
	Fitting with a Function.
	Suppose $\{a_n\}$ is a sequence such that there is a function $f:\mathbb{R}\mapsto\mathbb{R}$ and an integer  $n_0$ such that $a_n=f(n)\ \forall n\geqslant n_0$.
	Then the following hold true:
	\[
		\lim_{x \to \infty}f(x)=L \implies \lim_{n \to \infty}a_n=L
	.\]
	\[
		\lim_{x \to \infty}f(x)=\pm\infty \implies \lim_{n \to \infty}a_n=\pm\infty
	.\]
\end{thrm}
\begin{note}
	When a sequence $\{a_n\}$ can be fitted by a function $f(x)$, we can apply L'Hopital's rule to  $\lim_{x \to \infty}f(x)$.
\end{note}
\begin{exmp}
	Does the following limit exist, and if so, what is its limit?
	\[
		\lim_{n \to \infty}\frac{3n+e^{n}}{e^{n}-n}
	.\]
	Let $f(x)=\frac{3x+e^{x}}{e^{x}-x}$.
	Now note that:
	\[
		\lim_{x \to \infty}\frac{3x+e^{x}}{e^{x}-x}
		\xrightarrow{\text{L'Hopital's Rule}}
		\lim_{x \to \infty}\frac{3+e^{x}}{e^{x}-1}
		\xrightarrow{\text{L'Hopital's Rule}}
		\lim_{x \to \infty}\frac{e^{x}}{e^{x}}=1
	.\]
	Thus we have:
	\[
		\lim_{n \to \infty}\frac{3n+e^{n}}{e^{n}-n} = 
		\lim_{x \to \infty}\frac{3x+e^{x}}{e^{x}-x} = 1
	.\]
\end{exmp}
\begin{exmp}
	Does the following limit exist, and if so, what is its limit?
	\[
		\lim_{n \to \infty}\left(1+\frac{1}{n}\right)^{n}
	.\]
	Let $f(x)=\left(1+\frac{1}{x}\right)^{x}$. Now note that:
	\[
		\lim_{x \to \infty}f(x) = \lim_{x \to \infty}\left(1+\frac{1}{x}\right)^{x}
		= \lim_{x \to \infty}e^{x\ln\left(1+\frac{1}{x}\right)}
		= e^{\lim_{x \to \infty}x\ln\left(1+\frac{1}{x}\right)}
	.\]
	Now note that:
	\[
		\lim_{x \to \infty}x\ln\left(1+\frac{1}{x}\right)=\lim_{x \to \infty}\frac{\ln\left(1+\frac{1}{x}\right)}{\frac{1}{x}}
		\xrightarrow{\text{L'Hopital's Rule}}
		\lim_{x \to \infty}\frac{\frac{1}{1+\frac{1}{x}}\left(-\frac{1}{x^{2}}\right)}{\left(-\frac{1}{x^2}\right)}=1
	.\]
	Thus we have:
	\[
		\lim_{x \to \infty}f(x)=e^{\lim_{x \to \infty}x\ln\left(1+\frac{1}{x}\right)}=e^{1}=e
	.\]
	We conclude that:
	\[
		\lim_{n \to \infty}\left(1+\frac{1}{n}\right)^{n}=\lim_{x \to \infty}\left(1+\frac{1}{x}\right)^{x}=e
	.\]
\end{exmp}

\section{Monotone Convergence Theorem}%
\label{sec:monotone_convergence_theorem}

\begin{definition}
	Non-decreasing, non-increasing, and monotonic sequences.

	\noindent
	A sequence $\{a_n\}$ is said to be \textbf{non-decreasing} for $n\geqslant n_0$ if $a_n\leqslant a_{n+1}$ for every $n\geqslant n_0$ for some $n_0\in\mathbb{Z}$.

	\bigbreak
	\noindent
	A sequence $\{a_n\}$ is said to be \textbf{non-increasing} for $n\geqslant n_0$ if $a_n\geqslant a_{n+1}$ for every $n\geqslant n_0$ for some $n_0\in\mathbb{Z}$.

	\bigbreak
	\noindent
	A sequence $\{a_n\}$ is said to be \textbf{monotonic} if it is either non-decreasing or non-increasing.
\end{definition}
Recall that all convergent sequences are bounded, but not all bounded sequences are convergent.
\begin{thrm}
	Monotone Convergence Theorem.
	Every bounded \textbf{monotonic} sequence is convergent.
\end{thrm}
This theorem is used to show the existence of a limit, but it does not give the value of the limit.
It is often used to show that a recursive sequence is convergent.
\begin{exmp}
	Consider the following sequence:
	\[
	a_n=\frac{n}{n^2+1}
	.\]
	Show that the sequence is decreasing, explain why it is bounded, find out whether it is convergent.

	\noindent
	Let $f(x)=\frac{x}{x^2+1}$. Now note that:
	\[
		f^{\prime}(x)=\frac{1-x^2}{(x^2+1)^2} < 0\  \forall x>1
	.\]
	Therefore we can say that $f$ is decreasing on $[1,\infty )$.
	Hence the sequence is decreasing.
	Since the sequence is decreasing, we have:
	\[
		0 < \underbrace{\frac{n}{n^2+1}}_{a_n} < \dotsb < a_3 < a_2 < \frac{1}{2},\ \forall n\geqslant 1
	.\]
	Therefore the sequence is bounded.
	Since the sequence is bounded and monotonic, it is convergent.
\end{exmp}
\begin{exmp}
	Consider the following sequence:
	\[
		a_0=0,\ a_1=\sqrt{2},\ a_2=\sqrt{2+\sqrt{2}},\ a_3=\sqrt{2+\sqrt{2+\sqrt{2}}},\  \dotsc
	\]
	Determine if the sequence is bounded, and if it is monotonic, and as a consequence if it is convergent.
	\begin{proof}
		We want to show that the sequence is bounded, and we can use induction to show that:
		\[
			0\leqslant a_n \leqslant 2
		.\]
		For the base case $n=0$ this assumption holds true.
		Assuming that this inequality holds for an arbitrary $n$, we have to check the case for $n+1$.
		We know that:
		\[
			a_{n+1}=\sqrt{2+a_{n}}
		.\]
		And since we assume in the inductive hypothesis that $a_n \leqslant 2$ we can safely say the following:
		\[
			\sqrt{2+a_n} \leqslant \sqrt{2+2}
		.\]
		Which therefore means that $a_{n+1}\leqslant 2$ thus proving it true $\forall n\in \mathbb{Z}$.
		Making the sequence bounded.
	\end{proof}
	Now we need to check if the sequence is monotonic.
	Looking at the sequence, we can see that it seems to be increasing, we just need to prove this assumption.
	\begin{proof}
		We can use induction to check if:
		\[
		a_n < a_{n+1}
		.\]
		For the base case $n=0$ we can see that it holds true.
		Assuming that hits inequality holds for some arbitrary $n$, we have to check the case for $n+1$.
		We know that:
		\begin{align*}
			a_{n+2} &= \sqrt{2+a_{n+1}}\\
				&> \sqrt{2+a_{n}}\\
			\therefore a_{n+2} &> a_{n+1}
		\end{align*}
		Therefore the sequence is strictly increasing and therefore monotonic.
	\end{proof}
	Since the sequence is bounded and monotonic, we can conclude that the sequence is convergent.
	To find the limit of the sequence, we can apply a limit to the following recurrence:
	\[
		a_{n+1} = \sqrt{2+a_n}
	.\]
	and then re-arrange the result:
	\[
		\lim_{n \to \infty}a_{n+1}=\lim_{n \to \infty}\sqrt{2+a_n}=\sqrt{2+\lim_{n \to \infty}a_n}
	.\]
	Which gives us the following:
	\begin{align*}
		L=\sqrt{2+L} & \iff L^2-L-2=0\\
			     & \iff (L-2)(L+1)=0\\
			     & \iff L=2 \text{ or } L=-1
	\end{align*}
	And since $0\leqslant L \leqslant 2$ we can conclude that:
	\[
	\lim_{n \to \infty}a_n = 2
	.\]
\end{exmp}

