Tutorials › Real Analysis › Approximation by Polynomials

Approximation Theory · Tutorial 634 of 1000

Approximation by Polynomials

Use Taylor’s theorem with an integral remainder to construct polynomial approximations and quantify their errors.

Advanced 10 min read

What You'll Learn

  • Define Taylor polynomials about a chosen center and identify the differentiability needed to use them.
  • Derive the integral remainder formula by integration by parts.
  • Bound the Taylor error using a supremum bound on a higher derivative.
  • Apply the bound to functions on intervals and estimate best polynomial approximation errors.
  • Recognize conditions that guarantee uniform convergence of Taylor polynomials.
  • Distinguish finite-order Taylor approximation from convergence of an infinite Taylor series.

Taylor Polynomials as Approximants

The Weierstrass Approximation Theorem guarantees that every continuous function on a closed interval can be approximated uniformly by polynomials. The Bernstein construction used earlier in this course is one way to produce such approximants. When a function has derivatives, there is another natural construction: use its values and derivatives at a chosen point to build a Taylor polynomial. Taylor’s theorem then measures the error in terms of a higher derivative.

This method has a different scope from the general Weierstrass theorem. A Taylor polynomial of a given degree uses information about the function near one center, while a uniform approximation concerns the error at every point of the interval. A derivative bound can connect the two: if it holds throughout the interval, the Taylor error estimate is uniform.

Definition: Let \(f\) have derivatives through order \(n\) at a point \(c\). The Taylor polynomial of degree \(n\) for \(f\) centered at \(c\) is $$ T_{n,c}f(x)=\sum_{j=0}^{n}\frac{f^{(j)}(c)}{j!}(x-c)^j, $$ where \(f^{(0)}=f\) and \(0!=1\). It is a polynomial of degree at most \(n\); its degree can be smaller if some of its highest-order coefficients vanish.

The center \(c\) and degree \(n\) are choices. The Taylor polynomial agrees with \(f\) and its first \(n\) derivatives at \(c\), but those matching conditions alone do not tell us how close the polynomial is elsewhere. For that, we need a remainder formula and a bound on the next derivative.

The Integral Remainder and an Error Bound

Theorem (Taylor’s Theorem with Integral Remainder): Let \(a<b\), \(c\in[a,b]\), and \(n\geq0\). Suppose \(f\in C^{n+1}[a,b]\). For every \(x\in[a,b]\), $$ f(x)=T_{n,c}f(x)+R_{n,c}(x), \qquad R_{n,c}(x)=\int_c^x\frac{(x-t)^n}{n!}f^{(n+1)}(t)\,dt. $$ If \(|f^{(n+1)}(t)|\leq M\) for all \(t\in[a,b]\), then $$ |f(x)-T_{n,c}f(x)| \leq \frac{M|x-c|^{n+1}}{(n+1)!}. $$

Proof. For each integer \(m\geq0\), write

$$ I_m(x)=\int_c^x\frac{(x-t)^m}{m!}f^{(m+1)}(t)\,dt. $$

For \(m=0\), the Fundamental Theorem of Calculus gives \(I_0(x)=f(x)-f(c)\). For \(m\geq1\), integrate by parts with \(u=(x-t)^m/m!\) and \(dv=f^{(m+1)}(t)\,dt\). Then \(du=-(x-t)^{m-1}/(m-1)!\,dt\) and \(v=f^{(m)}(t)\). Thus

$$ \begin{aligned} I_m(x) &=\left[\frac{(x-t)^m}{m!}f^{(m)}(t)\right]_{t=c}^{t=x} +\int_c^x\frac{(x-t)^{m-1}}{(m-1)!}f^{(m)}(t)\,dt\\ &=-\frac{(x-c)^m}{m!}f^{(m)}(c)+I_{m-1}(x). \end{aligned} $$

The endpoint term at \(t=x\) is zero because \(m\geq1\). The calculation uses only the assumed derivatives through order \(m+1\). Iterating the recurrence from \(m=n\) down to \(m=1\), and using the formula for \(I_0\), yields

$$ I_n(x)=f(x)-f(c)-\sum_{j=1}^{n}\frac{f^{(j)}(c)}{j!}(x-c)^j. $$

