Taylor Series Calculator

Expand a function into a Taylor or Maclaurin polynomial and see how the approximation compares to the original.

Taylor Series Calculator

What Is a Taylor Series?

A Taylor series represents a function as an infinite sum of terms built from its derivatives at a single point, called the center. The idea is powerful: instead of working with a complicated function like sin(x) or eˣ directly, you can approximate it arbitrarily well using nothing but polynomials — additions, multiplications, and powers — which are far easier to compute, differentiate, and integrate.

The Taylor series of f(x) centered at x = a is: f(x) = f(a) + f'(a)(x−a) + f''(a)(x−a)²/2! + f'''(a)(x−a)³/3! + ⋯, continuing with higher derivatives divided by increasing factorials. When the center is a = 0, this is specifically called a Maclaurin series — a special case of the same idea. Truncating the sum after a finite number of terms gives a Taylor polynomial, a practical, computable approximation of f(x) that gets more accurate as you include more terms (at least within the series' radius of convergence).

How to Use This Calculator

Enter your function, the center point a (where the derivatives are evaluated), and the order n (how many terms to include, beyond the constant term). The calculator differentiates your function repeatedly — up to n times — evaluates each derivative at x = a, divides by the appropriate factorial, and assembles the resulting polynomial. The graph overlays the original function and the Taylor polynomial so you can see visually how closely the approximation tracks the original near x = a, and how the approximation typically drifts away from the true function farther from the center.

Common Maclaurin Series (Center a = 0)

FunctionSeries
1 + x + x²/2! + x³/3! + x⁴/4! + ⋯
sin(x)x − x³/3! + x⁵/5! − x⁷/7! + ⋯
cos(x)1 − x²/2! + x⁴/4! − x⁶/6! + ⋯
1/(1−x)1 + x + x² + x³ + x⁴ + ⋯ (|x| < 1)
ln(1+x)x − x²/2 + x³/3 − x⁴/4 + ⋯ (|x| < 1)

Worked Example

Expand f(x) = eˣ around a = 0, order 4. Since every derivative of eˣ is eˣ itself, f(k)(0) = e⁰ = 1 for every k. So each coefficient is simply 1/k!:

P₄(x) = 1 + x + x²/2! + x³/3! + x⁴/4! = 1 + x + 0.5x² + 0.1667x³ + 0.0417x⁴

Try entering exp(x) with center 0 and order 4 above — then compare the graph of eˣ against P₄(x) near x = 0 versus farther away, to see the approximation's accuracy shrink as you move from the center.

Common Mistakes to Avoid

  • Forgetting the factorial in the denominator. The nth term is f(n)(a)·(x−a)ⁿ / n!, not just f(n)(a)·(x−a)ⁿ.
  • Evaluating derivatives at the wrong point. All derivatives are evaluated at the center a, not at a general x, before being multiplied by the (x−a)ⁿ term.
  • Assuming the series converges everywhere. Some Taylor series, like that of 1/(1−x) or ln(1+x), only converge within a limited radius around the center — outside that radius, the polynomial approximation can diverge wildly from the true function even with many terms.

Real-World Applications of Taylor Series

Taylor series are how calculators and computers actually compute values of functions like sin, cos, eˣ, and ln — there's no built-in circuitry that "knows" sine directly, so software libraries evaluate a Taylor polynomial (or a closely related, more efficient approximation) with enough terms to guarantee accuracy to the last displayed digit. This is also why these functions are called "transcendental" — they can't be built from a finite number of algebraic operations, but they can be approximated arbitrarily well by polynomials, which computers handle natively and quickly.

In physics, Taylor series are the standard way to simplify a complicated exact expression into a usable approximate one. The small-angle approximation sin(θ) ≈ θ, used constantly in analyzing pendulums and oscillations, is just the first-order Taylor term of sin(θ) around θ = 0 — dropping the higher-order terms because θ is small. Similarly, relativistic kinetic energy reduces to the familiar ½mv² formula from classical mechanics when you Taylor-expand the relativistic expression for velocities much smaller than the speed of light. In engineering, Taylor series underpin numerical methods for solving differential equations (like Euler's method), error analysis for approximation algorithms, and linearization — approximating a nonlinear system's behavior near an operating point with a simple linear (first-order Taylor) model, which is foundational to control theory.

Frequently Asked Questions

What's the difference between a Taylor series and a Maclaurin series?

A Maclaurin series is simply a Taylor series centered at a = 0 — it's a special case, not a different formula. Set the center field to 0 to get a Maclaurin series from this calculator.

How many terms (what order) should I use?

It depends on how accurate an approximation you need and how far from the center you're evaluating. More terms generally means a more accurate approximation over a wider interval, but for functions with a limited radius of convergence, adding terms won't help outside that radius.

Why does the approximation get worse far from the center?

A Taylor polynomial is built entirely from information at a single point (the center) — derivatives there. The farther you move from that point, the less that local information reflects the function's actual global behavior, so the gap between the polynomial and the true function tends to grow (until you add enough additional terms to compensate).

Can I use this to approximate values like e or √2?

Yes — that's a classic use of Taylor series. For example, plugging x = 1 into the Maclaurin series for eˣ (truncated to enough terms) gives an approximation of e. Just be sure the point you're evaluating at is within the series' radius of convergence.

What does the "order n" actually control?

Order n means the polynomial includes terms up through (x−a)ⁿ — so order 3 includes the constant, linear, quadratic, and cubic terms. Higher order generally means a closer approximation over a wider range, at the cost of a longer expression.

What is a "radius of convergence"?

It's the distance from the center within which the infinite Taylor series actually adds up to the original function. Inside that radius, using more terms keeps improving the approximation; outside it, the infinite series either doesn't converge at all or converges to something other than f(x), no matter how many terms you add.