Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Taylor Polynomial Error Explorer

See how well a Taylor polynomial approximates a function and how large the error can be. Change the center a, the degree n, and the evaluation point x0, then compare the actual error to the Lagrange remainder bound.

Controls

f(x) = e^x P_n(x), n = 3
x0 = 1.50
|f(x) - P_n(x)| Lagrange bound at x0
max error shown ≈ 7.09e+0

Taylor polynomial for e^x

Current polynomial (a = 0.00, n = 3)

Lagrange remainder

The error is controlled by M, the maximum of the (n+1)th derivative magnitude on the interval between a and x. Here M is taken on [0.00, 1.50].

Error at x0 = 1.50

f(x0)
4.481689
P_n(x0)
4.187500
Actual error |f - P_n|
0.294189
Lagrange bound
0.945356
M used (max |f^(n+1)|)
4.4817
Bound check
actual error ≤ bound

Reference Guide

The Taylor Polynomial

A Taylor polynomial of degree n approximates a function near a center a by matching the value and the first n derivatives at that point. When a is 0 it is called a Maclaurin polynomial.

Pn(x)=k=0nf(k)(a)k!(xa)kP_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}\,(x-a)^k

Higher degree adds more terms, which usually improves the fit close to a. The fit is best near the center and degrades as x moves away.

The Lagrange Remainder Bound

The exact error is the remainder. Lagrange's form gives a value ξ between a and x where the error equals the next derivative divided by a factorial, times a power of (x - a).

Rn(x)=f(n+1)(ξ)(n+1)!(xa)n+1R_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}\,(x-a)^{n+1}

Replacing the derivative with its maximum magnitude M on the interval gives an upper bound. The error shrinks like |x - a| raised to the (n+1) power over (n+1) factorial, so it falls fast as the degree grows and as x approaches a.

Center and Radius of Convergence

Centering the expansion near the point you care about keeps |x - a| small, which keeps the error small. The cos preset centered at a near pi/2 shows this effect.

Some series only converge inside a radius. For 1/(1-x) the radius is 1, so the polynomial diverges for |x| at or above 1 no matter how high the degree. The error panel shows this wall clearly as x approaches the singularity.

How to Read the Panels

The top panel draws f(x) and the polynomial P_n(x). The dots mark their values at x0, and the gap between them is the approximation error.

The bottom panel plots the pointwise error across the domain with a dashed line at the Lagrange bound for x0. The bound always sits at or above the true error, which is why the numeric check reads "actual error ≤ bound".

Related Content