Taylor & Maclaurin Polynomial Calculator

Taylor or Maclaurin polynomial of eˣ, sin x, cos x, ln(1 + x) or 1/(1 − x) at any centre and order, with the approximation and the true error.

a = 0 gives the Maclaurin polynomial. sin and cos use radians. ln(1 + x) needs a > −1; 1/(1 − x) needs a ≠ 1.
A whole number from 0 to 30.

Results

Maclaurin polynomial P₄(x) of eˣ
1 + x + x²/2 + x³/6 + x⁴/24
Approximation Pₙ(0.5)
1.6484
True value e^0.5
1.6487
True error f(x) − Pₙ(x)
0.000283771
Relative error
0.0172116 %
Lagrange error bound M|x − a|ⁿ⁺¹/(n + 1)!
0.000429354
M = e^0.5, the largest value of eᵗ between a and x.
Convergence
The Taylor series of eˣ converges to it for every x, so a high enough order gets as close as you like. Far from the centre the error can grow for a while before it starts to shrink.

How it’s calculated

The Taylor polynomial of order n matches f and its first n derivatives at the centre a. With a = 0 it is called a Maclaurin polynomial. Close to a it approximates f well, and the remainder Rₙ(x) = f(x) − Pₙ(x) measures the error.

Pₙ(x) = f(a) + f′(a)(x − a) + f″(a)/2! (x − a)² + … + f⁽ⁿ⁾(a)/n! (x − a)ⁿ |Rₙ(x)| ≤ M |x − a|ⁿ⁺¹ / (n + 1)! (M = largest |f⁽ⁿ⁺¹⁾| between a and x)
f(x)Maclaurin seriesConverges for
eˣ1 + x + x²/2! + x³/3! + …all x
sin xx − x³/3! + x⁵/5! − …all x
cos x1 − x²/2! + x⁴/4! − …all x
ln(1 + x)x − x²/2 + x³/3 − …−1 < x ≤ 1
1/(1 − x)1 + x + x² + x³ + …−1 < x < 1

About another centre a, ln(1 + x) converges for |x − a| < 1 + a and 1/(1 − x) for |x − a| < |1 − a|: the distance to the point where the function blows up. Outside that interval the calculator warns you, because more terms then make things worse.

Example: eˣ about a = 0 with n = 4 at x = 0.5. P₄(0.5) = 1 + 0.5 + 0.125 + 0.0208333 + 0.0026042 = 1.6484375. The true value e^0.5 = 1.6487213, so the error is about 0.000284, within the Lagrange bound e^0.5 × 0.5⁵/5! ≈ 0.000429.

Frequently asked questions

What is the difference between a Taylor and a Maclaurin series?

A Maclaurin series is simply a Taylor series centred at a = 0. Other centres give powers of (x − a) instead of x.

Why does the approximation get worse for ln(1 + x) at x = 2?

Its Maclaurin series only converges for −1 < x ≤ 1. At x = 2 the terms grow instead of shrinking, so each extra term moves the answer further away. Choose a centre closer to x, such as a = 1.5.

Should sin and cos use degrees or radians?

Radians. The series x − x³/6 + … only works with x in radians; 30° is π/6 ≈ 0.5236.

What is the Lagrange error bound?

A guaranteed ceiling on the error: M|x − a|ⁿ⁺¹/(n + 1)!, where M bounds the next derivative between a and x. The true error is always at or below it.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator