Tutorials › Calculus II › Taylor Approximations as Local Computational Models

Taylor Methods in Computation · Tutorial 874 of 998

Taylor Approximations as Local Computational Models

Build Taylor polynomials from derivatives at a center and use them to compute nearby function values with a check on the approximation error.

Advanced 9 min read

What You'll Learn

  • Define a degree-n Taylor polynomial centered at a and identify its coefficients.
  • Explain why the polynomial matches the function’s derivatives through degree n at the center.
  • Estimate nearby exponential, logarithmic, and sine values by evaluating Taylor polynomials.
  • Use Taylor’s theorem or an alternating-series remainder bound to check an estimate.
  • Recognize why a local approximation should not be treated as a global formula.

Introduction

A Taylor polynomial turns information about a function at one point into a practical way to estimate its values nearby. Its coefficients record the function’s value, slope, curvature, and higher-order behavior at a chosen center. Once those coefficients are known, evaluating the polynomial requires only arithmetic.

The polynomial is a local computational model, not generally an exact replacement for the function. A remainder theorem describes how far the estimate can be from the true value, provided its hypotheses are satisfied. This distinction matters: a convenient numerical answer is useful only when we understand what it approximates and how its accuracy is checked.

Definition and construction

Let \(f\) have derivatives through order \(n\) at a point \(a\). The degree-\(n\) Taylor polynomial of \(f\) centered at \(a\) is

$$ T_n(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k =f(a)+f'(a)(x-a)+\frac{f''(a)}{2!}(x-a)^2+\cdots+\frac{f^{(n)}(a)}{n!}(x-a)^n. $$

Here \(f^{(0)}(a)\) means \(f(a)\), and \(0!=1\). The polynomial has degree at most \(n\): some of its highest coefficients may be zero. To estimate \(f(x)\), calculate \(T_n(x)\). The displacement \(x-a\) makes the polynomial a model around \(a\); it is exact at the center because \(T_n(a)=f(a)\).

Definition: The degree-\(n\) Taylor approximation to \(f(x)\) about \(a\) is \(T_n(x)\). Its error, or remainder, is \(R_n(x)=f(x)-T_n(x)\). An approximation is an estimate, not an equality, unless the remainder is zero.

The familiar Maclaurin polynomial is the special case \(a=0\). Using a nonzero center changes the powers to \((x-a)^k\) and uses derivatives evaluated at \(a\), rather than at zero.

Why these coefficients work

The coefficients are selected so that the polynomial reproduces the function and its first \(n\) derivatives at the center. This gives a precise reason for the factorials in the formula. Write a general polynomial in powers of the displacement as \(P_n(x)=c_0+c_1(x-a)+\cdots+c_n(x-a)^n\). At \(x=a\), every positive power vanishes, so \(P_n(a)=c_0\). Differentiating once and evaluating at \(a\) gives \(P_n'(a)=c_1\); differentiating twice gives \(P_n''(a)=2!c_2\). In general, terms of degree greater than \(k\) still contain a positive power of \(x-a\) after \(k\) differentiations, and terms of degree less than \(k\) have vanished. Thus \(P_n^{(k)}(a)=k!c_k\), so matching \(P_n^{(k)}(a)=f^{(k)}(a)\) forces \(c_k=f^{(k)}(a)/k!\).

This matching property explains how the polynomial is constructed. Taylor’s theorem explains when it gives a controlled estimate. If \(f\) has a continuous \((n+1)\)st derivative on the interval between \(a\) and \(x\), then for some point \(\xi\) between them,

$$ f(x)=T_n(x)+R_n(x), \qquad R_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1}. $$

In particular, if \(\lvert f^{(n+1)}(t)\rvert\le M\) throughout that interval, then

$$ \lvert f(x)-T_n(x)\rvert\le \frac{M\lvert x-a\rvert^{n+1}}{(n+1)!}. $$

This bound is a check on an estimate, not another term to add to the polynomial. For some functions and intervals, an alternating-series remainder bound gives a useful alternative; its conditions must also be checked.

Worked Examples

Worked Example: Estimating an exponential value

Estimate \(e^{0.2}\) with the degree-4 Maclaurin polynomial. For \(f(x)=e^x\), every derivative is \(e^x\), so every derivative at zero equals \(1\). Therefore,

$$ T_4(x)=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}. $$

Substitute \(x=0.2\) and evaluate each term:

$$ \begin{aligned} T_4(0.2) &=1+0.2+\frac{0.2^2}{2}+\frac{0.2^3}{6}+\frac{0.2^4}{24}\\ &=1+0.2+0.02+0.001333333\ldots+0.000066666\ldots\\ &=1.2214. \end{aligned} $$

To check the estimate, Taylor’s theorem gives \(R_4(0.2)=e^\xi(0.2)^5/5!\) for some \(\xi\) between \(0\) and \(0.2\). Since \(0<\xi<0.2\), the positive-term exponential series gives \(e^\xi<\sum_{k=0}^{\infty}0.2^k=1.25\). Also, \((0.2)^5/120=0.00032/120=1/375000\). Hence

$$ \lvert R_4(0.2)\rvert < \frac{1.25}{375000} =\frac{1}{300000} =0.000003333\ldots . $$

