Taylor Series Approximation Calculator

Approximate sin(x), cos(x), e^x, and ln(1+x) using a Taylor series with 1 to 10 terms.
Shows the approximation vs true value with percent error and a chart.

Taylor Approximation

A Taylor series represents a smooth function as an infinite sum of polynomial terms, each involving a derivative of the function at a chosen center point. The Maclaurin series is the special case centered at x = 0.

Why Taylor series matter. Computers cannot evaluate sin(x) or e^x directly. They use polynomial approximations internally. The Taylor series is the mathematical foundation for those approximations. Engineers use truncated series to simplify equations. Physicists use them constantly for small-angle approximations (sin x ~ x for small x).

The four series computed here (all centered at x = 0):

sin(x) = x - x^3/3! + x^5/5! - x^7/7! + …

cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + …

e^x = 1 + x + x^2/2! + x^3/3! + …

ln(1+x) = x - x^2/2 + x^3/3 - x^4/4 + … (valid for -1 < x <= 1)

Number of terms and accuracy. Adding more terms always improves accuracy near x = 0. Far from the centre you need more terms, and the requirement grows fast. For sin(x) at x = 1 radian, 4 terms lands within 2.7 x 10^-6 of the true value, so five decimal places are right. At x = 10 you would need more than 20 terms, which is past what this calculator offers: it caps at 10, and the panel says so rather than presenting a wrong number quietly.

That cap is worth understanding rather than working around. Terms of the form x^k/k! grow before they shrink, peaking around k = |x|. At x = 10 the ninth term is roughly 2,755, so truncating at ten terms leaves an enormous remainder. Taylor series are a local tool, and the honest fix for a distant x is to re-centre the series near it, not to add terms.

Reading the error. Percent error is |approximate - true| / |true| x 100. That figure stops meaning anything when the true value is near zero, which is why cos(x) at x = pi/2 shows the absolute error instead: dividing by a value that is 6 x 10^-17 in floating-point arithmetic inflates any error without limit.

For alternating series (all of these except e^x), the truncation error is bounded by the first term you left out, provided the terms are already decreasing. The result panel prints that omitted term next to the actual error so you can see the bound holding.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.