What are the Taylor series centered at \(a = 0\) for \(\frac{1}{1-x}\text{,}\)\(\ln(1+x)\text{,}\)\(\sin(x)\text{,}\)\(\cos(x)\text{,}\) and \(e^x\text{,}\) and for which \(x\)-values do these series converge?
Moreover, we saw that it is natural to extend the degree \(n\) Taylor polynomial to an infinite Taylor series (which will be formally defined in Definition 8.4.1). For \(f(x) = \frac{1}{1-x}\text{,}\) its corresponding Taylor series is
Because \(T(x)\) is an infinite geometric series with \(a = 1\) and \(r = x\text{,}\) whenever \(|r| = |x| \lt 1\text{,}\) the series converges and by Equation (8.3.11) its sum is
Remarkably, this shows that the original function, \(f(x) = \frac{1}{1-x}\text{,}\) is equal to its Taylor series for all values of \(x\) that satisfy \(|x| \lt 1\text{.}\) So, not only do Taylor polynomials provide increasingly better approximations to a function as the degree \(n\) increases, but it appears that if we let \(n\) increase without bound we arrive at a new representation of the original function through its Taylor series. We note that this new representation may only be valid for a limited set of \(x\)-values, such as \(|x| \lt 1\) in the case of \(f(x) = \frac{1}{1-x}\text{.}\)
In Preview Activity 8.4.1, we consider an infinite geometric series and explore the function to which the series is related and that function’s Taylor polynomials.
Recall that the sum of an infinite geometric series with first term \(a\) and constant ratio \(r\) is \(S = \frac{1}{1-r}\text{,}\) provided \(|r| \lt 1\text{.}\) Use this result to find a single fraction that represents the value of \(T(x)\text{.}\) For which values of \(x\) is this representation valid?
Consider the function \(f(x) = 9 (3 + x)^{-1}\text{.}\) Determine \(f(0)\text{,}\)\(f'(0)\text{,}\)\(f''(0)\text{,}\) and \(f'''(0)\text{.}\) What is the degree \(3\) Taylor polynomial centered at \(0\) for the function \(f(x)\text{?}\)
From our work in Activity 8.3.4 and Preview Activity 8.4.1, we have seen two examples where the Taylor polynomials of a given function lead to a corresponding infinite Taylor series that is actually equal to the original function itself. This suggests that one reason Taylor series are important is that they give rise to polynomial-like representations of non-polynomial functions.
Let \(f\) be a function such that \(f^{(n)}(a)\) exists for every natural number \(n\text{.}\) The Taylor series for \(f\) centered at \(x=a\) is the series \(T_f(x)\) defined by
As we noted earlier in Equation (8.4.1), because this particular series is geometric (with common ratio \(r = x\)), we are able to easily find a shortcut formula for its value and understand the values of \(x\) for which the infinite sum makes sense. In particular, for \(|x| \lt 1\text{,}\)
It turns out that while most Taylor series are not geometric series, we can compare any Taylor series to a geometric series in order to determine an interval of \(x\)-values for which the Taylor series converges. To see how to approach this issue, we consider the following example with a particular function with a known Taylor series and determine the \(x\)-values for which its Taylor series should converge.
Let \(f(x) = \ln(1+x)\text{.}\) By investigating how close the terms of the Taylor series of \(f\) of resemble a geometric series, determine the \(x\)-values for which the Taylor series appears to converge.
Unlike the Taylor series for the function \(\frac{1}{1-x}\text{,}\) the Taylor series for \(f(x) = \ln(1+x)\) turns out to not be geometric since there is not a common ratio between the terms, so we introduce some new ideas to think about the \(x\)-values for which we expect the series to converge.
For a series to be geometric, we must be able to construct the next term in the series by multiplying the prior term by a constant ratio. In \(T_f(x)\text{,}\) the general \(n^{\text{th}}\) term is
This tells us the series \(T_f(x)\) is not geometric since the ratio of consecutive terms depends on \(n\text{.}\) For example, if we take \(n = 2\text{,}\) we have
However, as \(n\) gets large, the series \(T_f(x)\) is almost geometric. This is because the quantity \(\frac{n}{n+1}\) approaches \(1\) as \(n\) increases without bound, and therefore for large \(n\text{,}\)
This suggests that the series \(T_f(x)\) converges for \(|r_n(x)| \approx |-x| = |x| \lt 1\text{,}\) since the series is very close to being geometric with a common ratio \(-x\text{.}\)
Graphical evidence supports the conclusion that for \(|x| \lt 1\text{,}\) the series \(T_f(x)\) converges in the same way that a geometric one would, and also that the interval of convergence is \(-1 \lt x \lt 1\text{.}\) In Figure 8.4.3, we plot \(f(x) = \ln(1+x)\text{,}\)\(T_{10}(x) = x - \frac{1}{2}x^2 + \cdots - \frac{1}{10}x^{10}\text{,}\) and \(T_{20}(x) = x - \frac{1}{2}x^2 + \cdots - \frac{1}{20}x^{20}\text{.}\)
Figure8.4.3.The function \(f(x)=\ln(1+x)\) and its degree \(10\) and \(20\) Taylor polynomial approximations \(T_{10}(x)\) and \(T_{20}(x)\) near the point \((0,f(0))\text{.}\)
In Figure 8.4.3 we see that on the interval \(-0.8 \lt x \lt 0.8\text{,}\)\(f(x)\text{,}\)\(T_{10}(x)\text{,}\) and \(T_{20}(x)\) are nearly indistinguishable. Furthermore, we see that if we widen the interval to \(-0.9 \lt x \lt 0.9\text{,}\)\(T_{20}(x)\) remains a very good approximation of \(f(x)\text{.}\) For example, we can do some computations and find that
Increasing the degree of the approximation further allows us to do a bit better, but since \(f(x) = \ln(1+x)\) is undefined with a vertical asymptote at \(x = -1\text{,}\) no polynomial function can agree with \(f(x)\) at \(x = -1\text{.}\) Thus, it appears to be the case that \(T_f(x)\) converges for \(x\)-values that satisfy \(-1 \lt x \lt 1\text{,}\) and on that interval the Taylor series converges to \(f(x) = \ln(1+x)\text{.}\)
From our most recent work in Example 8.4.2, we see a striking result: it appears that for \(x\)-values where the Taylor series \(T_f(x)\) of \(f(x) = \ln(1+x)\) converges to a finite value, the Taylor series actually equals the function \(f\text{.}\) Said differently, it appears that
for \(x\)-values that satisfy \(-1 \lt x \lt 1\text{.}\) (It also turns out this equality holds when \(x = 1\) for reasons that we’ll consider in Section 8.6.) This result is analogous to Equation (8.4.1), but is different in the sense that the Taylor series for \(\ln(1+x)\) is not geometric.
We next introduce a more formal way to test “how geometric” a Taylor series is in an effort to understand where the Taylor series is guaranteed to converge.
Consider an infinite series of the form \(T(x) = \sum_{k=0}^{\infty} c_k (x-a)^k\text{,}\) where \(a\) is any real number. Let \(r_n(x) = \frac{c_{n+1} (x-a)^{n+1}}{c_n (x-a)^n}\) be the ratio of consecutive terms of the series and let
In essence, the Ratio Test is a way to find \(x\) values for which \(T(x)\) behaves like a geometric series with ratio \(r(x)\) such that \(|r(x)| \lt 1\text{;}\) for those \(x\)-values, the infinite series converges to a finite value. There is a subtle issue that arises for \(x\)-values for which \(|r(x)| = 1\text{:}\) it’s possible for the infinite series to either converge or diverge at such \(x\)-values, but we will normally not concern ourselves with this issue.
We call \(R\) the radius of convergence and say that the set of all \(x\)-values such that \(|x - a| \lt R\) is the open interval of convergence. Again, it is possible that the Taylor series may either converge or diverge when \(|x - a| = R\text{,}\) but we will normally not concern ourself with this issue at the endpoints.
In light of the formal statement of the Ratio Test, we now see that in our initial investigation of the Taylor series for \(f(x) = \ln(1+x)\text{,}\) we applied the Ratio Test to find an open interval of \(x\)-values for which its Taylor series converges. In particular, for
By the Ratio Test, it follows that if \(|r(x)| = |-x| = x \lt 1\text{,}\) then the series converges; that is, \(-1 \lt x \lt 1\) is the open interval of convergence, and the radius of convergence of this series is \(R = 1\text{.}\) We also know that if \(|r(x)| = x \gt 1\text{,}\) the series does not converge. When \(x = \pm 1\text{,}\) we don’t know if the series converges or diverges, but we will normally not be concerned with this endpoint behavior because of many subtle and complicated issues that can arise.
As described in the statement of the Ratio Test, let \(r_n(x)\) be the ratio of the \((n+1)^{\text{st}}\) term of \(T(x)\) to the \(n^{\text{th}}\) term of \(T(x)\text{.}\) Find the simplest formula that you can for \(r_n(x)\text{.}\)
Let \(T_{10}(x)\) be the sum of the first \(10\) terms of \(T(x)\text{,}\) and let \(f(x) = \ln(2) - \ln(3-x)\text{.}\) Plot \(f(x)\) and \(T_{10}(x)\) on the same coordinate axes in a window centered around \(x=1\text{.}\) What do you notice? What does this suggest about the series \(T(x)\text{?}\)
Subsection8.4.3Taylor series of several important functions
So far, we have established that the Taylor series of two important functions, \(\frac{1}{1-x}\) and \(\ln(1+x)\text{,}\) converge on an open interval of \(x\)-values and on that interval converge to the respective functions. For these functions,
It turns out that this representation is also valid when \(x = 1\) because the series \(1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots\) converges, and does so to the exact value \(\ln(2)\text{.}\) This means that while the open interval of convergence is \(-1 \lt x \lt 1\) for this series, the complete interval of convergence is actually \(-1 \lt x \le 1\text{.}\)
Three other important functions that we have studied — \(\sin(x)\text{,}\)\(\cos(x)\text{,}\) and \(e^x\) — have similar representations, and so we build on our work from Section 8.1 and Section 8.2 with their respective Taylor polynomials in order to investigate and understand their Taylor series.
Following Activity 8.2.2, we noted some of the higher degree Taylor polynomials centered at \(a = 0\) for \(\sin(x)\text{,}\)\(\cos(x)\text{,}\) and \(e^x\text{.}\) For the sine function, we observed that
and find the interval of \(x\)-values for which this Taylor series converges. Investigate whether or not the Taylor series converges to \(f(x) = \sin(x)\text{.}\)
More generally, \(f^{(4k)}(x) = \sin(x)\) and \(f^{(4k+2)}(x) = -\sin(x)\) for every natural number \(k\text{.}\) This shows that \(f^{(4k)}(0) = \sin(0) = 0\) and \(f^{(4k+2)}(0) = -\sin(0) = 0\text{,}\) from which it follows that every even power of \(x\) in the Taylor series of the sine function has a coefficient of \(0\text{.}\)
For odd values of \(n\text{,}\) we can see that since \(f'(x) = \cos(x)\text{,}\) we also have \(f^{(5)}(x) = \cos(x)\text{,}\)\(f^{(9)}(x) = \cos(x)\text{,}\) and so on. From this, \(f'(0) = \cos(0) = 1\text{,}\) and similarly, \(f^{(5)}(0) = 1\text{,}\)\(f^{(9)}(x) = 1\text{,}\) and indeed \(f^{(4k+1)}(0) = 1\) for every nonnegative whole number \(k\text{.}\) Finally, since \(f'''(x) = -\cos(x)\text{,}\) we have \(f'''(0) = -\cos(0) = -1\text{,}\) and so \(f'''(0) = -1\text{,}\)\(f^{(7)}(0) = -1\text{,}\) and thus \(f^{(4k+3)}(0) = -1\) for every nonnegative whole number \(k\text{.}\)
Putting these observations together about the various derivatives of \(f(x) = \sin(x)\) evaluated at \(a = 0\) and using the fact that the Taylor series of \(f(x)\) centered at \(0\) has form
Next, we use the Ratio Test to investigate the values of \(x\) where \(T_f(x)\) converges. We therefore consider \(r_n(x)\text{,}\) which is the ratio of consecutive nonzero terms, and have
From here, we compute \(r(x)\text{,}\) the limit of \(r_n(x)\) as \(n\) increases without bound. Since \(\frac{1}{(2n+3)(2n+2)} \to 0\) as \(n \to \infty\text{,}\) it follows that for any fixed value of \(x\text{,}\)
The Ratio Test tells us that for any \(x\) for which \(|r(x)| \lt 1\text{,}\) the series \(T_f(x)\) converges. Here, since \(r(x) = 0\) for every value of \(x\text{,}\) this means that \(T_f(x)\) converges for every real number \(x\text{.}\)
Finally, we investigate whether the Taylor series appears to converge to \(f(x) = \sin(x)\) or not. In Figure 8.4.5, we see the Taylor polynomials of degree \(5\) and \(9\text{,}\) and the significant improvement of the approximation as the degree increases.
For the degree \(9\) approximation, we see that \(T_9(x)\) and \(f(x) = \sin(x)\) are almost indistinguishable on \(-4 \lt x \lt 4\text{,}\) which is much wider than the interval \(-2 \lt x \lt 2\) on which the \(T_5(x)\) approximation is accurate. Experimenting with even higher degree Taylor polynomials shows that increasing the degree of the approximation appears to widen the interval on which the approximation is accurate and seems to do so without bound, which suggests that the Taylor series of \(f(x) = \sin(x)\) in fact converges to \(f(x) = \sin(x)\text{.}\)
In Example 8.4.4, we found that the Taylor series for the sine function appears to converge to the sine function, and to do so for every real number \(x\text{.}\) This result can be proven formally using a famous theorem called the Lagrange Error Bound, a theorem that quantifies how accurate a Taylor polynomial approximation is on an interval, which we will study in Section 8.6. To summarize, we now know the remarkable result that the sine function is equal to its Taylor series for every value of \(x\text{,}\) so
Nearly identical reasoning shows a similar result for the cosine function: that its Taylor series centered at \(a = 0\) converges for every real number \(x\) and converges to the cosine function itself. Thus, for any real number \(x\text{,}\)
Let \(f(x) = e^x\text{.}\) Our goal is to understand why the Taylor series for \(f(x)\) converges for every real number \(x\) and see that the Taylor series converges to \(e^x\text{.}\)
Let \(r_n(x)\) be the ratio of the \((n+1)^{\text{st}}\) term to the \(n^{\text{th}}\) term of \(T_f(x)\text{.}\) Find the simplest expression you can for \(r_n(x)\text{.}\)
Let \(r(x) = \lim_{n \to \infty} r_n(x)\text{.}\) Evaluate this limit, and then apply the Ratio Test to say what you can conclude about the \(x\)-values for which \(T_f(x)\) converges.
While there is considerable technical detail involved in finding Taylor series and deciding where they converge, it’s important not to miss the big picture. For certain “nice” functions that are infinitely differentiable, such as \(f(x) = \ln(1+x)\) and \(f(x) = \sin(x)\text{,}\) not only can we find the Taylor series for each and determine an open interval of \(x\)-values at which the Taylor series converges, but for those values the Taylor series converges to the function itself. This means that for certain \(x\)-values (and sometimes all\(x\)-values), we can represent a non-polynomial function as being equal to an infinite polynomial.
A function such as \(f(x) = \sin(x)\) that is infinitely differentiable and has a power series that converges on some interval to the function itself is said to be analytic. Analytic functions are amazing and among the nicest functions in all of mathematics: they are completely determined by what happens at a single point.
Almost all functions are not analytic. For example, if a function measures your location as a function of time on a highway, that function cannot be analytic, since what happens at 12:01 is independent of what happens at 12:00 due to other circumstances such as traffic or construction. At the same time, the mathematical universe is better to us than we deserve in that many important, common functions are analytic, including several we’ve mentioned (\(\frac{1}{1-x}\text{,}\)\(\ln(1+x)\text{,}\)\(\sin(x)\text{,}\)\(\cos(x)\text{,}\) and \(e^x\)) and most of those represented by buttons on a calculator.
and this equation is true for every possible value of \(x\text{.}\) This equation is completely determined by the values of \(f(x) = e^x\) and its derivatives only at the value \(a = 0\text{.}\) When we use a computational device like Desmos or a calculator and enter \(e^2\text{,}\) this is how the device can find the decimal representation of the number. Since
which an accurate representation of \(e^2\) to 5 decimal places, and more terms in the sum can be used in order to generate any desired level of accuracy.
The five Taylor series that we’ve found in our work to date are extremely important and will be used extensively in Section 8.5, so we summarize them in the following table.
Provided that \(f\) is a function for which every derivative of \(f\) exists at \(x = a\text{,}\) the Taylor series centered at \(a\) of \(f\) is the series \(T_f(x)\) defined by
We know that an infinite geometric series converges whenever its common ratio, \(r\text{,}\) satisfies \(|r| \lt 1\text{.}\) The Ratio Test enables us to consider a Taylor series and determine an open interval of \(x\)-values on which the series converges, essentially by comparing the Taylor series to a geometric series. By letting \(r_n(x)\) be the ratio of consecutive terms in the series and taking the limit
We have found the Taylor series for five important functions, determined an open interval of \(x\)-values on which each converges, and seen the striking result that where each Taylor series converges, it converges to original function \(f(x)\) that we used to generate the Taylor series. These results are summarized in Table 8.4.6.
Find the first four terms of the Taylor series for the function \(\displaystyle \frac{3}{x}\) about the point \(a = 3\text{.}\) (Your answers should include the variable x when appropriate.)
Find the first five terms of the Taylor series for the function \(f(x) = \ln\mathopen{}\left(x\right)\) about the point \(a = 7\text{.}\) (Your answers should include the variable x when appropriate.)
Find the first four terms of the Taylor series for the function \(4 \cos(x)\) about the point \(a = -\pi/4\text{.}\) (Your answers should include the variable x when appropriate.)
(Enter your answer as an interval: thus, if the interval of convergence were \(-3 \lt x\lt 5\text{,}\) you would enter (-3,5). Use Inf for any endpoint at infinity.)
The examples we have considered so far in this section have all been for Taylor polynomials and series centered at 0, but Taylor polynomials and series can be centered at any value of \(a\text{.}\)
Let \(f(x) = \cos(x)\text{.}\) Find the Taylor polynomials up through order four of \(f\) centered at \(a = \frac{\pi}{2}\text{.}\) Then find the Taylor series for \(f(x)\) centered at \(a = \frac{\pi}{2}\text{.}\) Why is the result not surprising?
Let \(f(x) = \frac{1}{1+x} = (1+x)^{-1}\text{.}\) Find the Taylor polynomials up through order four of \(f\) centered at \(a = 1\text{.}\) Then find the Taylor series for \(f(x)\) centered at \(a = 1\text{.}\)
As we will see in more detail in the next section, we can use known Taylor series to obtain other Taylor series, and we preview that idea in this exercise.
Part (a) demonstrates the direct approach to finding Taylor polynomials and series. Next we utilize a known Taylor series to make the process simpler. Recall that the Taylor series centered at 0 for \(f(x) = \sin(x)\) is
Substitute \(x^2\) for \(x\) in the Taylor series \(T(x)\) in Equation (8.4.7). Write out the first several terms and compare to your work in part (a). Explain why the substitution in this problem should result in the Taylor series for \(\sin(x^2)\) centered at 0.