- At the end of Strategy for integration, we have mentioned that there are elementary functions, such as \(f(x)=e^{-x^2}\), the antiderivative of which is not an elemetary function.
- On the other hand, we'll see that there's a larger notion of functions, that of
*convergent power series*, the antiderivative of which is going to be another convergent power series. - We'll see that although the antiderivative might not have a closed formula, that is a description as an elementary function, you can readily approximate its values using the power series description.
- To introduce power series, and discuss their convergence, we first need to introduce sequences and their convergence.
- This is a rather large section, but most of it is very similar to convergence of functions. Since we are on a tight schedule, we won't be able to cover all of it. Please read the textbook too.

- On the other hand, we'll see that there's a larger notion of functions, that of

- A
*sequence*is a list of numbers written in a definite order: \[ a_1,a_2,\dotsc,a_n,\dotsc \]- The number \(a_1\) is the
*first term*, the number \(a_2\) is the*second term*, and in general \(a_n\) is the \(n\)-th term. - The sequence \(\{a_1,a_2,a_3,\dotsc\}\) is also denoted by \[ \{a_n\}\text{ or }\{a_n\}_{n=1}^\infty. \]

- The number \(a_1\) is the
- Examples. Some sequences can be defined by giving a formula for the \(n\)-th term.
- \(\left\{\frac{2n}{n+2}\right\}\), \(a_n=\frac{2n}{n+2}\), \(\left\{\frac23,1,\frac65,\dotsc,\frac{2n}{n+2},\dotsc\right\}\)
- \(\left\{\frac{(-1)^n(n-2)}{2^n}\right\}\), \(a_n=\frac{(-1)^n(n-2)}{2^n}\), \(\left\{\frac12,0,-\frac18,\frac18,-\frac{3}{32},\dotsc,\frac{(-1)^n(n-2)}{2^n},\dotsc\right\}\)
- \(\left\{\sqrt{2n+1}\right\}\), \(a_n=\sqrt{2n+1}\), \(\left\{\sqrt3,\sqrt5,\sqrt7,\dotsc\sqrt{2n+1},\dotsc\right\}\)
- \(\left\{\sin\frac{n\pi}{4}\right\}\), \(a_n=\sin\frac{n\pi}{4}\), \(\left\{2^{-1/2},1,2^{-1/2},0,-2^{-1/2},\dotsc,\sin\frac{n\pi}{4},\dotsc\right\}\)

- Example. Let's find a formula for the sequence \[
\left\{\frac23,-\frac46,\frac89,-\frac{16}{12},\frac{32}{15}\right\},
\] assuming that the pattern continues.
- Since the nominators are \(2,4,8,16,32\), in general the \(n\)-th nominator is \(2^n\).
- Since the denominators are \(3,6,9,12,15\), in general the \(n\)-th denominator is \(3n\).
- Since the signs are \(1,-1,1,-1,1\), in general the \(n\)-th sign is \((-1)^{n+1}\).
- All in all, the sequence is \(a_n=-\frac{2^n}{3n}\).

- There are sequences which don't have a simple formula.
- The sequence \(\{t_n\}\), where \(t_n\) is the surface temperature of Lake Ontario at Toronto Harbourfront on January 1 of the year \(1900+n\) at noon.
- The sequence \(\{p_n\}\), where \(p_n\) is the digit in the \(n\)-th decimal place of the number \(\pi\).
- The
*Fibonacci sequence*\(\{f_n\}\). This is probably the most famous*recursive sequence*. Recursive sequences also have formulas, but these formulas include lower index terms. In this particular case, we have \[ f_1=1,\,f_2=1\,\text{ and }f_n=f_{n-2}+f_{n-1}\text{ for }n>2. \] Therefore, the first few terms are \[ \{1,1,2,3,5,8,13,21,\dotsc\} \]

- Consider again the sequence \(a_n=\frac{2n}{n+2}\).
- There's 2 plots you can assign to this.
- First, there is a 1-dimensional plot, where you put on the real line the numbers \(a_n\). Click here for the plot. You can see that the points approach the number 2.
- Second, there is a 2-dimensional plot of the points \((n,a_n)\). Click here for the plot. You can see that the points approach the line \(y=2\).
- Consider \[ a_n=\frac{2n}{n+2}=\frac{2n+4-4}{n+2}=2-\frac{4}{n+2}. \] Note that \(\frac{4}{n+2}\) can be made as small as we like by taking \(n\) sufficiently large.
- This in turn shows that the difference \(|a_n-2|\) can be made as small as we like by taking \(n\) sufficiently large. We indicate this by writing \[ \lim_{n\to\infty}a_n=2. \]

