maths.free › Calculus › 8. Taylor Polynomials and Taylor Series › Quantifying the accuracy of approximations
Quantifying the accuracy of approximations
This section is all about understanding precisely how accurate certain approximations are. Through Taylor series, we now know that we can represent certain functions and their values exactly through infinite sums.
Introduction
This section is all about understanding precisely how accurate certain approximations are. Through Taylor series, we now know that we can represent certain functions and their values exactly through infinite sums. For example, we know that for any value of \(x\), \[\begin{aligned}\end{aligned}\] so it follows that \[\begin{aligned}\end{aligned}\]. In fact, Equation is one wayMathematicians have devised other clever and efficient methods for computing values of transcendental functions, such as \(\sin(1)\) and \(\ln(2)\). For example, a method known as CORDIC (that remarkably doesn't even use multiplication) is employed by many calculating devices to compute values of trigonometric functions, such as \(\sin(1)\). that a calculator or computer can respond to the human prompt \(e^{-1/2}\). Note that the right-hand side of the equation only uses addition and multiplication, and that the special number \(e\) makes no appearance on the right. A natural question is: how does a calculator or computer know that the decimal value it returns is as accurate as the decimal representation it displays?
For instance, if we decide to estimate the exact value of \(e^{-1/2}\) using the first \(5\) terms of this infinite sum, it turns out to be possible to use both the fact that we chose \(5\) and properties of \(f(x) = e^x\) to quantify the maximum error in the estimate \[\begin{aligned}\end{aligned}\]. It also turns out to be possible to determine how many terms are needed in order to find an approximation that meets a desired level of accuracy. These questions and issues are what this section is about.
As we have seen, most of the infinite series that arise (such as the one in Equation) are not geometric. But since geometric series are among the easiest infinite series to understand and evaluate, we use a geometric series as the starting point for our analysis of approximation errors. In Preview Activity, we investigate an example of a convergent geometric series and explore certain patterns that arise when we compare partial sums the exact sum of the series.
Exploration
Exploration
Alternating series of real numbers
In several situations we've encountered, series whose terms alternate in sign arise naturally. For instance, consider the definite integral \[\begin{aligned}\end{aligned}\], which is related to the well-known error function, \(\erf(x)\). While we are unable to find an elementary algebraic antiderivative of \(e^{-x^2}\), if we use the Taylor series \[\begin{aligned}\end{aligned}\] and apply the Fundamental Theorem of Calculus to the series representation of \(e^{-x^2}\), it turns out that \[\begin{aligned}\end{aligned}\] Like the geometric series \(\sum_{k=0}^{\infty} (-1)^k \left( \frac{4}{5} \right)^k\) that we encountered in Preview Activity, the infinite series in Equation is an example of an alternating series of real numbers. It turns out to be straightforward to determine whether or not an alternating series converges and to estimate the value of a convergent alternating series.
Note that \(a_k\) just represents the non-alternating part of the series. For example, using the series from Preview Activity, \[\begin{aligned}\end{aligned}\], the expression \(a_k\) corresponds to \(a_k = \left( \frac{4}{5} \right)^k\).
In Preview Activity, we investigated the partial sums, \(S_n\), of the convergent alternating geometric series \(S = \sum_{k=0}^{\infty} (-1)^k \left( \frac{4}{5} \right)^k\), whose sum is \(S = \frac{5}{9}\). For instance, \(S_3\) is the sum of the first \(3\) terms of the infinite series.
If we plot the partial sums as ordered pairs of the form \((n,S_n)\), as shown in Figure, we see important patterns in how the partial sums both approach and differ from the exact value of the infinite sum.
In both our work in the Preview Activity and in Figure, we see how consecutive partial sums oscillate back and forth above and below the exact sum of the infinite series, \(\frac{5}{9}\), and moreover how the absolute difference between \(S\) and \(S_n\) decreases as \(n\) increases.
Our work with the geometric series \(S = \sum_{k=0}^{\infty} (-1)^k \left( \frac{4}{5} \right)^k\) suggests two general results that are true for any alternating series.
Given an alternating series \[\begin{aligned}\end{aligned}\], if the positive terms \(a_k\) decrease to 0 as \(k \to \infty\), then the alternating series converges.
Condensed — the full section is in Boelkins, Active Calculus.
Error Approximations for Taylor Polynomials
In the same way that the next term in an alternating series reveals the maximum error of a finite approximation, it turns out that a quantity related to the next term in a Taylor series determines the maximum error found in a Taylor polynomial approximation. This will enable us to know the degree of the Taylor polynomial that is needed in order to achieve a given accuracy tolerance on a chosen interval.
Throughout what follows, we assume that \(f(x)\) is a function with at least \(n+1\) derivatives at \(a = 0\), and let \(T_n(x)\) be its degree \(n\) Taylor polynomial centered at \(a = 0\). We define the error function of the degree \(n\) approximation, \(E_n(x)\), by \[\begin{aligned}\end{aligned}\].
Our overall goal is to understand how much error there is in the approximation \(f(c) \approx T_n(c)\) for some fixed value of \(c\); in other words, we'd like to know the maximum possible value of \(| E_n(c) |\).
This leads us to maximize the error function, \(E_n(x)\), on the interval \([0,c]\). We observe several important properties of \(E_n(x)\):
\(E_n(0) = E_n'(0) = E_n''(0) = \cdots = E_n^{(n)}(0) = 0\), since \(E_n(x) = f(x) - T_n(x)\) and \(f\) and \(T_n\) share the same function value and same first \(n\) derivative values at \(a = 0\);
\(E^{(n+1)}_n(x) = f^{(n+1)}(x)\), since \(T_n\) is a degree \(n\) polynomial, which means \(T_n^{(n+1)}(x) = 0\) for every \(x\);
If we assume that \(|f^{(n+1)}(x)| \leq M\) for some positive real number \(M\) for every \(x\) in the interval \([0,c]\), then \[\begin{aligned}\end{aligned}\] since \(f^{(n+1)}(x) = E^{(n+1)}_n(x)\).
Taking Inequality, writing it in the form \(-M \lt E^{(n+1)}_n(t) \leq M\), and integrating all three terms in the inequality from \(t = 0\) to \(t = x\) and doing so \(n+1\) times, it can be shown that \[\begin{aligned}\end{aligned}\] It follows that \[\begin{aligned}\end{aligned}\] since \(|c|\) is the maximum value of \(|x|\) on the interval \(0 \leq x \leq c\).
A similar argument works if we center the Taylor polynomial approximation at any real number \(a\) and leads to the following result, known as the Lagrange Error Bound.
Let \(f\) be a continuous function with \(n+1\) continuous derivatives. Suppose that \(M\) is a positive real number such that \(\left|f^{(n+1)}(x)\right| \le M\) on the interval \([a, c]\). If \(T_n(x)\) is the degree \(n\) Taylor polynomial for \(f(x)\) centered at \(x=a\), then \[\begin{aligned}\end{aligned}\].
Condensed — the full section is in Boelkins, Active Calculus.
Summary
If we approximate an infinite series with one of its partial sums, we can often quantify the maximum error present in the truncated sum. Two ways the error can be measured are through the Alternating Series Estimation Theorem (if the original series is alternating) and through the Lagrange Error Bound (if the original series can be viewed as a Taylor series).
An alternating series is one whose terms alternate in sign, often represented by \[\begin{aligned}\end{aligned}\] where \(a_k \gt 0\) for all values of \(k\). Any alternating series whose terms \(a_k\) approach zero as \(k \to \infty\) is guaranteed to converge. Moreover, the Alternating Series Estimation Theorem tells us that we can estimate the exact value of a converging alternating series by using a partial sum, and the error of that approximation is at most the next term in the series. That is, \[\begin{aligned}\end{aligned}\].
The Lagrange Error Bound quantifies the accuracy when we a Taylor polynomial to approximate a function. Specifically, if \(T_n(x)\) is the degree \(n\) order Taylor polynomial for \(f\) centered at \(x=a\) and if \(\left|f^{(n+1)}(x)\right| \leq M\) for some real number \(M\) on the interval \([a, c]\), then \[\begin{aligned}\end{aligned}\].
Practice (2)
Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.
-
In this exercise we consider the definite integral \[\begin{aligned}\end{aligned}\] from two different perspectives.
First, find the Taylor series for \(\frac{4}{1+x^2}\) and use it to evaluate \[\begin{aligned}\end{aligned}\] as an infinite series of real numbers.
Observe that your result in (a) is an alternating series. Estimate the value of that alternating series to within \(0.01\). How many terms of the series are needed to do so?
Recall that \(\frac{d}{dx}[\arctan(x)] = \frac{1}{1+x^2}\). Use this fact and the First Fundamental Theorem of Calculus to evaluate \[\begin{aligned}\end{aligned}\] exactly.
How are your results in (a) and (c) connected? What famous number can we now estimate using an alternating series? How many terms of the series were needed to ensure the first two digits of the famous number are accurate?
Хариулт
Since \(\frac{1}{1+x} = 1 - x + x^2 - x^3 + \cdots\), we can write \[\begin{aligned}\end{aligned}\], so \[\begin{aligned}\int_0^1 \frac{4}{1+x^2} \, dx =\mathstrut \amp \int_0^1 4 - 4x^2 + 4x^4 - 4x^6 + \cdots \, dx \\ =\mathstrut \amp \left. 4x - \frac{4}{3}x^3 + \frac{4}{5}x^5 - \frac{4}{7}x^7 + \cdots \right|_0^1 \\ =\mathstrut \amp 4 - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \cdots\end{aligned}\]
Since \(\int_0^1 \frac{4}{1+x^2} \, dx = 4 - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \cdots\), to estimate this alternating series to within \(0.01\), we need \(\frac{4}{2n+1} \lt 0.01\), which happens when \(n = 200\)!
By the First Fundamental Theorem of Calculus, \[\begin{aligned}\end{aligned}\].
Since both (a) and (c) find representations for \(\int_0^1 \frac{4}{1+x^2} \, dx\), it follows that the two representations are equal, and thus \[\begin{aligned}\end{aligned}\]. And if we use \(200\) terms, the result is only accurate to two decimal places!
-
In this exercise we consider the definite integral \[\begin{aligned}\end{aligned}\] from two different perspectives.
First, find the Taylor series for \(\frac{4}{1+x^2}\) and use it to evaluate \[\begin{aligned}\end{aligned}\] as an infinite series of real numbers.
Observe that your result in (a) is an alternating series. Estimate the value of that alternating series to within \(0.01\). How many terms of the series are needed to do so?
Recall that \(\frac{d}{dx}[\arctan(x)] = \frac{1}{1+x^2}\). Use this fact and the First Fundamental Theorem of Calculus to evaluate \[\begin{aligned}\end{aligned}\] exactly.
How are your results in (a) and (c) connected? What famous number can we now estimate using an alternating series? How many terms of the series were needed to ensure the first two digits of the famous number are accurate?
Хариулт
Since \(\frac{1}{1+x} = 1 - x + x^2 - x^3 + \cdots\), we can write \[\begin{aligned}\end{aligned}\], so \[\begin{aligned}\int_0^1 \frac{4}{1+x^2} \, dx =\mathstrut \amp \int_0^1 4 - 4x^2 + 4x^4 - 4x^6 + \cdots \, dx \\ =\mathstrut \amp \left. 4x - \frac{4}{3}x^3 + \frac{4}{5}x^5 - \frac{4}{7}x^7 + \cdots \right|_0^1 \\ =\mathstrut \amp 4 - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \cdots\end{aligned}\]
Since \(\int_0^1 \frac{4}{1+x^2} \, dx = 4 - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \cdots\), to estimate this alternating series to within \(0.01\), we need \(\frac{4}{2n+1} \lt 0.01\), which happens when \(n = 200\)!
By the First Fundamental Theorem of Calculus, \[\begin{aligned}\end{aligned}\].
Since both (a) and (c) find representations for \(\int_0^1 \frac{4}{1+x^2} \, dx\), it follows that the two representations are equal, and thus \[\begin{aligned}\end{aligned}\]. And if we use \(200\) terms, the result is only accurate to two decimal places!
Symbols used here
Add a_k for k = 1 up to n.
Not a number: "grows without bound" in limits and intervals.
The exponent b must be raised to for x; ln uses base e.
Ratios of sides in a right triangle; coordinates on the unit circle.
The angle whose sine is the given value (and likewise arccos, arctan).
Distance from zero: |−3| = 3. For a complex number, distance from the origin.
Instantaneous rate of change; slope of the graph.
2.71828…, the base whose exponential is its own derivative.
Equal to the precision shown, not exactly.
Inequalities that allow equality; < and > exclude it.
Least upper bound, greatest lower bound.
Ratio of a circle's circumference to its diameter, 3.14159…
The value f(x) approaches as x approaches a.
Antiderivative (indefinite) or signed area from a to b (definite).
Prime notation for derivatives with respect to x (or t).
Constants of integration fixed by initial conditions.
How to: Quantifying the accuracy of approximations
- For an infinite series that converges, how much accuracy do we lose when we truncate the series after a finite number of terms to approximate its value with a finite sum? Said differently, to get a good approximation with a finite sum, how many terms are enough?
- What is an alternating series and how can we determine whether or not it converges? How do the partial sums of a converging alternating series accurately estimate its exact sum?
- What is the Lagrange Error Bound and how can we use it to understand how accurate a function's degree-n Taylor polynomial approximation is?
Questions people ask
What is a derivative in one sentence?
The slope of the graph at a point — the rate at which the output is changing there. Speed is the derivative of position.
What is an integral in one sentence?
The accumulated total of a rate — the area under the curve. Distance travelled is the integral of speed.
Why are derivatives and integrals opposites?
That is the fundamental theorem of calculus: accumulating a rate and then measuring how fast the accumulation grows gets you back the rate. Integration undoes differentiation up to a constant.
When do I use substitution and when integration by parts?
Substitution when part of the integrand is the derivative of another part (u and du both present). Parts when the integrand is a product of two unrelated kinds of function — a polynomial times an exponential, log or trig function.
Өөрийнхөөг турш
Parts of this page are adapted from Boelkins, Active Calculus (CC BY-SA 4.0). Condensed and re-explained here; errors are ours.
Бүх зүйл Calculus
LimitsDerivativesIntegralsDefinite integralsTaylor seriesSeries and sumsMaxima and minimaThe chain ruleImplicit differentiationRelated rates and optimisationIntegration techniques: substitution, parts, partial fractionsApplications of integration: area, volume, arc lengthInfinite series and convergence tests