TSE.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Mathematics · Calculus · Sequences & Series

Taylor Series Calculator

Computes the Taylor series approximation of common functions about a given center point up to a specified number of terms.

Calculator

Advertisement

Formula

f(x) is the function being approximated; a is the center point (expansion point); x is the evaluation point; n is the term index running from 0 to N; f^(n)(a) is the n-th derivative of f evaluated at a; n! is the factorial of n; N is the number of terms minus one (degree of the polynomial). When a = 0 the series is called a Maclaurin series.

Source: Abramowitz, M. & Stegun, I. A., Handbook of Mathematical Functions, NBS Applied Mathematics Series 55 (1964), §3.6.

How it works

What is a Taylor series? A Taylor series represents a smooth function f(x) as an infinite sum of terms built from the function's derivatives evaluated at a single point a. Each successive term adds a higher-degree polynomial correction, and truncating the series at degree N yields a Taylor polynomial that approximates f(x) near a with a controlled error. The special case a = 0 is called a Maclaurin series and is what this calculator uses for all supported functions.

The formula. The N-term Taylor polynomial centred at a = 0 is: f(x) ≈ Σ [f⁽ⁿ⁾(0) / n!] xⁿ, where the sum runs from n = 0 to N − 1. For sin(x) only odd powers survive (coefficients follow the pattern +1, −1, ... divided by (2n+1)!); for cos(x) only even powers appear; for eˣ every power is present with coefficient 1/n!; for ln(1 + x) the series is Σ (−1)ⁿ⁺¹ xⁿ/n; and for arctan(x) the series is Σ (−1)ⁿ x^(2n+1)/(2n+1). Hyperbolic functions sinh and cosh follow the same pattern as sin and cos but without the alternating sign.

Practical applications. Taylor series underpin a vast range of applied calculations. Calculators and CPUs approximate trig and exponential functions using degree-8 to degree-18 Chebyshev-minimax variants of these polynomials. In physics, the small-angle approximation sin(θ) ≈ θ is the first non-trivial term of the sine series. In finance, the Black–Scholes delta and gamma are Taylor coefficients of the option price surface. Finite-difference stencils used in CFD solvers are derived directly by rearranging Taylor expansions. Understanding how many terms are needed for a given precision is fundamental to numerical analysis.

Worked example

Example: Approximate sin(0.5) using 4 terms and verify the error.

The Maclaurin series for sin(x) is: sin(x) = x − x³/3! + x⁵/5! − x⁷/7! + ···

Term 1 (n = 0): x = 0.5

Term 2 (n = 1): −x³/6 = −(0.125)/6 = −0.020833…

Term 3 (n = 2): +x⁵/120 = +(0.03125)/120 = +0.000260…

Term 4 (n = 3): −x⁷/5040 = −(0.0078125)/5040 = −0.0000015…

Sum ≈ 0.479426

The exact value is sin(0.5) = 0.47942553…, so the absolute error with just 4 terms is approximately 2.0 × 10⁻⁸ — already accurate to 7 decimal places, illustrating the rapid convergence for small |x|.

Limitations & notes

Radius of convergence. Not all Taylor series converge for every x. The series for ln(1 + x) converges only for −1 < x ≤ 1, and arctan(x) converges only for |x| ≤ 1. Entering values outside the radius of convergence will produce increasingly inaccurate results as N grows, not better ones. Large x and slow convergence. Even within the radius, large |x| values require many more terms to achieve acceptable accuracy; computing eˣ at x = 10 with only 6 terms gives a poor approximation. Truncation vs. rounding error. In practice, floating-point arithmetic introduces rounding errors that grow when many nearly-equal terms are summed (catastrophic cancellation), which can limit achievable precision independently of series convergence. Fixed expansion point. This calculator always expands about a = 0 (Maclaurin series). For functions evaluated far from the origin, expanding about a closer centre point would converge faster, but this is not currently supported.

Frequently asked questions

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

A Maclaurin series is simply a Taylor series centred at a = 0. Any Taylor series expanded about a different point a ≠ 0 uses powers of (x − a) instead of xⁿ. This calculator uses Maclaurin expansions for all supported functions, which is the most common form encountered in introductory calculus.

How many terms do I need for accurate results?

The required number of terms depends on both the function and how far x is from the expansion centre. For |x| < 0.5, the sin, cos, and eˣ series typically achieve double-precision accuracy (about 15 significant figures) with 8–10 terms. For |x| close to 1, more terms may be needed, especially for ln(1 + x) and arctan(x).

Why does the absolute error sometimes increase when I add more terms?

This happens when x is outside or near the boundary of the series' radius of convergence, or when floating-point rounding errors accumulate faster than the series converges. For ln(1 + x) and arctan(x), keep |x| ≤ 1 to ensure convergence. For eˣ with large |x|, consider using the identity e^x = (e^(x/k))^k and computing the smaller expansion first.

What is the remainder (error) term in a Taylor series?

The Lagrange remainder R_N(x) = f^(N+1)(c)/(N+1)! · (x−a)^(N+1) for some c between a and x provides an upper bound on the truncation error. It guarantees that the true error is no larger than the maximum value of |f^(N+1)| on the interval multiplied by |x−a|^(N+1)/(N+1)!. This is the theoretical basis for the error values shown by this calculator.

Can I use this calculator for functions not listed, like tan(x) or 1/x?

Currently the calculator supports sin, cos, eˣ, ln(1+x), arctan, sinh, and cosh, which cover the most commonly needed expansions. Functions like tan(x) have more complex coefficient patterns and a limited radius of convergence (|x| < π/2), while 1/x is not analytic at 0 and requires expansion about a ≠ 0. These may be added in future updates.

Last updated: 2025-01-15 · Formula verified against primary sources.