Thus \(1.2214\) differs from \(e^{0.2}\) by less than \(0.000003334\). As a numerical check, \(e^{0.2}\approx1.221402758\), whose difference from the estimate is about \(0.000002758\), within the bound.

Worked Example: Estimating a logarithm near its center

Estimate \(\ln(1.1)\) using a degree-4 Taylor polynomial centered at \(a=1\). For \(f(x)=\ln x\), \(f(1)=0\), and its derivatives at \(1\) are \(f'(1)=1\), \(f''(1)=-1\), \(f'''(1)=2\), and \(f^{(4)}(1)=-6\). Substitution into the definition gives

$$ T_4(x)=(x-1)-\frac{(x-1)^2}{2} +\frac{(x-1)^3}{3}-\frac{(x-1)^4}{4}. $$

Set \(h=x-1=0.1\). Then

$$ \begin{aligned} T_4(1.1) &=0.1-\frac{0.1^2}{2}+\frac{0.1^3}{3}-\frac{0.1^4}{4}\\ &=0.1-0.005+0.000333333\ldots-0.000025\\ &=0.095308333\ldots . \end{aligned} $$

For \(0<h<1\), the alternating logarithm expansion has decreasing term magnitudes \(h^k/k\). Its alternating-series error after the \(h^4/4\) term is at most the first omitted term \(h^5/5\). At \(h=0.1\), that bound is \(0.1^5/5=0.00001/5=0.000002\). Therefore,

$$ \lvert \ln(1.1)-T_4(1.1)\rvert\le 0.000002. $$

A numerical check gives \(\ln(1.1)\approx0.095310180\); the difference from \(0.095308333\ldots\) is about \(0.000001847\), within the stated bound.

Worked Example: Estimating a trigonometric value

Estimate \(\sin(0.3)\) with the degree-5 Maclaurin polynomial. The derivatives of sine cycle through \(\sin x\), \(\cos x\), \(-\sin x\), and \(-\cos x\). Evaluating at zero gives the degree-5 polynomial

$$ T_5(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}. $$

Evaluate at \(x=0.3\), including the zero coefficients of the even powers implicitly:

$$ \begin{aligned} T_5(0.3) &=0.3-\frac{0.3^3}{6}+\frac{0.3^5}{120}\\ &=0.3-\frac{0.027}{6}+\frac{0.00243}{120}\\ &=0.3-0.0045+0.00002025\\ &=0.29552025. \end{aligned} $$

For the degree-5 remainder, Taylor’s theorem uses the sixth derivative, \(f^{(6)}(x)=-\sin x\), whose absolute value is at most \(1\). Thus

$$ \lvert R_5(0.3)\rvert \le \frac{0.3^6}{6!} =\frac{0.000729}{720} =0.0000010125. $$

The estimate \(0.29552025\) is therefore within \(0.0000010125\) of the true value. Indeed, \(\sin(0.3)\approx0.295520207\), a difference of about \(0.000000043\). The bound verifies the estimate without requiring the approximate reference value.

Reading the polynomial as a local model

Each term has a distinct role. The constant term gives the function’s value at the center. The linear term records its slope there. The quadratic term accounts for curvature, and successive terms incorporate higher derivatives. A degree-\(n\) Taylor polynomial matches the function’s derivatives through order \(n\) at \(a\), but that matching alone does not guarantee a small error far from \(a\). The remainder bound supplies information about the error on the interval of interest.

It is also important to distinguish the degree of the polynomial from the number of nonzero terms. For example, the degree-5 Taylor polynomial for sine includes zero coefficients for the even powers; it is still correctly called degree 5 because terms through power 5 have been considered. In practice, symmetry or a zero derivative may remove some calculations, but the stated degree determines which derivatives are matched.

A Taylor approximation is useful when a function is costly or inconvenient to evaluate repeatedly and a polynomial gives a simpler nearby calculation. The examples show the same workflow across different functions: compute derivatives at the center, form the polynomial, substitute the target input, and check the error under a valid bound. The polynomial gives the estimate; the theorem or series remainder justifies its accuracy.

A common coefficient mistake

For \(\ln(1+h)\), a common error is to copy the alternating signs and powers but omit the divisors \(2,3,4,\ldots\). At \(h=0.1\), this mistake would produce

$$ 0.1-0.1^2+0.1^3-0.1^4 =0.1-0.01+0.001-0.0001 =0.0909, $$

which is not the degree-4 Taylor estimate. The correct coefficients are obtained from the derivatives: the \(k\)th power has coefficient \(f^{(k)}(1)/k!=(-1)^{k-1}/k\). Thus the correct calculation is \(0.1-0.1^2/2+0.1^3/3-0.1^4/4=0.095308333\ldots\). Checking the derivative-based coefficient formula before substituting numbers prevents this error.

Check Your Understanding

Use the definition and remainder information, where applicable, to answer these questions.

  1. Write the degree-3 Taylor polynomial for \(e^x\) centered at \(a=0\).
  2. Why does the coefficient of \((x-a)^k\) equal \(f^{(k)}(a)/k!\)?
  3. For \(f(x)=\ln x\), identify the degree-2 Taylor polynomial centered at \(a=1\).
  4. What derivative is used in the Lagrange remainder for a degree-5 approximation, and what condition on that derivative is needed?
  5. Why is a Taylor polynomial a local model rather than automatically a reliable formula for every input?