Taylor Series Calculator: Free Maclaurin Expansion + Graph

This free Taylor series calculator expands any function into its Taylor or Maclaurin polynomial: type a function, choose a center and the number of terms, and it shows the series, a step-by-step coefficient table, and a graph of the approximation closing in on the real curve. Set the center to 0 and it becomes a Maclaurin series calculator.

ŷ = …
Pick a function and press Expand series.
Free tool by mlforbeginners.com · embed it: <iframe src="https://mlforbeginners.com/taylor-series-calculator/"></iframe>

What this Taylor series calculator does

A Taylor series rewrites a function as an infinite sum of power terms built from its derivatives at a single point. Truncate that sum after a few terms and you get a polynomial that closely matches the original function near the chosen center — the engine behind how calculators and computers evaluate \(e^x\), \(\sin x\), and countless other functions. This Taylor series calculator does the algebra for you: it differentiates your function, evaluates each derivative at the center, builds the coefficients, and plots the result.

\( f(x) = \displaystyle\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}\,(x-a)^{k} = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots \)

Key idea: a Maclaurin series is simply a Taylor series centered at a = 0. Set the center to 0 above and this becomes a Maclaurin series calculator — same math, special case.

How to use the Taylor series calculator

  1. Type a function of x — e.g. e^x, sin(x), ln(1+x), or 1/(1-x) (or tap a preset).
  2. Set the center a (use 0 for a Maclaurin series).
  3. Slide the number of terms (order n) and watch the red polynomial hug the blue curve more tightly as n grows.

How a Taylor series is built (worked example)

Take \(f(x)=e^x\) about \(a=0\). Because every derivative of \(e^x\) is \(e^x\), and \(e^0 = 1\), every coefficient is \(\tfrac{1}{k!}\):

kf(k)(x)f(k)(0)coef = f(k)(0)/k!
0ex11
1ex11
2ex11/2
3ex11/6

So \(e^x \approx 1 + x + \tfrac{x^2}{2} + \tfrac{x^3}{6} + \tfrac{x^4}{24} + \cdots\) — exactly what the calculator returns above.

Worked example 2: the Maclaurin series of sin(x)

The derivatives of \(\sin x\) cycle through a pattern of four, which is exactly what produces the "every other term, alternating sign" shape:

kf(k)(x)f(k)(0)term
0sin x00
1cos x1x
2−sin x00
3−cos x−1−x³/3!
4sin x00

Only the odd powers survive, giving \(\sin x \approx x - \tfrac{x^3}{3!} + \tfrac{x^5}{5!} - \cdots\) — tap the sin(x) preset above to confirm it.

Common Maclaurin series to memorize

These six show up constantly — the calculator reproduces every one of them (set a = 0):

FunctionMaclaurin seriesValid for
\(e^x\)\(1 + x + \tfrac{x^2}{2!} + \tfrac{x^3}{3!} + \cdots\)all x
\(\sin x\)\(x - \tfrac{x^3}{3!} + \tfrac{x^5}{5!} - \cdots\)all x
\(\cos x\)\(1 - \tfrac{x^2}{2!} + \tfrac{x^4}{4!} - \cdots\)all x
\(\dfrac{1}{1-x}\)\(1 + x + x^2 + x^3 + \cdots\)\(|x|<1\)
\(\ln(1+x)\)\(x - \tfrac{x^2}{2} + \tfrac{x^3}{3} - \cdots\)\(-1 < x \le 1\)
\((1+x)^p\)\(1 + px + \tfrac{p(p-1)}{2!}x^2 + \cdots\)\(|x|<1\)

Taylor vs. Maclaurin series

Taylor seriesMaclaurin series
Centerany point \(a\)\(a = 0\)
Powers of\((x-a)\)\(x\)
Best nearthe point \(a\)the origin
⚠ Watch the radius of convergence. A Taylor series only equals the function inside an interval of convergence. For \(\tfrac{1}{1-x}\) that interval is \(|x|<1\); push past it and the polynomial diverges wildly — you can see it fly off the chart above. More terms help inside the interval, not outside it.
💡 How many terms do you need? Near the center, just 3–4 terms are often shockingly accurate. The farther x is from a, the more terms you need. A quick rule: add terms until the next one is smaller than the precision you care about.
The big idea: any smooth function looks like a polynomial if you zoom in close enough. The Taylor series is the recipe for that polynomial.

