A Taylor series is a way of expressing a smooth function as an infinite sum of polynomial terms, each involving a power of (x minus a) where a is the centre point. Truncating the series after a finite number of terms gives a polynomial approximation that can be as accurate as you need, at least near the centre. When the centre is zero the series is called a Maclaurin series. These series are fundamental in calculus, numerical analysis, physics and engineering: they underpin how computers calculate sine, cosine and exponential functions, how engineers approximate complex solutions, and how physicists derive perturbation expansions. The four classic Maclaurin series are for sin(x), cos(x), exp(x) and ln(1+x). This calculator lets you pick one of these functions, choose how many terms to include (up to 10), and enter an x value at which to evaluate the approximation. It returns the polynomial approximation, the exact function value, and the approximation error. It also shows a plain-text representation of the series terms so you can see how the expansion is built up. For sin(0.5 radians), five terms give 0.4794, matching the exact value to four decimal places. The more terms you include, the better the approximation, though for ln(1+x) convergence is only guaranteed for -1 less than x less than or equal to 1.
0.4794
Taylor series approximation
Exact value0.4794
Approximation error0
Terms used5
x - x^3/6 + x^5/120 - x^7/5040 + x^9/362880
x is in radians for sin and cos. For ln(1+x) convergence requires -1 < x ≤ 1.
How it works
The calculator uses the known closed-form Maclaurin series for each function: sin(x) = x - x³/3! + x5/5! - x7/7! + ... cos(x) = 1 - x²/2! + x4/4! - x6/6! + ... exp(x) = 1 + x + x²/2! + x³/3! + x4/4! + ... ln(1+x) = x - x²/2 + x³/3 - x4/4 + ...
Terms are summed in order. The approximation error is the absolute difference between the series result and the exact value from JavaScript's Math functions.
Worked example
Function: sin(x), 5 terms, x = 0.5 radians. The five terms are: 0.5 - 0.02083 + 0.00026 - 0.0000002 + ... summing to 0.4794. The exact value sin(0.5) = 0.4794 to four decimal places. The approximation error is 0.0000, confirming that five terms are more than enough for this x value.