Taylor Series Expander

Compute the Taylor (or Maclaurin) polynomial of any order for a given function f(x) around any expansion point a. Visualize the approximation, inspect coefficients, and understand convergence — an essential tool for calculus, numerical analysis, and physics.

Supports: sin, cos, tan, exp, log (natural), sqrt, pow, constants pi, e.
? sin(x) at 0
? e^x at 0
? cos(x) at π/2
? ln(1+x) at 0
? tanh(x) at 0
⚡ 1/(1-x) at 0
? sqrt(1+x) at 0
Privacy-first compute: All derivatives and expansions are computed locally in your browser via math.js. No data is uploaded.

What is a Taylor Series?

A Taylor series represents a function as an infinite sum of terms calculated from its derivatives at a single point. For a smooth function f(x), the Taylor expansion around x = a is:

f(x) = Σk=0 f(k)(a) / k! · (x - a)k

The Taylor polynomial of degree N truncates the series after the Nth term, providing a local polynomial approximation. This is the foundation of numerical methods, optimization, and physical modeling. The polynomial becomes increasingly accurate near x = a as N grows (within the radius of convergence).

General Methodology & Computation

Our calculator uses symbolic differentiation via math.js to compute exact derivatives f(k)(x) up to the specified order. It then evaluates each derivative at the expansion point a and divides by k! to obtain coefficient ck. The final polynomial is reconstructed as Σ ck (x-a)k. This approach delivers exact rational coefficients where possible (e.g., for sin, exp). For interactive exploration, the graph renders both the original function and the Taylor polynomial over an adaptive interval around a, allowing you to see the quality of approximation and the effect of increasing N.

The error (remainder) is governed by the Lagrange or Cauchy form, and the radius of convergence depends on the function’s analytic structure. For common functions like e^x, sin(x), cos(x) the series converges ∀x; for others like ln(1+x) the convergence radius is limited to |x-a| < 1 (if a=0).

Key Applications in Science & Engineering

  • Physics: Approximating pendulums (sin θ ≈ θ), deriving relativistic corrections.
  • Machine Learning: Gradients, Hessians, and local approximations for optimization (Newton's method).
  • Numerical Analysis: Finite difference schemes, numerical integration, and error analysis.
  • Signal Processing: Approximating nonlinear filters and linearization around operating points.
  • Economics: Local elasticities and marginal approximations.
Case Study: Relativistic Kinetic Energy

The relativistic kinetic energy formula K = mc²(γ - 1) with γ = 1/√(1-v²/c²). Expanding K as a Taylor series in β = v/c around 0 yields K ≈ ½ mv² + ⅜ mv⁴/c² + ... The first term recovers classical kinetic energy, while higher terms provide relativistic corrections. This series is vital for particle accelerators and GPS satellite timing adjustments. Our tool can model f(x) = (1/sqrt(1-x²)-1) and observe the classical limit.

Step-by-Step Usage

  1. Enter a valid function of x (e.g., sin(x), exp(x), tanh(x)).
  2. Set the expansion point a (real number).
  3. Choose polynomial degree N (0 to 12). Higher N gives better accuracy near a but may show divergence outside ROC.
  4. Click Expand & Visualize — the polynomial expression, coefficients, and interactive graph appear instantly.
  5. Use preset examples to explore classic Maclaurin series.

Maclaurin Series: Special Case (a = 0)

When a = 0, the Taylor series is called a Maclaurin series. Many fundamental series are Maclaurin expansions: ex = Σ xk/k!, sin(x) = Σ (-1)k x2k+1/(2k+1)!, cos(x) = Σ (-1)k x2k/(2k)! and ln(1+x) = Σ (-1)k+1 xk/k for |x|<1.

Our calculator automatically renders these symbolic forms, making it perfect for checking textbook expansions and exploring manipulations.

Convergence & Limitations

While Taylor polynomials provide excellent local approximations, they may diverge far from the center or for functions with singularities. Moreover, for non-analytic functions (e.g., f(x)=e-1/x² for x≠0), the Taylor series at 0 yields zero but fails to represent the function. The graph will visually reveal poor approximation outside the radius of convergence – a powerful learning experience.

Function Expansion point a Radius of convergence Typical behavior
e^x 0 Converges everywhere
sin(x), cos(x) 0 Converges everywhere
ln(1+x) 0 1 Converges only for |x|<1
1/(1-x) 0 1 Geometric series converges strictly inside unit disk
sqrt(1+x) 0 1 Converges for |x|≤1 (binomial)

Frequently Asked Questions (FAQ)

We use math.js (symbolic engine) to compute exact derivatives analytically, ensuring high accuracy for rational, trig, exponential, and logarithmic functions.

Taylor polynomials approximate well only near the expansion point. Outside the radius of convergence (or for functions with poles), polynomial terms may cause divergence, illustrating the limits of series approximation.

Our tool currently supports elementary analytic expressions. Piecewise definitions are not supported, as derivatives may not be defined everywhere.

Symbolic differentiation avoids numeric rounding error; coefficients are computed with double precision. The polynomial is expressed with up to 6 decimals for readability, but internal precision is high.

If the function is not differentiable at the point (e.g., f(x)=1/x at a=0), the Taylor expansion fails. Our tool will display a warning and stop calculation.

Absolutely. It's built for educational verification, visual understanding, and checking manual expansions. Trusted by students worldwide.

Built on rigorous calculus foundations – This tool follows the mathematical principles established by Brook Taylor (1715) and later refined by Lagrange, Cauchy, and modern analysis. Our implementation uses symbolic differentiation and polynomial reconstruction verified against known series expansions. References: “Advanced Engineering Mathematics” by Erwin Kreyszig, “Calculus: Early Transcendentals” by Stewart, and Wolfram MathWorld. Reviewed by the GetZenQuery tech team — May 2026.