Paul's Online Notes
Paul's Online Notes
Home / Differential Equations / Series Solutions to DE's / Review : Taylor Series
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best viewed in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (you should be able to scroll/swipe to see them) and some of the menu items will be cut off due to the narrow screen width.

Section 6.2 : Taylor Series

We are not going to be doing a whole lot with Taylor series once we get out of the review, but they are a nice way to get us back into the swing of dealing with power series. By time most students reach this stage in their mathematical career they’ve not had to deal with power series for at least a semester or two. Remembering how Taylor series work will be a very convenient way to get comfortable with power series before we start looking at differential equations.

Taylor Series

If \(f(x)\) is an infinitely differentiable function then the Taylor Series of \(f(x)\) about \(x = {x_0}\) is,

\[f\left( x \right) = \sum\limits_{n = 0}^\infty {\frac{{{f^{\left( n \right)}}\left( {{x_0}} \right)}}{{n!}}{{\left( {x - {x_0}} \right)}^n}} \]

Recall that

\[{f^{\left( 0 \right)}}\left( x \right) = f\left( x \right)\hspace{0.25in}{f^{\left( n \right)}}\left( x \right) = n^{\text{th}}{\mbox{ derivative of }}f\left( x \right)\]

Let’s take a look at an example.

Example 1 Determine the Taylor series for \(f\left( x \right) = {{\bf{e}}^x}\) about \(x=0\).
Show Solution

This is probably one of the easiest functions to find the Taylor series for. We just need to recall that,

\[{f^{\left( n \right)}}\left( x \right) = {{\bf{e}}^x}\hspace{0.25in}n = 0,1,2, \ldots \]

and so we get,

\[{f^{\left( n \right)}}\left( 0 \right) = 1\hspace{0.25in}n = 0,1,2, \ldots \]

The Taylor series for this example is then,

\[{{\bf{e}}^x} = \sum\limits_{n = 0}^\infty {\frac{{{x^n}}}{{n!}}} \]

Of course, it’s often easier to find the Taylor series about \(x=0\) but we don’t always do that.

Example 2 Determine the Taylor series for \(f\left( x \right) = {{\bf{e}}^x}\) about \(x = - 4\).
Show Solution

This problem is virtually identical to the previous problem. In this case we just need to notice that,

\[{f^{\left( n \right)}}\left( { - 4} \right) = {{\bf{e}}^{ - 4}}\hspace{0.25in}n = 0,1,2, \ldots \]

The Taylor series for this example is then,

\[{{\bf{e}}^x} = \sum\limits_{n = 0}^\infty {\frac{{{{\bf{e}}^{ - 4}}}}{{n!}}{{\left( {x + 4} \right)}^n}} \]

Let’s now do a Taylor series that requires a little more work.

Example 3 Determine the Taylor series for \(f\left( x \right) = \cos \left( x \right)\) about \(x = 0\).
Show Solution

This time there is no formula that will give us the derivative for each \(n\) so let’s start taking derivatives and plugging in \(x = 0\).

\[\begin{align*}{f^{\left( 0 \right)}}\left( x \right) & = \cos \left( x \right) & \hspace{0.25in}{f^{\left( 0 \right)}}\left( 0 \right) & = 1\\ {f^{\left( 1 \right)}}\left( x \right) & = - \sin \left( x \right) & \hspace{0.25in}{f^{\left( 1 \right)}}\left( 0 \right) & = 0\\ {f^{\left( 2 \right)}}\left( x \right) & = - \cos \left( x \right) & \hspace{0.25in}{f^{\left( 2 \right)}}\left( 0 \right) & = - 1\\ {f^{\left( 3 \right)}}\left( x \right) & = \sin \left( x \right) & \hspace{0.25in}{f^{\left( 3 \right)}}\left( 0 \right) & = 0\\ {f^{\left( 4 \right)}}\left( x \right) & = \cos \left( x \right) & \hspace{0.25in}{f^{\left( 4 \right)}}\left( 0 \right) & = 1\\ & \hspace{0.1in} \vdots & \hspace{0.25in} & \hspace{0.1in} \vdots \end{align*}\]

Once we reach this point it’s fairly clear that there is a pattern emerging here. Just what this pattern is has yet to be determined, but it does seem fairly clear that a pattern does exist.

Let’s plug what we’ve got into the formula for the Taylor series and see what we get.

