DigitHelm

Taylor Series Calculator | DigitHelm

Compute Taylor/Maclaurin series expansions for common functions.

Common Expansions

What Is the Taylor Series Calculator | DigitHelm?

The Taylor Series Calculator computes the Taylor polynomial P_n(x) of any function f(x) centred at a point a, up to order n (maximum 10). For each term, it numerically computes the nth derivative f⁽ⁿ⁾(a) using high-order central difference formulas, then builds the coefficient cₙ = f⁽ⁿ⁾(a)/n!. Enter a test x to compare P_n(x) against the true f(x) and see the approximation error. A graph overlays the polynomial and the original function.

  • Coefficients: cₙ = f⁽ⁿ⁾(a)/n! computed via high-order numerical differentiation
  • Maclaurin series is the special case a = 0
  • Error |f(x) − P_n(x)| decreases as n increases (within the radius of convergence)
  • Term table shows n, f⁽ⁿ⁾(a), n!, cₙ, and the symbolic term expression
  • Graph shows original f(x) (solid) vs polynomial approximation (dashed)

Formula

Taylor Series Formula

Taylor Series

f(x) = Σ f⁽ⁿ⁾(a)/n! · (x−a)ⁿ

Maclaurin

a = 0: f(x) = Σ f⁽ⁿ⁾(0)/n! · xⁿ

1 + x + x²/2! + x³/3! + … (all ℝ)

sin(x)

x − x³/3! + x⁵/5! − … (all ℝ)

cos(x)

1 − x²/2! + x⁴/4! − … (all ℝ)

Remainder Rₙ

|Rₙ| ≤ M|x−a|ⁿ⁺¹/(n+1)! (Taylor)

How to Use

  1. 1Enter f(x) using standard function notation (exp(x), sin(x), ln(x), x^3, etc.)
  2. 2Set the expansion centre a (use a=0 for Maclaurin series)
  3. 3Set the polynomial order (1–10); higher orders give better approximations
  4. 4Enter a test x value to evaluate and compare f(x) vs P_n(x)
  5. 5Click Expand Series to see coefficients, the polynomial, and the error
  6. 6Use presets (eˣ, sin(x), cos(x), ln(1+x), 1/(1−x)) for instant examples

Example Calculation

Maclaurin series for eˣ up to order 4, evaluate at x=1:

f⁽⁰⁾(0)=1, f⁽¹⁾(0)=1, f⁽²⁾(0)=1, f⁽³⁾(0)=1, f⁽⁴⁾(0)=1
P₄(x) = 1 + x + x²/2 + x³/6 + x⁴/24
P₄(1) = 1+1+0.5+0.1667+0.04167 = 2.7083
e¹ = 2.71828...
Error = |2.71828 − 2.7083| = 0.00998

Taylor series for sin(x) at a=0, order 5:

P₅(x) = x − x³/6 + x⁵/120
At x=π/4 ≈ 0.7854:
P₅ = 0.7854 − 0.0807 + 0.00024 = 0.7071
sin(π/4) = 0.70711... Error < 10⁻⁵

Radius of Convergence

Every Taylor series has a radius of convergence R: the series equals f(x) for |x−a| < R and diverges for |x−a| > R. For eˣ, sin(x), cos(x): R = ∞ (converges everywhere). For ln(1+x) at a=0: R = 1 (converges for −1 < x ≤ 1). For 1/(1−x) at a=0: R = 1 (geometric series). Using the polynomial outside its radius of convergence gives wildly incorrect results, the calculator shows the actual error so you can see this directly.

Understanding Taylor Series | DigitHelm

Key Taylor and Maclaurin Series

FunctionSeries (a=0)First 3 TermsRadius R
Σ xⁿ/n!1 + x + x²/2
sin(x)Σ (−1)ⁿx²ⁿ⁺¹/(2n+1)!x − x³/6 + x⁵/120
cos(x)Σ (−1)ⁿx²ⁿ/(2n)!1 − x²/2 + x⁴/24
ln(1+x)Σ (−1)ⁿ⁺¹xⁿ/nx − x²/2 + x³/31
1/(1−x)Σ xⁿ1 + x + x²1
arctan(x)Σ (−1)ⁿx²ⁿ⁺¹/(2n+1)x − x³/3 + x⁵/51
(1+x)ᵅΣ C(α,n)xⁿ1 + αx + α(α−1)x²/21
sinh(x)Σ x²ⁿ⁺¹/(2n+1)!x + x³/6 + x⁵/120

Frequently Asked Questions

What is a Taylor series?

Discovered by Brook Taylor (1715) and used by Newton, Leibniz, and Euler. The Maclaurin series (a=0) is named after Colin Maclaurin who popularized it.

  • f(x) = f(a) + f'(a)(x−a) + f''(a)(x−a)²/2! + ...
  • Each term adds a higher-degree correction to the approximation
  • First two terms = tangent line approximation
  • The series converges to f(x) within the radius of convergence

What is the Maclaurin series?

  • eˣ: all terms positive, converges for all x (R = ∞)
  • sin(x): only odd powers, alternating signs (R = ∞)
  • cos(x): only even powers, alternating signs (R = ∞)
  • 1/(1−x) = 1+x+x²+... (geometric; converges only |x| < 1)
  • ln(1+x): converges only for −1 < x ≤ 1

How is the approximation error calculated?

  • Error shrinks as n increases (more terms = better approximation)
  • Error grows as |x−a| increases (further from centre = worse)
  • For eˣ at x=1 with n=4: error ≈ 0.010 (3 decimal places correct)
  • With n=7: error ≈ 3×10⁻⁵ (5 decimal places correct)

What is the radius of convergence?

  • R = ∞: eˣ, sin(x), cos(x), entire real line
  • R = 1: ln(1+x), 1/(1−x), arctan(x)
  • At the boundary x = a ± R: may converge or diverge (test individually)
  • Computed by ratio test: R = lim |cₙ/cₙ₊₁| as n → ∞

What are Taylor series used for?

  • Computer arithmetic: sin/cos/exp computed via polynomial approximations
  • Physics: (1−v²/c²)^(−1/2) ≈ 1+v²/2c² for v &lt;&lt; c (relativistic kinetic energy)
  • Small-angle approximation: sin(θ) ≈ θ for the pendulum period formula
  • Numerical analysis: finite-difference formulas derived from Taylor expansion

How is the nth derivative computed numerically?

  • f'(a) ≈ [f(a+h)−f(a−h)]/(2h), second-order accurate
  • f''(a) ≈ [f(a+h)−2f(a)+f(a−h)]/h², second-order accurate
  • f'''(a) uses 5-point stencil for better accuracy
  • Step size h balances truncation error (large h) vs rounding error (small h)

Is this Taylor series calculator free?

Yes, completely free with no registration required. All calculations run locally in your browser.

Related Calculators