Why Taylor series matter (including in machine learning)

Taylor series are everywhere once you start looking:

  • Computing functions: your calculator finds \(\sin(0.5)\) by summing a few Maclaurin terms.
  • Physics: the small-angle approximation \(\sin\theta \approx \theta\) is just the first Taylor term.
  • Machine learning & optimization: gradient descent, Newton's method, and second-order optimizers all rely on first- and second-order Taylor approximations of the loss function. Activation functions and softmax are frequently analyzed through their Taylor expansions.

In Python, the same expansion is one line with SymPy:

import sympy as sp
x = sp.symbols('x')
sp.series(sp.exp(x), x, 0, 6)   # 1 + x + x**2/2 + x**3/6 + x**4/24 + O(x**6)

For the calculus that feeds these approximations, see our derivative calculator and partial derivative calculator. For the formal theory, the Taylor series article on Wikipedia is a solid reference.

Linear, quadratic, cubic: each term adds detail

Truncating the series at different orders gives a ladder of approximations, each sharper than the last near the center:

  1. Order 1 (linear): the tangent line — it matches the function's value and slope at \(a\).
  2. Order 2 (quadratic): adds curvature by matching the second derivative too.
  3. Order 3 and up: the polynomial bends to track the function further from \(a\).

Drag the terms slider from 1 upward and watch the red curve gain detail with each order.

Choosing the center a

A Taylor series is most accurate near its center, so choose an \(a\) close to where you actually need the approximation — and one where the function and its derivatives are easy to evaluate. Expanding \(\ln x\) about \(a = 1\) (rather than 0, where it is undefined) is the classic case: type ln(x) with center 1 above and watch it work.

How accurate is it? The remainder

The error left after \(n\) terms is the Lagrange remainder, \( R_n(x) = \dfrac{f^{(n+1)}(c)}{(n+1)!}\,(x-a)^{\,n+1} \) for some \(c\) between \(a\) and \(x\). Two lessons fall straight out of it: the error shrinks fast as you add terms (that \((n+1)!\) in the denominator grows quickly), and it grows as \(x\) moves away from the center.

Key terms at a glance

Center (a)
the point the series is built around; \(a = 0\) makes it a Maclaurin series.
Order (n)
the highest power kept — the polynomial runs up to \((x-a)^n\).
f(k)(a)
the k-th derivative of the function evaluated at the center.
Interval of convergence
the range of \(x\) for which the infinite series actually equals the function.
📚 Did you know? The formula is named after Brook Taylor, who published the general result in 1715. The special case centered at zero carries the name of Colin Maclaurin, who popularized it a few decades later — even though Taylor's formula already contained it.

Frequently asked questions

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

A Maclaurin series is a Taylor series centered at zero (\(a = 0\)). Every Maclaurin series is a Taylor series; not every Taylor series is a Maclaurin series.

What is the Taylor series formula?

\(f(x)=\sum_{k=0}^{\infty}\frac{f^{(k)}(a)}{k!}(x-a)^k\), where \(f^{(k)}(a)\) is the k-th derivative evaluated at the center \(a\).

How many terms should I use?

Enough that the next term is smaller than the accuracy you need. Near the center, 3–5 terms are usually plenty; farther away you need more.

Why is there a factorial in each term?

Dividing by \(k!\) is exactly what makes the k-th derivative of the polynomial match the k-th derivative of the function at the center. It is the bookkeeping that keeps every derivative in agreement.

Does every function have a Taylor series?

Only functions that are infinitely differentiable at the center — and even then the series only equals the function within its radius of convergence.

Can this calculator do Maclaurin series?

Yes — set the center \(a\) to 0 and it produces the Maclaurin series.

Scroll to Top