Skip to main content

Section 9.4 How to Use Taylor Series

In this final topic for this chapter, we’ll pause for a moment to figure out what we could actually use these Taylor series for. This next statement is the personal opinion of the author: I do not typically care to focus on the applications of mathematical topics. In this text, you’ll maybe notice that there is less of a focus on applications of derivatives and integrals into other areas and more focus on what these calculus objects actually are.
We’ll try to focus on the flexible uses and applications of Taylor series as a way of allowing us the freedom to think about calculus topics in hard-to-work-with contexts, or to extend our uses of calculus ideas into new contexts.

Subsection Approximations

Taylor series have, as a part of their structure, a built-in approximation strategy. If we want to approximate a series, we can use a partial sum! Approximations of functions using Taylor series, then, are easily approximated using the polynomials that build the partial sums.
We can use this as a way of approximating the functions themselves or approximating function outputs (by evaluating our Taylor series at specific \(x\)-values).

Activity 9.4.1. Approximating \(\pi\) and Other Values.

Let’s pick a couple of values that are just based on functions with Known Taylor Series and approximate them.
(a)
If we note that \(\tan^{-1}(1)=\dfrac{\pi}{4}\text{,}\) then we can say that \(\pi = 4\tan^{-1}(1)\text{.}\)
Find an infinite series that converges to \(\tan^{-1}(1)\text{,}\) and use that to construct a series that converges to \(\pi\text{.}\)
(b)
If we note that \(\dfrac{1}{e}=e^{-1}\text{,}\) then find an infinite series that converges to \(\dfrac{1}{e}\text{.}\)
(c)
Find an infinite series that converges to \(\sin(1)\text{.}\)
(d)
Note that each of these three series are alternating series! We can approximate them using a partial sum, and then we can get an error bound for that partial sum by looking at the size of the next term in the infinite series (Theorem 8.5.5 Approximations of Alternating Series).
Approximate the value of each infinite series using a partial sum with the same number of terms. You can pick the number of terms you use. Then, compare the margin of error. Which approximations are most/least accurate? Why do you think that is?

Subsection Integrals

We have built a whole host of antidifferentiation strategies in Chapter 7, but there are plenty of functions that are resistant to those specific techniques. In fact, most functions do not have what we call elementary antiderivatives: antiderivative functions that can be written as some combination of the basic, named function types.
A typical example is \(\sin(x^2)\text{.}\) Let’s look at an integral involving this function!

Activity 9.4.2. Integrating using Taylor Series.

