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
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
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.
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).
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".