Calculus II 09.07 Taylor Polynomials and Approximations
Previous | Calculus II 09.06 The Ratio and Root Tests |
Next | Calculus II 09.08 Power Series |
Contents
- 1 9.7 Taylor Polynomials[1] and Approximations
- 1.1 Polynomial Approximations for Elementary Functions
- 1.2 Taylor and Maclaurin[2] Polynomials
- 1.3 Definition 9.7.1 Taylor and Maclaurin Polynomials
- 1.3.1 Example 9.7.3 A Maclaurin Polynomial for \(f(x)=e^{x}\)
- 1.3.2 Example 9.7.4 Finding Taylor Polynomials for \(\ln x \)
- 1.3.3 Example 9.7.5 Finding Maclaurin Polynomials for \(\cos x \)
- 1.3.4 Example 9.7.6 Finding a Taylor Polynomial for \(\sin x \)
- 1.3.5 Example 9.7.7 Approximation Using Maclaurin Polynomials
- 1.4 Taylor Polynomial Remainder
- 2 Internal Links
9.7 Taylor Polynomials[1] and Approximations
- Find polynomial approximations for elementary functions.
- Find Taylor and Maclaurin polynomial approximations for elementary functions.
- Use the remainder from a Taylor polynomial.
Polynomial Approximations for Elementary Functions
|
Polynomial functions can be used as approximations for other elementary functions. To find a polynomial \(P\) function that approximates another function \(f\), begin by choosing a number \(c\) in \(f\)'s domain at which \(f\) and \(P\) have the same value and the same slope. That is.
The approximating polynomial is described as expanded about \(c\) or centered at \(c\). Geometrically, the requirement that \(P(c)=f(c)\) means that \(P\)'s graph passes through the point \((c,f(c))\). Since infinitely many graphs can pass through \((c,f(c))\) the slopes must be equal to produce a linear approximation for \(f\) as shown in Figure 9.7.1. |
Example 9.7.1 First-Degree Polynomial Approximation for \(f(x)=e^{x}\)
|
For \(f(x)=e^{x}\) find a first-degree polynomial function \(P_{1}(x)=a_{0}+a_{1}x\) whose value and slope agree with the value and slope for \(f\) at \(x=0\).
and
Because \(P_{1}(x)=a_{0}+a_{1}x\), you can use the condition that \(P_{1}(0)=f(0)\) to conclude that \(a_{0}=1\). Because \(P_{1}'(x)=a_{1}\), you can use the condition that \(P_{1}'(0)=f'(0)\) to conclude that \(a_{1}=1\). Therefore, \(P_{1}(x)=1+x\). Figure 9.7.2 shows the graphs for \(P_{1}(x)=1+x\) and \(f(x)=e^{x}\). |
|
In Figure 9.7.3 points near (0,1), the graph for the first-degree polynomial function
is reasonably close to the graph for \(f(x)=e^{x}\). Moving either way along the 1st-degree graph away from (0,1) and the approximation's accuracy decreases. To improve the approximation another requirement is needed. That the second derivatives for \(P\) and \(f\) agree when \(x=0\). The polynomial, \(P_{1}\), with the least degree that satisfies all three requirements, \(P_{2}(0)=f(0)\), \(P_{2}^{"}(0)=f{}'(0)\), and \( P_{2}^{"} (0)=f^{"} (0) \) is
as shown in Figure 9.7.3. By extending this method to the first \(n\) derivatives that math \(f(x)=e^{x}\) at \(x=0\), produces the \(n\)th-degree approximation.
|
Example 9.7.2 Third-Degree Polynomial Approximation for \(f(x)=e^{x}\)
|
Construct a table comparing the values for the polynomial
with \(f(x)=e^{x}\) where \(x\) is several values near 0.
|
Taylor and Maclaurin[2] Polynomials
The polynomial approximation for
- $$f(x)=e^{x}$$
in Example 9.7.2 is expanded about the point \(c=0\). For expansions about an arbitrary value for \(c\), it is convenient to write the polynomial in the form
- $$P_{3}(x)=a_{0}+a_{1}(x-c)+a_{2}(x-c)^{2}+a_{3}(x-c)^{3}+\cdots+a_{n}(x-c)^{n}.$$
Using this form repeated differentiation can be described as
\(P_{n}{}^{\prime}(x)\) | \(= a_{1}+2a_{2}(x-c)+3a_{3}(x-c)^{2}+\cdots+n(n-1)a_{n}(x-c)^{n-1} \) |
\(P_{n}{}^{\prime \prime}(x)\) | \(= 2a_{2}+2(3a_{3})(x-c)+\cdots+n(n-1)a_{n}(x-c)^{n-2} \) |
\(P_{n}{}^{\prime \prime \prime}(x)\) | \(= 2(3a_{3})+\cdots+n(n-1)(n-2)a_{n}(x-c)^{n-3}\) |
\( \vdots\) | |
\(P_{n}{}^{(n)}(x)\) | \(=n(n-1)(n-2)\cdots(2)(1)a_{n}. \) |
Letting \(x=c\) yields
- \( P_{n}(c)=a_{1},\:\:P_{n}{}^{\prime }(c)= a_{1},\:\:P_{n}{}^{\prime \prime}(c)= 2a_{2},...,\:\:P_{n}{}^{(n)}(c)= n!a_{n} \)
- \( P_{n}(c)=a_{1},\:\:P_{n}{}^{\prime }(c)= a_{1},\:\:P_{n}{}^{\prime \prime}(c)= 2a_{2},...,\:\:P_{n}{}^{(n)}(c)= n!a_{n} \)
and because the values for \(f\) and its first \(n\) derivatives must agree with the values for \( P_{n}\) and its first \(n\) derivatives at \(x=c\), it follows that
- \( f(c)=a_{1},\:\:f{}^{\prime }(c)= a_{1},\:\:\frac{f{}^{\prime \prime}(c)}{2!}= a_{2},...,\:\: \frac{f{}^{(n)}(c)}{n!}=a_{n}.\)
- \( f(c)=a_{1},\:\:f{}^{\prime }(c)= a_{1},\:\:\frac{f{}^{\prime \prime}(c)}{2!}= a_{2},...,\:\: \frac{f{}^{(n)}(c)}{n!}=a_{n}.\)
These coefficients are used to define Taylor polynomials, named after the English mathematician Brook Taylor[3], and Maclaurin polynomials, named after the English mathematician Colin Maclaurin[4].
Definition 9.7.1 Taylor and Maclaurin Polynomials
If \(f\) has \(n\) derivatives at \(c\), then the polynomial
- $$ P_{n}(x)=f(c) +f{}^{\prime }(c)(x-c)+ \frac{f{}^{\prime \prime}(c)}{2!}(x-c)^{2}+\cdots+ \frac{f{}^{(n)}(c)}{n!}(x-c)^{n} $$
is called the \(n\)th Taylor polynomial for \(f\) at \(c\). If \(c=0\), then
- $$ P_{n}(x)=f(0) +f{}^{\prime }(0)x+\frac{f{}^{\prime \prime}(0)}{2!}x^{2}+\frac{f{}^{\prime \prime \prime}(0)}{3!}x^{3}+\cdots+ \frac{f{}^{(n)}(0)}{n!}x^{n} $$
is also called the \(n\)th Maclaurin polynomial for \(f\).
Example 9.7.3 A Maclaurin Polynomial for \(f(x)=e^{x}\)
Find the \(n\)th Maclaurin polynomial for
- $$ f(x)=e^{x}. $$
Solution From Definition 9.7.1, the \(n\)th Maclaurin polynomial is
- $$ P_{n}(x)= 1 + x + \frac{1}{2!}x^{2}+\frac{1}{3!}x^{3}+\cdots+ \frac{1}{n!}x^{n}. $$
Example 9.7.4 Finding Taylor Polynomials for \(\ln x \)
|
Find the Taylor polynomials \(P_{0}, \: P_{1},\: P_{2},\: P_{3},\:\text{ and } P_{4}\) for
centered at \(c=1\).
Therefore, the Taylor polynomials are as follows.
Figure 9.7.4 compares the graphs for \(P_{0}, \: P_{1},\: P_{2},\: P_{3},\:\text{ and } P_{4}\) with the graph for \(f(x)=\ln x\). Note that near \(x=1\), the graphs are nearly indistinguishable. For instance,
and
|
Example 9.7.5 Finding Maclaurin Polynomials for \(\cos x \)
|
Find the Maclaurin polynomials \(P_{0}, \: P_{2},\: P_{4},\:\text{ and } P_{6}\) for \( f(x)=\cos x\). Use \(P_{6}(x)\) to approximate the value for \(\cos(0.1)\).
Through repeated differentiation pattern 1, 0, -1, 0 continues, and produces the Maclaurin polynomials
and
Using \(P_{6}(x)\) yields the approximation \(\cos(0.1) \approx 0.995004165\), which agrees with a computer calculation to nine decimal places. Figure 9.7.4 compares the graphs for \(f(x)=\cos x\) and \(P_{6}(x)\). Note in Example 9.7.5 that the Maclaurin polynomials for \( \cos x\) have only even powers for \(x\). Similarly, the Maclaurin polynomials for \( \sin x\) have only odd powers \(x\). This is not generally true for the Taylor polynomials for \( \sin x\) and \( \cos x \) expanded about \(c \ne 0\), as you can see in Example 9.7.6. |
Example 9.7.6 Finding a Taylor Polynomial for \(\sin x \)
|
Find the third Taylor polynomials for \( f(x)=\sin x\), expanded about \(c=\pi/6\).
The third Taylor polynomial for \(f(x)=\sin x\), about \(c=\pi/6\) is
Figure 9.7.7 compares the graphs for \(f(x)=\sin x\) and \(P_{3}\). |
Example 9.7.7 Approximation Using Maclaurin Polynomials
Use a fourth Maclaurin polynomial to approximate the value for \(\ln(1.1)\).
Solution Because 1.1 is closer to 1 than to 0 consider Maclaurin polynomials for the function \(g(x)=\ln(1+x)\).
\( g(x)= \ln(1+ x) \) | \( g(\color{red}{0})= \ln(1+ \color{red}{0}) = 0 \) |
\( g{}^{\prime }(x)=(1+x)^{-1} \) | \( g{}^{\prime }(1+ \color{red}{0})^{-1}= 1 \) |
\( g{}^{\prime \prime }(x)=-(1+x)^{-2} \) | \( g{}^{\prime \prime }(\color{red}{0})=-(1+\color{red}{0})^{-2}= -1 \) |
\( g{}^{\prime \prime \prime }(x)=2(1+x)^{-3} \) | \( g{}^{\prime \prime \prime }(\color{red}{0})=2(1+\color{red}{0})^{-3}=2 \) |
\( g{}^{ (4) }(x)=-6(1+x)^{-4} \) | \( g{}^{ (4) }(\color{red}{0})=-6-(1+\color{red}{0})^{-4}=-6 \) |
Note that these coefficients are the same as in Example 9.7.4. Therefore, the fourth Maclaurin polynomial for \( g(x)= \ln(1+ x) \) is
$$P_{4}(x) $$ | $$=g(0)+ g{}^{\prime}(0)x + \frac{g{}^{\prime \prime}(0)}{2!}x^{2}+ \frac{g{}^{\prime \prime \prime}(0)}{3!}x^{3} + \frac{g{}^{(4)}(0)}{4!}x^{4}$$ |
$$=x-\frac{1}{2}x^{2}+\frac{1}{3}x^{3}-\frac{1}{4}x^{4}. $$ |
Consequently,
- $$ \ln(1.1)= \ln(1+0.1) \approx P_{4}(0.1) \approx 0.0953083.$$
Table 9.7.2 illustrates Maclaurin polynomial approximation for \(\ln(1.1)\) to seven decimal places. As \(n\) increases, \(P_{n}(0.1)\) approaches 0.0953102.
Table 9.7.2 Maclaurin Polynomials and Approximations for \(\ln(1+x)\) at \(x=0.1\) | ||||
---|---|---|---|---|
\(n\) | 1 | 2 | 3 | 4 |
\(P_{n}(0.1)\) | 0.1000000 | 0.0950000 | 0.0953333 | 0.0953083 |
Table 9.7.3 illustrates that as you move away from the expansion point \(c=0\), the approximation's accuracy decreases.
Table 9.7.3 Maclaurin Polynomials and Approximations for \(\ln(1+x)\) | |||||
---|---|---|---|---|---|
\(x\) | 0 | 1 | 2 | 3 | 4 |
\(\ln(1+x)\) | 0 | 0.0953102 | 0.4054651 | 0.5596158 | 0.6931472 |
\(P_{4}(x)\) | 0 | 0.0953083 | 0.4010417 | 0.5302734 | 0.5833333 |
Tables 9.7.2 and 9.7.3 illustrate two very important points about Taylor and Maclaurin polynomials accuracy for use in approximations.
- The approximation is usually better for higher-degree Taylor or Maclaurin polynomials than for those with a lower degree.
- The approximation is usually better at \(x\)-values close to \(c\) than at \(x\)-values far from \(c\).
Taylor Polynomial Remainder
How accurate is the Taylor approximation? Subtract the approximation from the actual value and a remainder is left over. The smaller the remainder, the more accurate the approximation. This is described in Definition 9.7.2
Definition 9.7.2 Taylor Polynomial Remainder
Let \(f(x)\) be a differentiable function and \(P_{n}(x)\) be a Taylor Approximation for \(f\). The remainder \(R_{n}(x)\) is defined as.
Table 9.7.4 Taylor Polynomial Remainder | ||
---|---|---|
Exact value | Taylor Approx. |
Remainder |
\( f(x)\) | \( = P_{n}(x) \) | \( + R_{n}(x) \) |
Solving for the remainder produces \( R_{n}(x)=f(x)- P_{n}(x) \). The absolute value for \(R_{n}(x) \) is called the error associated with the approximation. As an equation,
- $$ Error = |R_{n}(x)| = |f(x)-P_{n}(x)| .$$
Theorem 9.7.1 Taylor's Theorem
If \(f(x)\) is a differentiable function through order \(n+1\) over an interval \(I\) containing \(c\), the, for each \(x\) in \(I\), there exists \(z\) between \(x\) and \(c\) such that $$ f(x)=f(c)+f{}^{\prime}(c)(x-c) + \frac{f{}^{\prime \prime}(c)}{2!}(x-c)^{2}+\cdots+\frac{f{}^{(n)}(c)}{n!}(x-c)^{n}+R_{n}(x)$$ where $$R_{n}(x)= \frac{f^{n+1}(z)}{(n+1)!}(x-c)^{n+1}. $$ The remainder is called the Lagrange form for the remainder.
A useful variant on Taylor's Theorem is that
- $$|R_{n}(x)| \leqslant \frac{|x-c|^{n+1}}{(n+1)!} \text{max} |f^{(n+1)}(z)| $$
where max\(|f^{(n+1)}(z)| \) is the maximum value for \(f^{(n+1)}(z)\) between \(x\) and \(c\).
When applying Taylor’s Theorem do not expect to find an exact value for \(z\). If you find \(z\), no approximation is needed. Try finding the bounds for \(f^{(n+1)}(z)\) that produces an \(R_{n}(x)\) with an acceptable size.
Example 9.7.8 Determining an Approximation's Accuracy
The third Maclaurin polynomial for \(\sin x \)is
- $$P_{3}(x)=x-\frac{1}{3!}x^{3}$$
Use Taylor’s Theorem to approximate \( \sin (0.1)\) by \(P_{3}(0.1)\) and determine the approximation's accuracy.
Solution Using Taylor’s Theorem produces
- $$ \sin x=x-\frac{1}{3!}x^{3}+R_{3}(x)= x-\frac{1}{3!}x^{3}+ \frac{f{}^{(4)}(z)}{4!}x^{4}$$
where \(0 < z < 0.1\). Therefore,
- $$ \sin(\color{red}{0.1}) \approx \color{red}{0.1}-\frac{(\color{red}{0.1})^{3}}{3!} \approx 0.1 -0.000167 = 0.099833.$$
Because \( f{}^{(4)}(z) = \sin z\), it follows that the error \(|R_{n}(0.1)|\) can be bounded as follows.
- $$0 < R_{3}(\color{red}{0.1}) = \frac{\sin z}{4!}(\color{red}{0.1})^{4} < \frac{0.0001}{4!} \approx 0.000004 $$
This implies that
- $$ 0.099833 < \sin(0.1) \approx 0.099833 + R_{3}(0.1) < 0.099833 + 0.000004 $$
or
- $$ 0.099833 < \sin(0.1) < 0.099837.$$
Example 9.7.9 Approximating a Value to a Desired Accuracy
Given a Taylor polynomial, \(P_{n}(x)\), expanded about \(c=1\). Determine the degree needed to approximate \(\ln(1.2)\) with an error less than 0.001.
Solution Referring to Example 9.7.4, the \((n+1)\)st derivative for \(f(x)=\ln x\) is.
- $$ f{}^{(n+1)}(x)=(-1)^{n} \frac{n!}{x^{n+1}}$$
Using Taylor's Theorem, the error for \(|R_{n}(1.2)|\)is
$$|R_{n}(\color{red}{1.2})| $$ | $$= \left | \frac{f{}^{(n+1)}(z)}{(n+1)!}(\color{red}{1.2}-1)^{n+1} \right | $$ |
$$=\frac{n!}{z^{n+1}} \left [ \frac{1}{(n+1)!} \right ] (0.2)^{n+1} $$ | |
$$= \frac{(0.2)^{n+1}}{z^{n+1}(n+1)} $$ |
where \(1 < z < 1.2\). On this interval, \((0.2)^{n+1}/[z^{n+1}(n+1)]\) is less than \((0.2)^{n+1}/(n+1)\). The bounds for \(n\) should be such that
- $$ \frac{(0.2)^{n+1}}{(n+1)}< 0.001 \rightarrow 1000 < (n+1)5^{n+1}. $$
By trial and error, you can determine that the least value for \(n\) that satisfies this inequality is \(n=3\). A third Taylor polynomial is needed to achieve the desired accuracy in approximating \(\ln(1.2)\).
Internal Links
Parent Article: Calculus II 09 Infinite Series