Let’s consider the definite integral:
\begin{equation*} \int_{x=0}^{x=1}\sin(x^2)\;dx\text{.} \end{equation*}
We know this function is continuous everywhere, and so it is continuous on the interval \([0,1]\text{.}\) So the Fundamental Theorem of Calculus applies. All we need to do is find an antiderivative, evaluate it at the end-points of the interval, and subtract.
Great! Easy!
Except that we can’t write out the family of antiderivatives for this function.
So let’s convert over to the Taylor series context and solve our problem there.
(a)
Create a Taylor series for the function \(f(x)=\sin(x^2)\text{.}\)
Hint.
Note that if we let \(g(x)=\sin(x)\text{,}\) then we can write our function as \(f(x)=g(x^2)\text{.}\) This can help serve as a blueprint for creating the Taylor series for \(f(x)\text{.}\)
Solution.
\begin{align*} g(x) \amp = \sin(x)\\ \amp = \sum_{k=0}^\infty \frac{(-1)^k x^{2k+1}}{(2k+1)!}\\ f(x) \amp = g(x^2)\\ \amp = \sum_{k=0}^\infty \frac{(-1)^k (x^2)^{2k+1}}{(2k+1)!}\\ \amp = \sum_{k=0}^\infty \frac{(-1)^k x^{4k+2}}{(2k+1)!} \end{align*}
(b)
Find the interval of convergence for this Taylor series. Specifically, we want to know if this series converges to \(\sin(x^2)\) on the interval \([0,1]\text{,}\) since that’s the interval we’re integrating over.
Hint.
Since the Taylor series for \(\sin(x)\) converges when \(x\) is in \((-\infty,\infty)\text{,}\) then we expect that the Taylor series for \(\sin(x^2)\) will converge when \(x^2\) is in \((-\infty,\infty)\text{.}\) What kinds of \(x\)-values will produce real numbers when we square them?
Solution.
The interval of convergence is \((-\infty,\infty)\text{,}\) so we should be comfortable using this series as a replacement for \(\sin(x^2)\) in the integral we’re working on.
(c)
If \(f(x)=\sin(x^2)\text{,}\) find a Taylor series representation of \(F(x)\text{,}\) an antiderivative of \(f(x)=\sin(x^2)\text{.}\)
Solution.
We can find \(F(x)\) by applying the Power Rule for Antiderivatives.
\begin{align*} F(x)\amp=\sum_{k=0}^\infty \frac{(-1)^k\left(\frac{x^{4k+3}}{4k+3}\right)}{(2k+1)!} \\ \amp = \sum_{k=0}^\infty \frac{(-1)^k x^{4k+3}}{(4k+3)(2k+1)!} \end{align*}
Note that we don’t need to worry about any constant of integration, since we are simply choosing one of the antiderivatives.
(d)
Evaluate this antidervative at the endpoints and subtract:
\begin{equation*} F(1)-F(0)\text{.} \end{equation*}
Hint.
Since \(\displaystyle F(x)=\sum_{k=0}^\infty \frac{(-1)^k x^{4k+3}}{(4k+3)(2k+1)!}\text{,}\) we’re really evaluating this power series at \(x=0\) and \(x=1\text{.}\)
Solution.
First, we evaluate at \(x=1\text{:}\)
\begin{align*} F(1) \amp= \sum_{k=0}^\infty \frac{(-1)^k (1)^{4k+3}}{(4k+3)(2k+1)!}\\ \amp = \sum_{k=0}^\infty \frac{(-1)^k}{(4k+3)(2k+1)!} \end{align*}
Now we evaluate at \(x=0\text{:}\)
\begin{align*} F(0) \amp = \sum_{k=0}^\infty \frac{(-1)^k (0)^{4k+3}}{(4k+3)(2k+1)!} \\ \amp = \sum_{k=0}^\infty (0)\\ \amp = 0 \end{align*}
So we can notice that \(F(1)-F(0)=F(1)\text{.}\)
\begin{equation*} \int_{x=0}^{x=1} \sin(x^2)\;dx = \sum_{k=0}^\infty \frac{(-1)^k}{(4k+3)(2k+1)!} \end{equation*}
(e)
Use Theorem 8.5.5 Approximations of Alternating Series to approximate the value of \(\displaystyle\int_{x=0}^{x=1}\sin(x^2)\;dx\) with a maximum error of \(10^{-5}\text{.}\)
Hint.
We’re really tasked with finding a value of \(k\) to make
\begin{equation*} \left|\frac{(-1)^k}{(4k+3)(2k+1)!}\right| \lt 0.000001 \end{equation*}
or
\begin{equation*} \left|\frac{(-1)^k}{(4k+3)(2k+1)!}\right| \lt \frac{1}{100000}\text{.} \end{equation*}
These terms will get small quickly, due to the factorial. It’s probably easiest to just do a little guess-and-check process.
Solution.
When \(k=4\text{,}\) we get
\begin{align*} \left|\frac{(-1)^k}{(4k+3)(2k+1)!}\right| \amp =\frac{1}{(4(4)+3)(2(4)+1)!} \\ \amp = \frac{1}{19(9!)}\\ \amp = \frac{1}{6894720} \end{align*}
Since this is smaller than our margin of error, we know that the actual value of the integral is bounded between \(S_3\) and \(S_4\text{.}\)
\begin{align*} S_3 \amp = \sum_{k=0}^{3} \frac{(-1)^k}{(4k+3)(2k+1)!}\\ \amp = \frac{258019}{831600}\\ \amp \approx 0.31026816\\ S_4 \amp = \sum_{k=0}^4 \frac{(-1)^k}{(4k+3)(2k+1)!}\\ \amp = \frac{117656719}{379209600}\\ \amp \approx 0.31026830 \end{align*}
So we know that the integral is some number in between these! We can actually round this value to six decimal places and be pretty confident in this estimation!
\begin{equation*} \int_{x=0}^{x=1} \sin(x^2)\;dx \approx 0.310268 \end{equation*}
We got lucky here, in that the alternating series was reasonable to approximate with some specified error bound (based on Theorem 8.5.5), but this isn’t technically unique to alternating series! There are some other ways of building error bounds on our partial sum approximations, but we won’t spend our time building them.