*Definition (imprecise version).*A sequence \(\{a_n\}\) has the*limit*L, and we write \[ \lim_{n\to\infty}a_n=L\text{ or }a_n\to L\text{ as }n\to\infty, \] if we can make the terms \(a_n\) as close to \(L\) as we like by taking \(n\) sufficiently large. If \(\lim_{n\to\infty}a_n\) exists, we say the the sequence*converges*(or is*convergent*). Otherwise, we say that the sequence*diverges*(or is*divergent*).*Definition (precise version).*A sequence \(\{a_n\}\) has the*limit*L, and we write \[ \lim_{n\to\infty}a_n=L\text{ or }a_n\to L\text{ as }n\to\infty, \] if for every \(\varepsilon>0\), there is a corresponding integer \(N\) such that \[ \text{if }n>N\text{ then }|a_n-L|<\varepsilon. \]- Usually we can prove convergence by other means. The precise version is more useful for proving that a given sequence is divergent.

- As an example, let's show \(\lim_{n\to\infty}\frac{2n}{n+2}=2\) using the precise definition.
- Let's pick some arbitrary \(\varepsilon>0\). We want to find \(N>0\) so that if \(n>N\), then \[ |a_n-2|=\left|\frac{4}{n+2}\right|<\varepsilon. \]
- Since its argument is positive, we can get rid of the absolute value sign. Then we can transform the inequality to \[ \frac{4}{\varepsilon}-2<n. \]
- You can see that if \(n>\left\lceil\frac{4}{\varepsilon}\right\rceil\), then the inequality holds. Therefore, we can make \(N=\left\lceil\frac{4}{\varepsilon}\right\rceil\).
- For example, if \(\varepsilon=\frac{1}{10}\), then we can take \(N=40\). You can see in this plot that if \(n>40\), then \(|a_n-2|<\frac{1}{10}\).

- Consider \(a_n=\sin\frac{n\pi}{2}\).
- Based on its plot, the sequence is divergent.
- A precise proof is as follows. We have \[ a_n=\begin{cases} 1 & n=4k+1,\\ 0 & n=4k+2\text{ or } n=4k,\\ -1 & n=4k+3. \end{cases} \] Note that we can find \(n\) arbitrarily large so that \(a_n=1,0,\text{ or }-1\).
- Now let \(\varepsilon=\frac12\). If we had \(\lim_{n\to\infty}a_n=L\), then there must be an \(N\) so that if \(n>N\), then \(|a_n-L|<\frac12\). But this would require \(|1-L|<\frac12\) and \(|-1-L|<\frac12\) at the same time, which is impossible.

- Exercises. 11.1: 39, 53, 54.

*Theorem.*Let \(\{a_n\}\) be a sequence and \(f(x)\) be a function. If \(f(n)=a_n\) and \(\lim_{x\to\infty}f(x)=L\), then \(\lim_{n\to\infty}a_n=L\).- Since we already know about convergence of functions, this theorem is one of the main tools in proving that a sequence is convergent.
- For example, if \(f(x)=\frac{2x}{x+2}\), then \(f(n)=\frac{2n}{n+2}\). Therefore, since for example l'Hospital's rule shows that \(\lim_{x\to\infty}\frac{2x}{x+2}=2\), we get \(\lim_{n\to\infty}\frac{2n}{n+2}=\infty\).
- Exercises. 11.1: 23, 27, 29, 33, 43, 45, 47.

*Theorem.*Let \(\{a_n\}\) be a sequence. Suppose that \(\lim_{n\to\infty}|a_n|=0\). Then \(\lim_{n\to\infty}a_n=0\).- Note that why this is important is because if \(a_n=(-1)^nf(n)\) for some function \(f(x)\), then we can't have \(a_n=g(n)\) for any function \(g(x)\), since noninteger powers of \(-1\) are not real numbers.
- Consider \(a_n=\frac{(-1)^n(n-2)}{2^n}\). Since \(\lim_{n\to\infty}|a_n|=\lim_{n\to\infty}\frac{n-2}{2^n}=0\), we have \(\lim_{n\to\infty}a_n=0\).
- Exercises. 11.1: 35, 36.

- There are limit laws for sequences corresponding to limit laws for functions.
- You can see the full list in the textbook.
- For example, if \(\{a_n\}\) and \(\{b_n\}\) are convergent sequences, then we have \(\lim_{n\to\infty}(a_n+b_n)=\lim_{n\to\infty}a_n+\lim_{n\to\infty}b_n\).
- Example. Since we have \(\lim_{n\to\infty}(-1)^n\frac{2^n}{3^n}=0\), we get \(\lim_{n\to\infty}\frac{3^n+(-2)^n}{3^n}=1\).
**Warning.**It's very important that these limit laws only work if the component sequences. For example, although \(\lim_{n\to\infty}(n-n)=0\), the expression \(\lim_{n\to\infty}n-\lim_{n\to\infty}n\) is divergent.- Exercises. 11.1: 20, 21, 19.

