Skip to main content

Chapter 2 CA2: Taylor Series

Section 2.1 Taylor series

described in detail following the image
Plot of \(\sin(x)\) and its degree 5 Maclaurin polynomial. The polynomial starts diverging visibly from the plot of \(\sin(x)\) when \(|x|\gt 2\text{.}\)
Figure 2.1. Plot of \(\sin(x)\) and its degree 5 Maclaurin polynomial.
Figure 2.1 compares \(\sin(x)\) to its degree 5 Maclaurin polynomial. We notice that the polynomial is a poor approximation of \(\sin(x)\) when \(|x| \gt 2\text{.}\) What can we do about this? We could use Maclaurin polynomials of ever higher degree, but these get ever more complicated.
The issue is that Maclaurin series are computed based on the value of the function and its derivatives around \(x=0\text{,}\) so it’s not surprising that they best approximate the function near \(x=0.\) If for some reason we’re more interested in the function near another value, say near \(x=a\text{,}\) then instead of computing Maclaurin polynomials of high degree, we can simply shift our function along the \(x\)-axis until the point of interest lies above \(x=0\text{,}\) compute the Maclaurin polynomials of the shifted function, and then shift back.
In other words, we consider the shifted function \(g(x) = f(x+a)\text{,}\) then compute the Maclaurin series for \(g(x)\text{:}\)
\begin{equation*} g(x) = \sum_{k=0}^{\infty} \frac{g^{(k)}(0)}{k!}x^k = \sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}x^k \end{equation*}
Finally, we shift back to obtain a power series for \(f(x) = g(x-a)\text{:}\)
\begin{equation*} f(x) = g(x-a) = \sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}(x-a)^k. \end{equation*}
This is the Taylor series for \(f(x)\) centred at \(x=a\text{.}\)

Definition 2.2. Taylor Series.

The series,
\begin{equation*} \sum_{k=0}^{\infty}\dfrac{f^{(k)}(a)}{k!}(x-a)^k=f(a)+f'(a)(x-a)+\dfrac{f''(a)}{2!}(x-a)^{2}+\dfrac{f'''(a)}{3!}(x-a)^3+ \dots \text{.} \end{equation*}
is called the Taylor series for \(f(x) \) about \(x=a. \)
Note that a Maclaurin series is simply a Taylor series centred at \(x=0.\)
The degree \(n\) Taylor polynomial of \(f(x)\) centred at \(x=a\) is - you guessed it - the sum of the terms of the Taylor series of degree at most \(n\text{.}\) The degree \(n\) Taylor polynomial of a function is also called its nth order approximation.

Example 2.3.

Compute the Taylor series of the function \(\cos(x)\) centred at \(x=\frac{\pi}{4}\text{.}\)
Solution.
We compute the derivatives of \(f(x) = \cos(x)\) at \(x=\frac{\pi}{4}\text{:}\)
\begin{align*} f(x) \amp = \cos(x), \amp f\left(\frac{\pi}{4}\right) \amp = \frac{1}{\sqrt{2}}\\ f'(x) \amp = -\sin(x), \amp f'\left(\frac{\pi}{4}\right) \amp = -\frac{1}{\sqrt{2}} \\ f''(x) \amp = -\cos(x), \amp f''\left(\frac{\pi}{4}\right) \amp = -\frac{1}{\sqrt{2}} \\ f'''(x) \amp = \sin(x), \amp f'''\left(\frac{\pi}{4}\right) \amp = \frac{1}{\sqrt{2}} \\ f^{(4)}(x) \amp = f(x), \amp f^{(4)}\left(\frac{\pi}{4}\right) \amp = f\left(\frac{\pi}{4}\right) = \frac{1}{\sqrt{2}} \end{align*}
Thus
\begin{align*} \cos(x) \amp = \frac{1}{\sqrt{2}} -\frac{1}{\sqrt{2}}\left(x-\frac{\pi}{4}\right) -\frac{1}{2!\sqrt{2}}\left(x-\frac{\pi}{4}\right)^2 + \frac{1}{3!\sqrt{2}}\left(x-\frac{\pi}{4}\right)^3 + \cdots \end{align*}
described in detail following the image
Plot of \(\cos(x)\) and its degree 3 Taylor polynomial centered at \(x=\frac{\pi}{4}\text{.}\)
Figure 2.4. Degree 3 Taylor polynomial of \(\cos(x)\) centred at \(x=\frac{\pi}{4}\)
The Sage cell below plots the Taylor polynomial for a function \(f(x)\) centred at some \(x=a\text{.}\)