Subsection Euler’s Formula

Three of the Taylor series that we’ve looked at have been pretty similar:
\begin{align*} e^x \amp = \sum_{k=0}^\infty \frac{x^k}{k!}\\ \sin(x) \amp = \sum_{k=0}^\infty \frac{(-1)^k x^{2k+1}}{(2k+1)!}\\ \cos(x) \amp = \sum_{k=0}^\infty \frac{(-1)^k x^{2k}}{(2k)!} \end{align*}
It’s probably worth stopping for a moment to remember why the exponential function’s Taylor series has “all” of the terms, while the ones for the sine and cosine functions have only the odd and even terms (respectively), and also why the terms for the sine and cosine function alternate in sign.
If you want to refresh yourself on why these series have these kinds of structures, take a look back at Section 9.1, where we built the partial sums of these series and conjectured about the infinite series for each.
Before we begin, let’s remember a fact about \(i\text{,}\) the imaginary unit where \(i^2=-1\text{.}\)
This structure (flipping back and forth between two things, and changing the sign as we do it) might feel familiar! It almost feels like the same thing that happens with derivatives of the sine and cosine functions, right? Hmm....

Activity 9.4.3. Constructing Euler’s Formula.

(a)
Compose \((ix)\) inside of the \(e^x\) function and it’s Taylor series to come up with a Taylor series representation for \(e^{ix}\text{.}\)
Solution.
\begin{equation*} e^{ix} = \sum_{k=0}^\infty \frac{(ix)^k}{k!} \end{equation*}
(b)
Write out several terms of this new series. You should write out at least 6 of them, but more is fun, too!
Now, use Fact 9.4.1 Powers of \(i\) to rewrite these terms.
Solution.
\begin{align*} e^{ix} \amp = \sum_{k=0}^\infty \frac{(ix)^k}{k!}\\ \amp = i + ix + \frac{i^2x^2}{2!} + \frac{i^3x^3}{3!} + \frac{i^4x^4}{4!} + \frac{i^5x^5}{5!} + \frac{i^6x^6}{6!} + \frac{i^6x^6}{6!} + \frac{i^7x^7}{7!} + ...\\ \amp = 1 + ix - \frac{x^2}{2!} - \frac{ix^3}{3!} + \frac{x^4}{4!} + \frac{ix^5}{5!} - \frac{x^6}{6!} - \frac{ix^7}{7!} +... \end{align*}
(c)
Which terms have are real coefficients? Which terms have imaginary coefficients? If you group these together, do you recognize these terms?
(d)
Write \(e^{ix}\) in terms of sines and cosines.
Solution.
\begin{equation*} e^{ix} = \cos(x)+i\sin(x) \end{equation*}
This is a really powerful theorem for a couple of reasons, but we’ll just touch on a few of them. The first, and maybe least important, is a really cool identity, called Euler’s Identity. It’s just Euler’s Formula evaluated at \(x=\pi\text{:}\)
\begin{align*} e^{i\pi} \amp = \cos(\pi) + i\sin(\pi) \\ e^{i\pi} \amp =-1\\ e^{i\pi}+1 \amp=0 \end{align*}
This last statement is the one most used. It’s often cited as one of the most “beautiful” or interesting equations in mathematics, since it combines 5 of the most important numbers:
  • \(e\text{,}\) the natural exponential base, \(e=\displaystyle\lim_{n\to\infty}\left(1+\frac{1}{n}\right)^n\text{.}\)
  • \(i\text{,}\) the imaginary unit where \(i=\sqrt{-1}\) and \(i^2=-1\text{.}\)
  • \(\pi\text{,}\) the constant ratio between the circumference and diameter of every circle.
  • \(1\text{,}\) the multiplicative identity, where \(1(x)=x\text{.}\)
  • \(0\text{,}\) the additive identity, where \(0+x=x\text{.}\)
These 5 numbers are all combined into one connected equation, even though they are seemingly not connected at all in their “origins”. It’s no wonder so many people love this equation!

Subsubsection Complex Analysis

Euler’s Formula is a really nice way of linking some of our well-known functions to their complex-function extensions. We have complex exponentials, and we can use this same formula to create a complex-valued logarithmic function.
From here, mathematicians were able to think about how the concepts of calculus could be applied to functions that took in complex-valued inputs and outputs complex-valued outputs. This area of mathematics proved to be rich in applications and also hugely interesting.