This is \(f(x)-T_{n,c}f(x)\), proving the remainder formula. The integrations by parts are valid as oriented integrals whether \(x\geq c\) or \(x<c\). For the bound, take absolute values and use \(|f^{(n+1)}(t)|\leq M\). Integrating over the interval between \(c\) and \(x\) gives

$$ \begin{aligned} |R_{n,c}(x)| &\leq \frac{M}{n!}\int_{\min(c,x)}^{\max(c,x)}|x-t|^n\,dt\\ &=\frac{M|x-c|^{n+1}}{(n+1)!}. \end{aligned} $$

This proves the estimate for either order of the endpoints and completes the proof. \(\square\)

The bound depends on two quantities: the distance from the center and the size of the \((n+1)\)-st derivative. To obtain one error bound across \([a,b]\), set \(R=\max(c-a,b-c)\). If the derivative is bounded by \(M\) there, then \(|x-c|\leq R\) for every \(x\) in the interval, so

$$ \|f-T_{n,c}f\|_{\infty,[a,b]} \leq\frac{MR^{n+1}}{(n+1)!}. $$

This is a uniform estimate because its right-hand side does not depend on \(x\). Recall from Polynomial Approximation that \(E_n(f;[a,b])\) is the least possible uniform error among polynomials of degree at most \(n\). Since \(T_{n,c}f\) is one such polynomial, its error also bounds the best possible error from above.

Corollary (Taylor Bound for Best Approximation): Under the hypotheses of Taylor’s Theorem with Integral Remainder, if \(|f^{(n+1)}(t)|\leq M\) on \([a,b]\), then $$ E_n(f;[a,b])\leq \frac{MR^{n+1}}{(n+1)!}, \qquad R=\max(c-a,b-c). $$

Proof. By the definition of \(E_n(f;[a,b])\), it is the infimum of \(\|f-p\|_{\infty,[a,b]}\) over \(p\in\mathcal P_n\). The Taylor polynomial \(T_{n,c}f\) belongs to \(\mathcal P_n\), so the infimum is no greater than its error. Apply the uniform Taylor error bound. \(\square\)

Worked Examples

Worked Example: Approximating Cosine on a Symmetric Interval

Let \(f(x)=\cos x\) on \([-1,1]\), take \(c=0\), and use degree \(3\). The derivatives at \(0\) are \(f(0)=1\), \(f'(0)=0\), \(f''(0)=-1\), and \(f'''(0)=0\). Therefore

$$ T_{3,0}f(x)=1-\frac{x^2}{2}. $$

The fourth derivative is \(f^{(4)}(x)=\cos x\), so \(|f^{(4)}(x)|\leq1\) throughout the interval. Here \(M=1\), \(R=1\), and \(n=3\). Taylor’s error bound gives

$$ \left\|\cos x-\left(1-\frac{x^2}{2}\right)\right\|_{\infty,[-1,1]} \leq\frac{1}{4!}=\frac{1}{24}. $$

Thus one polynomial approximates cosine to within \(1/24\) at every point of \([-1,1]\). In particular, \(E_3(\cos;[-1,1])\leq1/24\). The bound is a guarantee, not necessarily the exact best error.

Worked Example: Approximating a Logarithm Near the Origin

Consider \(f(x)=\ln(1+x)\) on \([-1/2,1/2]\), again with center \(c=0\). For each integer \(k\geq1\),

$$ f^{(k)}(x)=\frac{(-1)^{k-1}(k-1)!}{(1+x)^k}. $$

At zero, these derivatives give the degree-three Taylor polynomial \(T_{3,0}f(x)=x-x^2/2+x^3/3\). The fourth derivative is \(-6/(1+x)^4\). On the interval, \(1+x\geq1/2\), so \(|f^{(4)}(x)|\leq6/(1/2)^4=96\). Since \(R=1/2\), the error estimate is

$$ \left\|\ln(1+x)-\left(x-\frac{x^2}{2}+\frac{x^3}{3}\right)\right\|_{\infty,[-1/2,1/2]} \leq\frac{96(1/2)^4}{4!} =\frac{1}{4}. $$

The derivative bound is deliberately taken on the whole interval, not only at the center. That is what makes the resulting estimate valid uniformly for every \(x\) in the interval.

Worked Example: An Exact Error for a Geometric Polynomial