Example 2.5.

Find the second order approximation to \(f(x)=e^{-\frac{x}{3}} \) about \(x=2. \)
Answer.
\(T_{2}(x)=e^{-\frac{2}{3}}-\dfrac{1}{3}e^{-\frac{2}{3}}(x-2)+\dfrac{1}{18}e^{-\frac{2}{3}}(x-2)^{2}\)
Solution.
In order to find the second order approximation for \(f(x)=e^{-\frac{x}{3}} \) about \(x=2 \) we need to evaluate \(f \) and its first two derivatives at \(x=2\text{.}\) So,
\begin{align*} f(x) \amp =e^{-\frac{x}{3}} \,\, \text{and hence}\,\, f(2)=e^{-\frac{2}{3}} \\ f'(x) \amp =-\frac{1}{3}e^{-\frac{x}{3}} \,\, \text{and hence}\,\, f'(2)=-\frac{1}{3}e^{-\frac{2}{3}} \\ f''(x) \amp =\frac{1}{9}e^{-\frac{x}{3}} \,\, \text{and hence}\,\, f''(2)=\frac{1}{9}e^{-\frac{2}{3}} \end{align*}
Thus the second order approximation for \(f(x)=e^{-\frac{x}{3}} \) about \(x=2, \) (or the Taylor polynomial of degree \(2, \) for \(f(x)=e^{-\frac{x}{3}} \) about \(x=2\)), is
\begin{align*} T_{2}(x) \amp =e^{-\frac{2}{3}}-\frac{1}{3}e^{-\frac{2}{3}}(x-2)+\frac{1}{9}e^{-\frac{2}{3}}\dfrac{(x-2)^{2}}{2} \\ \amp =e^{-\frac{2}{3}}-\frac{1}{3}e^{-\frac{2}{3}}(x-2)+\frac{1}{18}e^{-\frac{2}{3}}(x-2)^{2} \end{align*}

Example 2.6.

Find the Taylor polynomial of degree \(4 \) for \(f(x)=x\cos(x) \) about \(x=\frac{\pi}{2}. \)
Answer.
\(T_{4}(x) = -\dfrac{\pi}{2} (x-\dfrac{\pi}{2}) - (x-\dfrac{\pi}{2})^2 + \dfrac{\pi}{2} \dfrac{(x-\dfrac{\pi}{2})^3}{3!} + \dfrac{(x-\dfrac{\pi}{2})^4}{3!}\)
Solution.
Since we already know the Taylor series for \(\cos(x) \) about \(x=\frac{\pi}{2} \) we can obtain the \(4^{\text{th}} \) degree Taylor polynomial for \(f(x)=x\cos(x) \) about \(x=\frac{\pi}{2} \) as follows
\begin{align*} f(x) \amp = x\cos(x) \\ \amp = (x-\frac{\pi}{2})\cos(x)+\frac{\pi}{2}\cos(x) \\ \amp = (x-\frac{\pi}{2}) \left[-(x-\frac{\pi}{2}) + \frac{(x-\frac{\pi}{2})^3}{3!} - \frac{(x-\frac{\pi}{2})^5}{5!} + \dots \right] + \frac{\pi}{2}\left[ -(x-\frac{\pi}{2}) + \frac{(x-\frac{\pi}{2})^3}{3!} - \frac{(x-\frac{\pi}{2})^5}{5!} + \dots \right] \\ \amp = \left[-(x-\frac{\pi}{2})^2 + \frac{(x-\frac{\pi}{2})^4}{3!} - \dots \right] + \left[ -\frac{\pi}{2}(x-\frac{\pi}{2}) + \frac{\pi}{2}\frac{(x-\frac{\pi}{2})^3}{3!} - \dots \right]. \end{align*}
Thus the \(4^{\text{th}} \) degree Taylor polynomial is
\begin{equation*} T_{4}(x) = -\frac{\pi}{2} (x-\frac{\pi}{2}) - (x-\frac{\pi}{2})^2 + \frac{\pi}{2} \frac{(x-\frac{\pi}{2})^3}{3!} + \frac{(x-\frac{\pi}{2})^4}{3!}. \end{equation*}

