Taylor polynomials approximate a function by matching its value and derivatives at a chosen centre. A Taylor series continues that construction indefinitely. The finite approximation and the infinite representation answer different questions, and both need their assumptions stated.

A complete calculation states the coefficients, the point of evaluation, the truncation error and the range on which the representation is justified.

On this page

Taylor polynomials use derivative data

Suppose the derivatives through order NN exist at a centre aa. The order-NN Taylor polynomial is

PN(x)=∑k=0Nf(k)(a)k!(x−a)k.P_N(x)=\sum_{k=0}^{N}\frac{f^{(k)}(a)}{k!}(x-a)^k.

Here f(0)=ff^{(0)}=f and 0!=10!=1. The polynomial has degree at most NN: a coefficient can vanish. For example, the fourth-order Maclaurin polynomial for sine still has degree three, because its constant, quadratic and fourth-power coefficients are zero.

The factorials make the derivative matching work. Differentiating (x−a)k(x-a)^k exactly kk times gives k!k!; multiplying by f(k)(a)/k!f^{(k)}(a)/k! therefore produces the required derivative at the centre. Lower powers disappear after enough derivatives, and higher powers still contain a factor x−ax-a when evaluated at aa.

When a=0a=0, the polynomial is called a Maclaurin polynomial. Changing the centre changes the derivative values and the powers being used.

Use a non-zero centre

For f(x)=ln⁡xf(x)=\ln x at a=1a=1, the first derivative values are f(1)=0f(1)=0, f′(1)=1f'(1)=1, f′′(1)=−1f''(1)=-1 and f(3)(1)=2f^{(3)}(1)=2. Thus

P3(x)=(x−1)−(x−1)22+(x−1)33.P_3(x)=(x-1)-\frac{(x-1)^2}{2}+\frac{(x-1)^3}{3}.

This is a polynomial in the displacement x−1x-1, not in powers of xx centred at zero. At x=1.1x=1.1, it gives approximately 0.09533330.0953333; ln⁡(1.1)\ln(1.1) is approximately 0.09531020.0953102. A small difference is useful, but a numerical comparison is not yet a proof of a general error guarantee.

From Taylor polynomial to Taylor series

If derivatives of every order exist at the centre, they define the formal Taylor series

∑k=0∞f(k)(a)k!(x−a)k.\sum_{k=0}^{\infty}\frac{f^{(k)}(a)}{k!}(x-a)^k.

Define the remainder of the finite polynomial by RN(x)=f(x)−PN(x)R_N(x)=f(x)-P_N(x). The series equals f(x)f(x) at a given input precisely when RN(x)→0R_N(x)\to0 there as N→∞N\to\infty. Convergence of the coefficient series alone does not establish equality with the original function.

For f(x)=exf(x)=e^x at zero, every derivative value is 11. This produces

ex=∑k=0∞xkk!,x∈R.e^x=\sum_{k=0}^{\infty}\frac{x^k}{k!},\qquad x\in\mathbb{R}.

The ratio test gives infinite radius. To justify equality with exe^x, Taylor's remainder bound can also be used: for each fixed xx, e|x||x|N+1/(N+1)!e^{\lvert x\rvert}\lvert x\rvert^{N+1}/(N+1)! tends to zero. The factorial eventually dominates this fixed power. The Taylor-series reference explains the distinction between construction, convergence and representation.

Three core Maclaurin series

The derivative cycle for sine is sin⁡x,cos⁡x,−sin⁡x,−cos⁡x\sin x,\cos x,-\sin x,-\cos x, then it repeats. Evaluating at zero gives 0,1,0,−1,…0,1,0,-1,\ldots. The resulting series is

sin⁡x=∑k=0∞(−1)kx2k+1(2k+1)!.\sin x=\sum_{k=0}^{\infty}\frac{(-1)^k x^{2k+1}}{(2k+1)!}.

Cosine has derivative values 1,0,−1,0,…1,0,-1,0,\ldots at zero, so

cos⁡x=∑k=0∞(−1)kx2k(2k)!.\cos x=\sum_{k=0}^{\infty}\frac{(-1)^k x^{2k}}{(2k)!}.

Both series equal their functions for every real input. The arguments are in radians; the familiar derivative cycle has extra conversion factors for degree-valued arguments.