Subsubsection Trigonometric Identities

Trigonometric identities are used in a ton of different areas of mathematics (including in this textbook) to try to rewrite some expressions into friendlier forms. One of the big struggles for mathematics students, though, is trying to remember them when needed. The author of this textbook thinks, as a matter of personal opinion, that memorizing facts and identities like this is overrated in general, but being able to construct these when necessary is more helpful.
A problem with many trigonometric identities is that the construction or explanation of them often relies on tricky geometry involving lots of triangles.
Euler’s Formula provides a really nice way of thinking of these identities, since we can construct them from the definition of the complex exponential.
Example 9.4.3.
Let’s construct the sum of angle identites for sine and cosine. We, eventually, want to have some formula for \(\sin(\alpha+\beta)\) and \(\cos(\alpha+\beta)\text{.}\)
In order to do this, let’s evaluate \(e^{ix}\) at \(x=\alpha+\beta\) and see what happens.
\begin{equation*} e^{i(\alpha+\beta)} = \cos(\alpha+\beta) + i\sin(\alpha+\beta) \end{equation*}
So we can see that the “real” part of this is the sum of angles for the cosine function, and the “imaginary” part is the sum of angles for the sine function.
But now we can think about \(e^{i(\alpha+\beta)}\) by considering that a sum of exponents could really be a product of exponentials:
\begin{equation*} e^{i(\alpha+\beta)} = e^{i\alpha}e^{i\beta} \end{equation*}
Let’s look at this second version.
\begin{align*} e^{i\alpha}e^{i\beta} \amp = \left(\cos(\alpha)+i\sin(\alpha)\right)\left(\cos(\beta)+i\sin(\beta)\right)\\ \amp = \cos(\alpha)\cos(\beta) + i\sin(\alpha)\cos(\beta) + i\cos(\alpha)\sin(\beta) - \sin(\alpha)\sin(\beta)\\ \amp = \left(\cos(\alpha)\cos(\beta) - \sin(\alpha)\sin(\beta)\right) + i\left(\sin(\alpha)\cos(\beta) + \cos(\alpha)\sin(\beta)\right) \end{align*}
Now we can remember that this should be equivalent to \(\cos(\alpha+\beta) + i\sin(\alpha+\beta)\text{,}\) from earlier:
\begin{equation*} \cos(\alpha+\beta) + i\sin(\alpha+\beta) = \left(\cos(\alpha)\cos(\beta) - \sin(\alpha)\sin(\beta)\right) + i \left(\sin(\alpha)\cos(\beta) + \cos(\alpha)\sin(\beta)\right) \end{equation*}
So we can equate the real parts and the imaginary parts separately to get:
\begin{align*} \cos(\alpha+\beta) \amp = \cos(\alpha)\cos(\beta) - \sin(\alpha)\sin(\beta)\\ \sin(\alpha+\beta) \amp = \sin(\alpha)\cos(\beta) + \cos(\alpha)\sin(\beta) \end{align*}
This strategy is super useful for creating these identities, since we can often take advantage of exponent properties to write two different equivalent expressions to connect.
These are only a few applications of Taylor series, but hopefully they are enough to show a sufficiently wide range of applications or uses. Taylor series, whether they’re used to get polynomial approximations of objects or to translate some function into a different context, are some of the most used applications of calculus, and are a wonderful way to think about connections between some of the calculus concepts that we’ve talked about.

Practice Problems Practice Problems

1.

We can define hyperbolic trigonometric functions in the following way:
\begin{align*} \sinh(x) \amp= \frac{e^x - e^{-x}}{2} \\ \cosh(x) \amp = \frac{e^x + e^{-x}}{2} \end{align*}
(a)
Find a Taylor Series representation for \(\sinh(x)\) centered at \(x=0\text{.}\)
(b)
Find a Taylor Series representation for \(\cosh(x)\) centered at \(x=0\text{.}\)
(c)
Show that \(\sinh(x)+\cosh(x) = e^x\) using the definition of the hyperbolic trigonometric functions above.
(d)
Show that \(\sinh(x) + \cosh(x) = e^x\) using the Taylor Series.

2.

Use a Taylor series to estimate the value of the integral
\begin{equation*} \int_{x=0}^{x=1}e^{-x^2}\;dx \end{equation*}
within a maximum error margin of 0.001.