Exercises Example Tasks

1.
Find the Taylor series for \(f(x)=\ln(x)\) about \(x=e.\)
2.
Find the Taylor polynomial of degree \(3 \) for \(f(x)=\dfrac{1}{1-x} \) about \(x=2. \)
3.
Find the Taylor polynomial of degree \(4 \) for \(f(x)=x\ln(x) \) about \(x=e. \)
4.
Find the \(3\)rd degree Taylor polynomial for \(f(x)=x^2 e^{x} \) about \(x=1. \)

Remark 2.7. A little remark.

Computer algebra systems usually have commands for Taylor series. For example, here in Figure 2.8 is an example of a query to Wolfram Alpha that will work.
Figure 2.8.

Section 2.2 Geometric series

So far, we have succeeded in finding various useful power series expressions for the functions \(\sin(x)\text{,}\) \(\cos(x)\) and \(e^x\text{.}\) What about other functions? A particularly instructive case is the function
\begin{equation*} f(x) = \frac{1}{1-x}. \end{equation*}
We can compute its derivatives by hand, but that quickly gets old, so we’ll ask the computer instead:
We notice that
\begin{equation} \frac{d^n}{dx^n} \frac{1}{1-x} = \frac{n!}{(1-x)^{n+1}} \quad \text{for}\quad n \ge 0.\tag{2.1} \end{equation}
(Note that Sage often formats the answer differently, swapping the \(x\) and \(1\) around, leading to alternating signs.)

Checkpoint 2.9.

Use induction on \(n\) to prove that the formula in (2.1) is correct.
This allows us to write down the Maclaurin series for \(f(x) = \frac{1}{1-x}\text{:}\)
\begin{equation} \frac{1}{1-x} = 1 + x + x^2 + x^3 + \cdots = \sum_{k=0}^\infty x^k.\tag{2.2} \end{equation}

Checkpoint 2.10.

(a)
Prove that, for every \(n \ge 0\text{,}\)
\begin{equation*} x^{n+1} - 1 = (x-1)(x^n + x^{n-1} + \cdots + x + 1). \end{equation*}
Deduce that
\begin{equation} 1 + x + x^2 + \cdots + x^n = \frac{1-x^{n+1}}{1-x}.\tag{2.3} \end{equation}
Hint.
You can use induction on \(n\text{,}\) or just multiply out and cancel terms.
(b)
Assuming that \(|x| \lt 1\text{,}\) deduce (2.2) from (2.3).
Hint.
Take the limit as \(n \rightarrow \infty\text{.}\)
The series in (2.2) is an example of a geometric series (sometimes also called a geometric progression). More generally, a geometric series is one of the form
\begin{equation} \sum_{k=0}^\infty ar^k = a + ar + ar^2 + \cdots, \qquad\text{where}\quad |r|\lt 1.\tag{2.4} \end{equation}
Here \(a\) is the starting term, and each subsequent term equals the previous terms multiplied by \(r\text{,}\) which we call the common ratio.
Let’s plot the various Maclaurin polynomials for \(f(x)=1/(1-x)\text{:}\)
described in detail following the image
Plot of the Maclaurin polynomials for \(f(x)=1/(1-x)\text{.}\) Note how they only approximate \(1/(1-x)\) when \(|x| \lt 1\text{.}\)
Figure 2.11. Maclaurin polynomials for \(f(x)=1/(1-x)\)
We immediately notice that the Maclaurin polynomials are wildy different from \(1/(1-x)\) when \(|x| \geq 1\text{.}\)

Section 2.3 Convergence issues

Of course, the problem is that the series (2.2) does not converge unless \(|x| \lt 1\) - after all, if \(|x| \geq 1\text{,}\) then the individual terms \(x^k\) do not shrink to zero, and the partial sums cannot converge to a limit. This is true for all series:
This is obvious if you think about it: if the series converges, then the partial sums (running totals) tend to some fixed limit. But this means that the changes from one partial sum to the next (i.e. the terms of the series) must shrink to zero.
We will soon see that the converse is not true: there are series, whose terms tend to zero, but which nevertheless diverge. One can think of this problem as the terms not tending to zero fast enough.

Proof.

If \(|r| \geq 1\text{,}\) then \(\lim_{k\rightarrow\infty}ar^k\) does not equal zero, so by the Divergence Test, the series diverges.
Now suppose that \(|r| \lt 1\text{.}\) By the result of Checkpoint 2.10, we have
\begin{equation*} a + ar + ar^2 + \cdots + ar^N = a(1 + r + r^2 + \cdots + r^N) = a\frac{1-r^{N+1}}{1-r}, \end{equation*}
So
\begin{align*} \sum_{k=0}^\infty ar^k \amp = a \lim_{N\rightarrow\infty} \sum_{k=0}^N r^k \\ \amp = a \lim_{N\rightarrow\infty} \frac{1-r^{N+1}}{1-r} \\ \amp = a \frac{1}{1-r} \end{align*}
since \(r^{N+1} \rightarrow 0\) as \(N\rightarrow\infty\) because \(|r| \lt 1\text{.}\)

Example 2.14.

Repeating decimals are also geometric series:
\begin{align*} 0.333333\ldots \amp = 3\cdot 10^{-1} + 3\cdot 10^{-2} + 3\cdot 10^{-3} + \cdots \\ \amp = \frac{3\cdot 10^{-1}}{1-10^{-1}} = \frac{1}{3}. \end{align*}

Section 2.4 Ratio test

Most series aren’t obligingly geometric series, but a similar principle applies: if the ratios of consecutive terms stay small (specifically, tend to a value strictly between \(1\) and \(-1\)), then we can expect convergence:
In other courses you will learn more about convergence of series and in particular you will see more convergence tests. Annoyingly, all convergence tests have cases in which they’re inconclusive. One can actually prove that, in a suitable technical sense, a universal convergence test cannot exist.

Example 2.16.

Determine the nature of the series
\begin{equation*} \sum_{k=1}^{\infty}\frac{k+1}{2^k} = 1+\dfrac{3}{4}+\dfrac{1}{2}+\dfrac{5}{16}+\cdots. \end{equation*}
Answer.
Convergent.
Solution.
To use the ratio test consider
\begin{equation*} \dfrac{t_{k+1}}{t_k} = \dfrac{k+2}{2^{k+1}}\cdot\dfrac{2^k}{k+1} = \dfrac{1}{2}\left(\dfrac{k+2}{k+1}\right). \end{equation*}
Thus
\begin{equation*} L=\lim_{k\to\infty}\left|\dfrac{1}{2}\left(\dfrac{k+2}{k+1}\right)\right|=\dfrac{1}{2}. \end{equation*}
Since \(L = \frac{1}{2} \lt 1\text{,}\) by the ratio test this series converges. (Notice that the ratio test doesn’t tell us to what number the series converges to. In this case it happens to be \(3\text{.}\))

Section 2.5 Convergence of power series

It turns out that the Ratio Test is well suited for testing the convergence of power series. Consider a general power series, of the form
\begin{equation*} f(x) = c_0 + c_1(x-a) + c_2(x-a)^2 + \cdots = \sum_{k=0}^\infty c_k(x-a)^k. \end{equation*}
We’d like to know for which values of \(x\) this series converges. After all, if the series doesn’t converge for a particular \(x\text{,}\) then it tells us nothing about the value of the function at \(x\text{.}\)
Firstly, when \(x=a\text{,}\) then \(f(a) = c_0 + 0 + 0 + \cdots\) obviously converges to the first term \(c_0\text{.}\) In other words, a power series always converges at its centre.
For other values of \(x\text{,}\) we apply the Ratio Test. To do so, we check the (absolute values of) ratios of consecutive terms, and try to determine if they converge to something smaller than 1. Due to the nature of power series, there is some cancellation in this ratio:
\begin{align*} \left| \frac{c_{k+1}(x-a)^{k+1}}{c_k(x-a)^k} \right| \amp = \left|\frac{c_{k+1}}{c_k} \right| \cdot |x-a| \end{align*}
For the Ratio Test to apply, this must converge to some \(L\) as \(k \rightarrow \infty\text{.}\) This depends on the ratios of the coefficients \(c_k\) of the power series. Assuming the ratios converge to something, we find three possibilities.
Case 1. If \(\displaystyle \lim_{k\rightarrow\infty} \frac{c_{k+1}}{c_k} = 0\) then the series converges for all \(x\text{:}\)
\begin{equation*} L = \lim_{k\to\infty}\left| \frac{c_{k+1}(x-a)^{k+1}}{c_k(x-a)^k} \right| = \lim_{k\to\infty}\left|\frac{c_{k+1}}{c_k} \right| \cdot |x-a| = 0 \lt 1. \end{equation*}