First terms and their source
FunctionFirst non-zero termsReal interval of representation
exe^x1+x+x2/2!+x3/3!+⋯1+x+x^2/2!+x^3/3!+\cdotsAll real xx
sin⁡x\sin xx−x3/3!+x5/5!−⋯x-x^3/3!+x^5/5!-\cdotsAll real xx
cos⁡x\cos x1−x2/2!+x4/4!−⋯1-x^2/2!+x^4/4!-\cdotsAll real xx

Using only the displayed terms gives a polynomial approximation. Writing an equality with the function requires the infinite series or an explicit remainder term.

Polynomial approximation

Approximate an exponential

At x=0.2x=0.2, the third-order Maclaurin polynomial for exe^x gives

P3(0.2)=1+0.2+0.222+0.236=916750≈1.2213333333.P_3(0.2)=1+0.2+\frac{0.2^2}{2}+\frac{0.2^3}{6}=\frac{916}{750}\approx1.2213333333.

A reference evaluation gives e0.2≈1.2214027582e^{0.2}\approx1.2214027582, so the actual absolute difference is about 0.00006942480.0000694248. Because all omitted terms are positive, the polynomial underestimates this value.

Approximate sine

For x=0.5x=0.5 radians, use P5(x)=x−x3/6+x5/120P_5(x)=x-x^3/6+x^5/120:

P5(0.5)=18413840≈0.4794270833.P_5(0.5)=\frac{1841}{3840}\approx0.4794270833.

The function value is sin⁡(0.5)≈0.4794255386\sin(0.5)\approx0.4794255386. The approximation is slightly high, by about 0.00000154470.0000015447. The next omitted sine term is negative, consistent with this direction.

Compare orders at several inputs

The table below evaluates the first-, third- and fifth-order Maclaurin polynomials for sine. Each input is in radians. Values are rounded to six decimal places; the formulas, rather than the rounded entries, determine the calculations.

Sine approximations at increasing distance from zero
InputP1(x)=xP_1(x)=xP3(x)=x−x3/6P_3(x)=x-x^3/6P5(x)=x−x3/6+x5/120P_5(x)=x-x^3/6+x^5/120sin⁡x\sin x
0.50.50.5000000.5000000.4791670.4791670.4794270.4794270.4794260.479426
111.0000001.0000000.8333330.8333330.8416670.8416670.8414710.841471
222.0000002.0000000.6666670.6666670.9333330.9333330.9092970.909297

The higher order helps for these examples, but the error of a fixed polynomial also grows as the evaluation moves away from the centre here. This table does not establish a universal rule of pointwise improvement. A remainder bound is the appropriate way to make a specific accuracy claim.

Numerical comparison of the approximation examples
QuantityPolynomial valueReference function valueAbsolute difference, approximately
e0.2e^{0.2} using P3P_31.22133333331.22133333331.22140275821.22140275820.00006942480.0000694248
sin⁡(0.5)\sin(0.5) using P5P_50.47942708330.47942708330.47942553860.47942553860.00000154470.0000015447

The remainder measures what the polynomial misses

Suppose ff has a continuous derivative of order N+1N+1 on an interval containing the centre aa and evaluation point xx. Taylor's theorem gives a point ξ\xi between them such that

RN(x)=f(N+1)(ξ)(N+1)!(x−a)N+1.R_N(x)=\frac{f^{(N+1)}(\xi)}{(N+1)!}(x-a)^{N+1}.

If the derivative magnitude is at most MM throughout that interval, then

|RN(x)|≤M|x−a|N+1(N+1)!.\lvert R_N(x)\rvert\le\frac{M\lvert x-a\rvert^{N+1}}{(N+1)!}.

This is the Lagrange remainder bound. It requires a bound over the whole segment, not just the derivative's value at the centre.

Bound the exponential error without subtracting the true value

For exe^x on [0,0.2][0,0.2], the fourth derivative is ex≤e0.2e^x\le e^{0.2}. Hence the third-order error is at most e0.2(0.2)4/24e^{0.2}(0.2)^4/24, approximately 0.000081430.00008143. That valid bound is larger than the observed error. It does not by itself prove an error below 0.000070.00007.

A sharper bound is available from the positive series tail. The first omitted term is (0.2)4/4!=1/15000(0.2)^4/4!=1/15000. Every subsequent ratio is at most 0.2/5=1/250.2/5=1/25. Bounding the tail by a geometric series gives