*Squeeze theorem for sequences.*Let \(\{a_n\}\), \(\{b_n\}\) and \(\{c_n\}\) be sequences, and \(n_0\) be a positive integer. Suppose that \(a_n\le b_n\le c_n\) for \(n\ge n_0\), and that \(\lim_{n\to\infty}a_n=\lim_{n\to\infty}c_n=L\). Then we have \(\lim_{n\to\infty}b_n=L\).- Example. Recall that \(n!=1\cdot2\cdot\dotsb\cdot n\). Consider the sequence \(a_n=\frac{n!}{n^n}\).
- Note that we have \[ a_n=\frac{1\cdot2\cdot\dotsc\cdot n}{n\cdot n\cdot\dotsb\cdot n}=\frac{1}{n}\frac{2\cdot3\cdot\dotsb\cdot n}{n\cdot n\cdot\dotsb\cdot n}. \]
- Since we have \(0\le\frac{2\cdot3\cdot\dotsb\cdot n}{n\cdot n\cdot\dotsb\cdot n}\le\frac{1}{n}\), we get \(0\le a_n\le\frac{1}{n}\).
- Since we have \(\lim_{n\to\infty}\frac{1}{n}=0\), we get \(\lim_{n\to\infty}a_n=0\).
- Exercises. 11.1: 55, 56.

*Definition.*Let \(\{a_n\}\) be a sequence.- If we have \(a_n\le a_{n+1}\) for all \(n\ge1\), we say that the sequence is
*increasing*. If the inequalities are strict, then we say that the sequence is*strictly increasing*. - If we have \(a_n\ge a_{n+1}\) for all \(n\ge1\), we say that the sequence is
*decreasing*. If the inequalities are strict, then we say that the sequence is*strictly decreasing*. - If the sequence is increasing or decreasing, we say that it is
*monotonic*. If it is strictly increasing or decreasing, we say it is*strictly monotonic*. - Example. We could see on its graph that the sequence \(a_n=\frac{2n}{n+2}\) is strictly increasing. Let us see how we can prove this.
- We need \[ a_n=\frac{2n}{n+2}<\frac{2(n+1)}{n+1+2}=a_{n+1}. \]
- Multiplying up by the denominators, we get \[ 2n(n+3)=2n^2+6n<2n^2+6n+4=2(n+1)(n+2). \]

- If we have \(a_n\le a_{n+1}\) for all \(n\ge1\), we say that the sequence is

*Definition.*Let \(\{a_n\}\) be a sequence.- If there is a number \(M\) such that \(a_n\le M\) for all \(n\ge1\), then we say that the sequence is
*bounded above*. - If there is a number \(m\) such that \(m\le a_n\) for all \(n\ge1\), then we say that the sequence is
*bounded below*. - If the sequence is bounded above and bounded below, then we say that it is
*bounded*. - Example. We could see on its graph that the sequence \(a_n=\frac{2n}{n+2}\) is bounded. Let's prove this.
- We have \(0<a_n\), which proves that it's bounded below.
- We saw on the graph that \(a_n<2\). Let's prove this. We need \[ \frac{2n}{n+2}<2. \]
- Multiplying by \((n+2)\), we get \[ 2n<2(n+2)=2n+4. \]

- If there is a number \(M\) such that \(a_n\le M\) for all \(n\ge1\), then we say that the sequence is

*Monotonic sequence theorem.*Every bounded, monotonic sequence is convergent.- So this is also a way to prove that \(a_n=\frac{2n}{n+2}\) is convergent.
- This can also be used to show that some recursive sequences are convergent.

- For example, consider the sequence \(a_n\) defined by \[ a_1=1,\,a_{n+1}=2+\frac{a_n}{2}. \]
- First, let's check that \(a_n\) is increasing. We can use induction for this.
- \(n=1\): We have \(a_1=1\le\frac52=a_2\).
- Induction step. We assume \(a_{n-1}\le a_n\), and we need \[ a_n=2+\frac{a_{n-1}}{2}\le 2+\frac{a_n}{2}=a_{n+1}, \] which you can see by subtracting 2, and multiplying by 2.

- Since the sequence is increasing, we immediately get \(a_n\ge a_1=1\), which shows that it's bounded below.

- Now we want to show that the sequence is bounded above. Since we can choose \(M\) arbitrarily large, let's show that \(a_n\le100\) for all \(n\ge1\).
- We'll apply induction again. We immediately get \(a_1=1\le100\).
- Suppose that \(a_n\le100\). The we have \[ a_{n+1}=2+\frac{a_n}{2}\le2+50\le100. \]

- Then the Monotonic sequence theorem shows that \(\lim_{n\to\infty}a_n=L\). Using the limit laws, we can find \(L\): \[ L=\lim_{n\to\infty}a_{n+1}=\lim_{n\to\infty}(2+\frac{a_n}{2})=2+\frac{L}{2} \] gives \(L=4\).
- Exercises. 11.1: 81, 79, 83, 93.