Example 2.17.

Consider the Maclaurin series for \(e^x\text{:}\)
\begin{equation*} e^x = \sum_{k=0}^{\infty} \frac{1}{k!}x^k. \end{equation*}
Here
\begin{align*} L = \lim_{k\rightarrow\infty} \left| \frac{\frac{1}{(k+1)!}(x-a)^{k+1}}{\frac{1}{k!}(x-a)^k} \right| \amp = \lim_{k\to\infty}\left|\frac{k!}{(k+1)!} \right| \cdot|x| \\ \amp = \lim_{k\to\infty}\left|\frac{k!}{k!(k+1)} \right| \cdot|x| \\ \amp = \lim_{k\to\infty}\left|\frac{1}{k+1} \right| \cdot|x| \\ \amp = 0. \end{align*}
Thus the Maclaurin series for \(e^x\) converges for all values of \(x\text{.}\)
It’s not hard to show that the same holds for the Taylor series of \(f(x) = e^x\text{,}\) \(\cos(x)\) and \(\sin(x)\) about any centre. The reason is that the derivatives \(f^{(n)}(a)\) are bounded (by \(e^a\) in the case of \(f(x)=e^x\text{,}\) and by \(1\) in the case of \(f(x)=\cos(x)\) or \(f(x)=\sin(x)\)), thus in the Ratio Test calculation, the factorials in the denominators dominate everything.
Case 2. If \(\displaystyle \lim_{k\rightarrow\infty} \frac{c_{k+1}}{c_k} = C \neq 0, \infty\) then the series converges for \(|x-a| \lt R = \frac{1}{C}\) and diverges if \(|x-a| \gt R\text{:}\)
\begin{align*} L = \lim_{k\to\infty}\left| \frac{c_{k+1}(x-a)^{k+1}}{c_k(x-a)^k} \right| \amp = \lim_{k\to\infty}\left|\frac{c_{k+1}}{c_k} \right| \cdot |x-a|\\ \amp = C |x-a|. \end{align*}
This will converge if \(C |x-a| = L \lt 1\text{,}\) i.e. when \(|x-a| \lt \frac{1}{C}\text{.}\)
In this case, we call \(R\) the radius of convergence of the power series. Basically, the series converges if the distance from \(x\) to the centre \(a\) is less than the radius of convergence \(R\text{.}\) If this distance is greater than \(R\text{,}\) then the series diverges.
In other words, the series converges for \(x\) inside the open interval \((a-R, a+R)\text{,}\) and diverges outside the closed interval \([a-R, a+R]\text{.}\)
What happens on the endpoints of these intervals, i.e. when \(x = a \pm R\text{?}\) The Ratio Test tells us nothing. All we know at this point is that there is an interval of convergence, of the form
\begin{equation*} (a-R, a+R),\quad\text{or}\quad [a-R, a+R], \quad\text{or}\quad (a-R, a+R], \quad\text{or}\quad [a-R, a+R). \end{equation*}
But we won’t worry about convergence at the endpoints in this course.

Example 2.18.