For \(f(x)=1/(1+x)\) on \([-1/2,1/2]\), the degree-\(n\) Taylor polynomial at zero is \(S_n(x)=\sum_{k=0}^{n}(-x)^k\). The finite geometric identity \((1+x)S_n(x)=1-(-x)^{n+1}\) holds: multiplying the sum by \(1+x\) cancels the intermediate powers and leaves precisely those two terms. Consequently,

$$ \frac{1}{1+x}-S_n(x)=\frac{(-x)^{n+1}}{1+x}. $$

On this interval, \(|x|\leq1/2\) and \(1+x\geq1/2\), hence

$$ \left|\frac{1}{1+x}-S_n(x)\right| \leq\frac{(1/2)^{n+1}}{1/2} =2^{-n}. $$

This exact identity proves uniform convergence of these Taylor polynomials to \(f\) on the interval: given \(\varepsilon>0\), choose \(n\) so that \(2^{-n}<\varepsilon\). The calculation also shows that an exact algebraic remainder can sometimes give a sharper estimate than a general derivative bound.

When Do Taylor Polynomials Converge Uniformly?

Theorem (A Derivative Criterion for Uniform Taylor Convergence): Let \(f\in C^\infty[a,b]\), fix \(c\in[a,b]\), and put \(R=\max(c-a,b-c)\). For each \(n\geq0\), let $$ M_{n+1}=\sup_{t\in[a,b]}|f^{(n+1)}(t)|. $$ If $$ \frac{M_{n+1}R^{n+1}}{(n+1)!}\longrightarrow0, $$ then \(T_{n,c}f\) converges uniformly to \(f\) on \([a,b]\).

Proof. Taylor’s Theorem with Integral Remainder gives, for every \(x\in[a,b]\),

$$ |f(x)-T_{n,c}f(x)| \leq\frac{M_{n+1}|x-c|^{n+1}}{(n+1)!} \leq\frac{M_{n+1}R^{n+1}}{(n+1)!}. $$

Taking the supremum over \(x\) gives the same upper bound for \(\|f-T_{n,c}f\|_{\infty,[a,b]}\). By hypothesis this bound tends to zero as \(n\) tends to infinity. This is exactly uniform convergence of the Taylor polynomials to \(f\). \(\square\)

The criterion is sufficient, not necessary: failure of this particular bound to tend to zero does not prove that the Taylor polynomials fail to converge. The exact geometric remainder in the preceding example illustrates why another method of estimating the error can be useful.

A Necessary Distinction

Taylor’s theorem gives a finite-degree approximation whenever the required derivatives exist. It does not say that the Taylor polynomials converge to the function as the degree increases. Even having continuous derivatives of every order is not enough by itself. For example, define \(g(0)=0\) and \(g(x)=e^{-1/x^2}\) for \(x\neq0\). This function is infinitely differentiable, and all its derivatives at zero vanish; its Taylor polynomials centered at zero are therefore all the zero polynomial. But \(g(x)>0\) for every \(x\neq0\), so those polynomials do not converge to \(g\) at any such point.

The smoothness assertion follows from the fact that, away from zero, each derivative is a polynomial in \(1/x\) multiplied by \(e^{-1/x^2}\). As \(x\) tends to zero, this product tends to zero for every fixed polynomial: the exponential decays faster than any fixed power of \(1/|x|\). Repeatedly applying the definition of the derivative at zero then shows that each derivative extends there with value zero. This example warns against replacing the finite-order remainder estimate with an unjustified claim about an infinite Taylor series.

Takeaway: A Taylor polynomial is a concrete candidate for polynomial approximation when derivatives are available. The integral remainder formula turns a bound on the next derivative into a uniform error estimate, and therefore also bounds the best degree-\(n\) approximation error. Convergence of the resulting sequence requires an additional argument.

Check Your Understanding

Use the definitions and estimates in this tutorial to answer the following questions.

  1. What data at the center \(c\) determine the Taylor polynomial of degree \(n\)?
  2. In the integration-by-parts step for \(I_m(x)\), what choices of \(u\) and \(dv\) produce the recurrence using only the stated derivatives?
  3. If \(|f^{(n+1)}|\leq M\) on an interval and \(|x-c|\leq R\), what uniform error bound follows?
  4. Why does the Taylor error bound also give an upper bound for \(E_n(f;[a,b])\)?
  5. Does infinite differentiability alone guarantee that the Taylor polynomials converge to the function? Explain using the example discussed above.