Approximating Functions with Taylor and Maclaurin Polynomial
Recall from the Taylor and Maclaurin Polynomials page that $f$ is a function that is $n$ times differentiable on an open interval containing $c$, then the $n^{\mathrm{th}}$ order Taylor polynomial of $f$ at $c$ is given by the following formula:
(1)We also saw that error remainder $E_n(x)$ can be estimated using either the Lagrange Remainder formula, $E_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}(x - c)^{n+1}$ for some $\xi$ between $c$ and $x$, or sometimes using the Integral Remainder formula, $E_n(x) = \frac{1}{n!} \int_c^x (x - t)^n f^{(n+1)}(t) \: dt$.
If we take the absolute value of the Lagrange formula of the remainder for some $x_0$ that we're approximating $f(x_0)$ for, then we have that:
(2)If we can find $\xi$ between $c$ and $x_0$ for which $f^{(n+1)}(\xi)$ is maximized, then $E_n(x_0)$ will be maximized. Let's look at some examples.
Example 1
Estimate the maximum error by approximating the value $\sqrt{e}$ using the fourth degree Taylor polynomial of $f(x) = e^x$ centered at $0$.
Let's first construct the fourth degree Taylor polynomial of $f$. We note that $f^{(n)}(x) = e^x$ for all natural numbers $n$, and hence:
(3)Now the absolute value of the Lagrange formula for the remainder for some $\xi$ between $0$ and $0.5$ is given by:
(4)Note that $f(x) = e^x$ is an increasing function on the interval $[0, 0.5]$. This can easily be since the derivative $f'(x) = e^x > 0$ for all $x \in \mathbb{R}$. Therefore $e^{\xi} < e^{0.5}$ for any $\xi$ between $0$ and $0.5$. However, we're trying to estimate $e^{0.5}$, so let's try to approximate further. Notice that $e^{0.5} = \sqrt{e} < \sqrt{3} < 2$, and so:
(5)So our approximation $P_n(4) \approx 1.6484375...$ has error less than $E_n(4) = \frac{2(0.5)^5}{120}$ from the actual value of $e^{0.5}$. In fact, the true value is $e^{0.5} = 1.6487212...$, and thus:
(6)The blue curve below is the graph of the polynomial $P_4(x)$, and the black curve if the graph of $f(x) = e^x$.