Compute the radius of convergence of \(\sum_{k=0}^{\infty}\frac{3^k}{k}(x-1)^k\text{.}\)
Solution.
We use the Ratio Test:
\begin{align*} L \amp = \lim_{k\rightarrow\infty} \left|\frac{\frac{3^{k+1}}{k+1}(x-1)^{k+1}}{\frac{3^k}{k}(x-1)^k} \right| \\ \amp = \lim_{k\rightarrow\infty} 3\frac{k}{k+1}\cdot |x-1| \\ \amp = 3|x-1|, \end{align*}
because
\begin{equation*} \lim_{k\rightarrow\infty} \frac{k}{k+1} = \lim_{k\rightarrow\infty} \frac{1}{1 + \frac{1}{k}} = \frac{1}{1+0} = 1. \end{equation*}
Now \(L \lt 1\) when \(|x-1| \lt \frac{1}{3}\text{.}\) So we find that the series converges for \(|x-1| \lt \frac{1}{3}\text{,}\) i.e. on the interval \((\frac{2}{3}, \frac{4}{3})\text{,}\) and the radius of convergence is \(R=\frac{1}{3}\text{.}\)
Case 3. If \(\displaystyle \lim_{k\rightarrow\infty} \frac{c_{k+1}}{c_k} = \infty,\) then the series diverges for all \(x\neq a\text{:}\)
\begin{align*} L \amp = \lim_{k\to\infty}\left| \frac{c_{k+1}(x-a)^{k+1}}{c_k(x-a)^k} \right|\\ \amp = \lim_{k\to\infty}\left|\frac{c_{k+1}}{c_k} \right| \cdot |x-a|\\ \amp = \infty, \end{align*}
so \(L = 3|x-1| \gt 1\) unless \(x = a\text{.}\) In this case we say the radius of convergence is zero: \(R=0\text{.}\)
Just to round things off, in the first case, where the series converges for all \(x\text{,}\) we say that it has infinite radius of convergence.

Section 2.6 Algebra of infinite series

Computing repeated derivatives gets old really quickly. Often a much quicker way to get power series expansions for given functions is to manipulate a known series.
In Table 2.19 below we have listed the Maclaurin series for a small set of basic functions of science and engineering. These series can all be relatively easily derived from first principals as discussed in previous lectures. However, for some more complex functions it is easier to find their Maclaurin series by starting from known series rather than trying to find the series from scratch. We will look at two commonly used techniques:
  • Manipulating/Substituting into known series.
  • Differentiating/Integrating known series.
Table 2.19. Some Important Maclaurin Series (and their intervals of convergence):
\(\dfrac{1}{1-x}=\sum_{k=0}^{\infty}x^{k}=1+x+x^{2}+x^{3}+\cdots\) \(\lvert x\rvert < 1\)
\(e^{x}=\sum_{k=0}^{\infty}\dfrac{x^{k}}{k!}=1+x+\dfrac{x^{2}}{2!} +\dfrac{x^{3}}{3!}+\cdots\) \(\mathbb{R}\)
\(\sin(x)=\sum_{k=0}^{\infty}(-1)^{k}\dfrac{x^{2k+1}}{(2k+1)!}=x-\dfrac{x^{3}}{3!} +\dfrac{x^{5}}{5!}-\cdots\) \(\mathbb{R}\)
\(\cos(x)=\sum_{k=0}^{\infty}(-1)^{k}\dfrac{x^{2k}}{(2k)!}=1-\dfrac{x^{2}}{2!} +\dfrac{x^{4}}{4!}-\cdots\) \(\mathbb{R}\)
\(\ln(1+x)=\sum_{k=1}^{\infty}(-1)^{k-1}\dfrac{x^{k}}{k}=x-\dfrac{x^{2}}{2} +\dfrac{x^{3}}{3}-\cdots\) \(\lvert x\rvert < 1\)
\(\tan^{-1}(1+x)=\sum_{k=0}^{\infty}(-1)^{k}\dfrac{x^{2k+1}}{2k+1}=x-\dfrac{x^{3}}{3} +\dfrac{x^{5}}{5}-\cdots\) \(\lvert x\rvert < 1\)
\(\sinh(x)=\sum_{k=0}^{\infty}\dfrac{x^{2k+1}}{(2k+1)!}=x+\dfrac{x^{3}}{3!} +\dfrac{x^{5}}{5!}+\cdots\) \(\mathbb{R}\)
\(\cosh(x)=\sum_{k=0}^{\infty}\dfrac{x^{2k}}{(2k)!}=1+\dfrac{x^{2}}{2!} +\dfrac{x^{4}}{4!}+\cdots\) \(\mathbb{R}\)