0<R3(0.2)≤1/150001−1/25=114400<0.00007.0<R_3(0.2)\le\frac{1/15000}{1-1/25}=\frac{1}{14400}<0.00007.

This proves the tighter accuracy claim without knowing the true function value first.

Use an alternating remainder for sine

At x=0.5x=0.5, the omitted sine terms alternate with decreasing magnitudes. The first omitted term bounds the error:

|sin⁡(0.5)−P5(0.5)|≤(0.5)77!=1645120<0.000002.\lvert\sin(0.5)-P_5(0.5)\rvert\le\frac{(0.5)^7}{7!}=\frac{1}{645120}<0.000002.

Thus the stated two-millionths tolerance follows from a theorem, not just a comparison with a calculator. The Taylor-series applications chapter develops this use of remainder estimates.

Series can evaluate otherwise difficult expressions

Substitute −x2-x^2 into the exponential series:

e−x2=1−x2+x42!−x63!+⋯.e^{-x^2}=1-x^2+\frac{x^4}{2!}-\frac{x^6}{3!}+\cdots.

Its radius is infinite. Term-by-term integration is justified on the finite interval [0,1/2][0,1/2], yielding a series of elementary polynomial integrals. The first three terms give

∫01/2(1−x2+x42)dx=12−124+1320=443960.\int_0^{1/2}\left(1-x^2+\frac{x^4}{2}\right)\,\mathrm{d}x=\frac12-\frac1{24}+\frac1{320}=\frac{443}{960}.

This is approximately 0.46145833330.4614583333, while the full integral is approximately 0.46128100640.4612810064. To control the error, integrate the magnitude of the next omitted term:

∫01/2x66dx=15376≈0.000186012.\int_0^{1/2}\frac{x^6}{6}\,\mathrm{d}x=\frac{1}{5376}\approx0.000186012.

On this interval, the pointwise exponential terms alternate with decreasing magnitudes, and the omitted first term is negative. Therefore

443960−15376≤∫01/2e−x2dx≤443960.\frac{443}{960}-\frac{1}{5376}\le\int_0^{1/2}e^{-x^2}\,\mathrm{d}x\le\frac{443}{960}.

This connects representation, approximation and error control. The integral exists even though the integrand has no elementary antiderivative. A convergent series provides another way to calculate it.

Derivative data alone does not guarantee equality everywhere

A function can have derivatives of every order and still fail to equal its Taylor series away from the centre. A standard example is f(x)=e−1/x2f(x)=e^{-1/x^2} for x≠0x\ne0, with f(0)=0f(0)=0.

Every derivative at zero is zero. Differentiating away from zero produces a polynomial in 1/x1/x multiplied by e−1/x2e^{-1/x^2}; the exponential tends to zero faster than every such power grows. This allows the derivatives to extend to zero with value zero at every order.

Its Maclaurin series is consequently the zero series, which converges everywhere. But f(x)>0f(x)>0 for every x≠0x\ne0, so that series does not represent the function away from zero. The example separates two claims: convergence of a Taylor series and equality of that sum with the function that supplied its coefficients.

For exe^x, sine and cosine, the remainder argument does establish equality for every real xx. For another function, state and justify the region where the remainder tends to zero rather than assuming that smoothness is enough.

Related topics

Return to Power Series for convergence intervals and legal term-by-term operations. Use Techniques of Integration to compare a series-based approximation with a numerical quadrature rule, and Convergence Tests for Series to justify an omitted-tail bound.

Practice questions

  1. Write the first four non-zero terms of the Maclaurin series for exe^x.

  2. Approximate e0.2e^{0.2} using its third-order Maclaurin polynomial and give a justified error bound.

  3. What additional condition makes a function equal to its Taylor series at a given input?

Check your answers
  1. They are 1+x+x2/2!+x3/3!1+x+x^2/2!+x^3/3!. Every derivative of exe^x has value 11 at zero, which supplies these coefficients.

  2. The polynomial gives 916/750≈1.2213333333916/750\approx1.2213333333. Its positive omitted tail is at most (1/15000)/(1−1/25)=1/14400<0.00007(1/15000)/(1-1/25)=1/14400<0.00007. The polynomial is therefore an underestimate within that tolerance.

  3. The remainder RN(x)=f(x)−PN(x)R_N(x)=f(x)-P_N(x) must tend to zero as N→∞N\to\infty. Having derivatives of every order, or even having a convergent Taylor series, does not alone establish equality with the original function.

Sources and further reading