\[\begin{align*}\cos \left( x \right) & = \sum\limits_{n = 0}^\infty {\frac{{{f^{\left( n \right)}}\left( 0 \right)}}{{n!}}{x^n}} \\ & = \frac{{{f^{\left( 0 \right)}}\left( 0 \right)}}{{0!}} + \frac{{{f^{\left( 1 \right)}}\left( 0 \right)}}{{1!}}x + \frac{{{f^{\left( 2 \right)}}\left( 0 \right)}}{{2!}}{x^2} + \frac{{{f^{\left( 3 \right)}}\left( 0 \right)}}{{3!}}{x^3} + \cdots \\ & = \frac{1}{{0!}} + 0 - \frac{{{x^2}}}{{2!}} + 0 + \frac{{{x^4}}}{{4!}} + 0 - \frac{{{x^6}}}{{6!}} + 0 + \frac{{{x^8}}}{{8!}} + \cdots \end{align*}\]

So, every other term is zero.

We would like to write this in terms of a series, however finding a formula that is zero every other term and gives the correct answer for those that aren’t zero would be unnecessarily complicated. So, let’s rewrite what we’ve got above and while were at it renumber the terms as follows,

\[\cos \left( x \right) = \underbrace {\,\frac{1}{{0!}}\,}_{n = 0} - \underbrace {\frac{{{x^2}}}{{2!}}}_{n = 1} + \underbrace {\frac{{{x^4}}}{{4!}}}_{n = 2} - \underbrace {\frac{{{x^6}}}{{6!}}}_{n = 3} + \underbrace {\frac{{{x^8}}}{{8!}}}_{n = 4} + \cdots \]

With this “renumbering” we can fairly easily get a formula for the Taylor series of the cosine function about \(x = 0\).

\[\cos \left( x \right) = \sum\limits_{n = 0}^\infty {\frac{{{{\left( { - 1} \right)}^n}{x^{2n}}}}{{\left( {2n} \right)!}}} \]

For practice you might want to see if you can verify that the Taylor series for the sine function about \(x = 0\) is,

\[\sin \left( x \right) = \sum\limits_{n = 0}^\infty {\frac{{{{\left( { - 1} \right)}^n}{x^{2n + 1}}}}{{\left( {2n + 1} \right)!}}} \]

We need to look at one more example of a Taylor series. This example is both tricky and very easy.

Example 4 Determine the Taylor series for \(f\left( x \right) = 3{x^2} - 8x + 2\) about \(x = 2\).
Show Solution

There’s not much to do here except to take some derivatives and evaluate at the point.

\[\begin{align*}f\left( x \right) & = 3{x^2} - 8x + 2 & \hspace{0.25in}f\left( 2 \right) & = - 2\\ f'\left( x \right) & = 6x - 8 & f'\left( 2 \right) & = 4\\ f''\left( x \right) & = 6 & \hspace{0.25in}f''\left( 2 \right) & = 6\\ {f^{\left( n \right)}}\left( x \right) & = 0,\,\,n \ge 3 & \hspace{0.25in}{f^{\left( n \right)}}\left( 2 \right) & = 0,\,\,n \ge 3\end{align*}\]

So, in this case the derivatives will all be zero after a certain order. That happens occasionally and will make our work easier. Setting up the Taylor series then gives,

\[\begin{align*}3{x^2} - 8x + 2 & = \sum\limits_{n = 0}^\infty {\frac{{{f^{\left( n \right)}}\left( 2 \right)}}{{n!}}{{\left( {x - 2} \right)}^n}} \\ & = \frac{{{f^{\left( 0 \right)}}\left( 2 \right)}}{{0!}} + \frac{{{f^{\left( 1 \right)}}\left( 2 \right)}}{{1!}}\left( {x - 2} \right) + \frac{{{f^{\left( 2 \right)}}\left( 2 \right)}}{{2!}}{\left( {x - 2} \right)^2} + \frac{{{f^{\left( 3 \right)}}\left( 2 \right)}}{{3!}}{\left( {x - 2} \right)^3} + \cdots \\ & = - 2 + 4\left( {x - 2} \right) + \frac{6}{2}{\left( {x - 2} \right)^2} + 0\\ & = - 2 + 4\left( {x - 2} \right) + 3{\left( {x - 2} \right)^2}\end{align*}\]

In this case the Taylor series terminates and only had three terms. Note that since we are after the Taylor series we do not multiply the 4 through on the second term or square out the third term. All the terms with the exception of the constant should contain an \(x - 2\).

Note in this last example that if we were to multiply the Taylor series we would get our original polynomial. This should not be too surprising as both are polynomials and they should be equal.

We now need a quick definition that will make more sense to give here rather than in the next section where we actually need it since it deals with Taylor series.

Definition

A function, \(f(x)\), is called analytic at \(x = a\) if the Taylor series for \(f(x)\) about x=a has a positive radius of convergence and converges to \(f(x)\).

We need to give one final note before proceeding into the next section. We started this section out by saying that we weren’t going to be doing much with Taylor series after this section. While that is correct it is only correct because we are going to be keeping the problems fairly simple. For more complicated problems we would also be using quite a few Taylor series.