Manipulating/Substituting into Known Series.

Example 2.20.

Find the Maclaurin series for \(f(x)=\dfrac{1}{1+x^{2}}. \)
Answer.
\(\dfrac{1}{1+x^{2}}=\displaystyle\sum_{k=0}^{\infty}(-1)^{k}x^{2k}\)
Solution.
We know that the Maclaurin series for\(f(x)=\dfrac{1}{1-x}\) on \(\lvert x\rvert < 1 \) is
\begin{equation*} \dfrac{1}{1-x}=\sum_{k=0}^{\infty}x^{k}=1+x+x^{2}+x^{3}+\cdots \cdot \end{equation*}
We can use this series by replacing \(x \) with \(-x^{2} \) to obtain
\begin{align*} \dfrac{1}{1+x^{2}} \amp =\dfrac{1}{1-(-x^{2})}\\ \amp = 1+(-x^{2})+(-x^{2})^{2}+(-x^{2})^{3}+\cdots\\ \amp = 1-x^{2} +x^{4}-x^6+\cdots\\ \amp = \sum_{k=0}^{\infty}(-1)^{k}x^{2k} \end{align*}
which will converge on the interval \(\lvert -x^{2}\rvert < 1, \) i.e., \(-1< x < 1. \)

Example 2.21.

Find the Maclaurin series for \(f(x)=\dfrac{x^2}{2-5x}. \)
Answer.
\(\dfrac{x^2}{2-5x}=\dfrac{x^2}{2}\displaystyle\sum_{k=0}^{\infty}\left(\dfrac{5x}{2}\right)^{k}\)
Solution.
Once again we will use the Maclaurin series for \(f(x)=\dfrac{1}{1-x}\) on \(\lvert x\rvert < 1. \) Now
\begin{align*} \frac{x^2}{2-5x} \amp =\dfrac{x^{2}}{2}\left(\dfrac{1}{1-(\frac{5x}{2})}\right)\\ \amp = \dfrac{x^2}{2}\left(1+\left(\frac{5x}{2}\right)+\left(\frac{5x}{2}\right)^{2}+\left(\frac{5x}{2}\right)^{3}+\cdots\right)\\ \amp = \dfrac{x^2}{2}\sum_{k=0}^{\infty}\left(\dfrac{5x}{2}\right)^{k} \end{align*}
which will converge on the interval \(\lvert \frac{5x}{2}\rvert < 1, \) i.e., \(-\frac{2}{5}< x < \frac{2}{5}. \)

Example 2.22.

Find the Maclaurin series for \(f(x)=e^{-x^2}. \)
Answer.
\(e^{-x^2}=\displaystyle\sum_{k=0}^{\infty}(-1)^{k}\dfrac{x^{2k}}{k!}\)
Solution.
Substituting into the Maclaurin series for \(f(x)=e^{x}\text{,}\) we obtain
\begin{align*} e^{-x^2} \amp =\sum_{k=0}^{\infty}\dfrac{(-x^2)^{k}}{k!}=\sum_{k=0}^{\infty}(-1)^{k}\dfrac{x^{2k}}{k!}\\ \amp = 1- x^{2}+\frac{x^{4}}{2!}-\frac{x^{6}}{3!}+\cdots \end{align*}
which will converge for all real values of \(x. \)

Differentiating/Integrating Known Series.

As the theorem below says, we can also use differentiation and integration to work out new Maclaurin series expansions from ones that we already know. The proof of this theorem is beyond the scope of this course.
Note that the behaviour of the series (i.e. whether it converges or diverges) at the endpoints may change when it is differentiated or integrated.

Example 2.24.

Find the Maclaurin series for \(f(x)=\dfrac{1}{(1-x)^{2}}.\)
Answer.
\(\dfrac{1}{(1-x)^{2}}=\displaystyle\sum_{k=1}^{\infty} k x^{k-1}\)
Solution.
Notice that \(\int \frac{1}{(1-x)^{2}} dx=\frac{1}{1-x}, \) or put the other way, \(\frac{1}{(1-x)^{2}}=\frac{d}{dx} \left(\frac{1}{1-x}\right). \) Since we know the Maclaurin series for \(\frac{1}{1-x} \) we can differentiate this series to obtain the Maclaurin series for \(\frac{1}{(1-x)^{2}}. \) So, on \(\lvert x\rvert < 1, \)
\begin{align*} \frac{1}{(1-x)^{2}} \amp =\frac{d}{dx}\left(\sum_{k=0}^{\infty} x^{k}\right)\\ \amp = \sum_{k=1}^{\infty} k x^{k-1}\\ \amp = 1+2x+3x^2+4x^3+\dots \end{align*}

Example 2.25.

Find the Maclaurin series for \(f(x)=\ln(1+x).\)
Answer.
\(\ln(1+x)=\displaystyle\sum_{k=1}^{\infty}(-1)^{k-1}\dfrac{x^{k}}{k}\)
Solution.
Notice that \(\frac{d}{dx}(\ln(1+x)), \) or put the other way, \(\ln(1+x)=K+\int \frac{1}{1+x} dx\text{.}\) Since we know the Maclaurin series for \(\frac{1}{1+x} \) we can integrate this series to obtain the Maclaurin series for \(\ln(1+x).\) So, on \(\lvert x\rvert < 1, \)
\begin{align*} \ln(1+x) \amp = K+\int \left(\sum_{k=0}^{\infty} (-x)^{k}\right)dx\\ \amp = K+\sum_{k=0}^{\infty} (-1)^{k}\frac{x^{k+1}}{k+1}\\ \amp = K + x - \frac{1}{2}x^{2} +\frac{1}{3}x^{3} - \dots \end{align*}
Since \(\ln(1+x)\) is \(0 \) when \(x=0 \) we have \(K=0. \) Thus on \(\lvert x\rvert < 1 \)
\begin{equation*} \ln(1+x)=\sum_{k=1}^{\infty}(-1)^{k-1}\frac{x^{k}}{k}=x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\cdots \cdot \end{equation*}

Exercises Example Tasks

1.
Find the Maclaurin series for \(f(x)=\dfrac{1}{3+2x}. \)
2.
Find the Maclaurin series for \(f(x)=\dfrac{1-x^2}{5-3x^2}. \)
3.
Find the Maclaurin series for \(f(x)=\dfrac{1}{(1-2x)^2}. \)
4.
Find the Maclaurin series for \(f(x)=\tan^{-1}(x). \)
5.
Use a sixth degree Maclaurin polynomial to estimate \(f(x)=\displaystyle\int_{0}^{1}e^{-x^{2}}dx. \)

Section 2.7 Advanced topics

Subsection 2.7.1 Why radius 1?

In Example 2.20 we worked out the Maclaurin series of \(f(x)=\dfrac{1}{1+x^{2}} \) and found that it has radius of convergence \(R=1\text{.}\)
What’s wrong with this function? The plot in Figure 2.26 shows a perfectly well-behaved function, defined on all of \(\R\text{,}\) but its Maclaurin polynomials are all over the place when \(|x| \gt 1\text{.}\) Why is the radius of convergence so small?
described in detail following the image
A plot of \(y=\frac{1}{1+x^2}\) together with plots of its Maclaurin polynomials up to degree 30.
Figure 2.26. Approximations to \(\frac{1}{1+x^2}\) by its Maclaurin polynomials up to degree 30.
The answer becomes clear if we view \(f(x)=\frac{1}{1+x^2}\) as a function of a complex variable! Over the complex numbers, the denominator vanishes at \(x = \pm i\text{,}\) so the function blows up at these values. These are at distance 1 from the origin, so the disc of convergence in the complex plane cannot include these points, and so the radius of this disc (the radius of convergence!) cannot be larger than 1.
In fact, it is a result from Complex Analysis that the radius of convergence of the Taylor series of an analytic function is always the distance from the centre of the Taylor series to the nearest singularity of the function. In our case, this distance is 1.