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.
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 \)
How to use the Taylor series calculator
- Type a function of
x— e.g.e^x,sin(x),ln(1+x), or1/(1-x)(or tap a preset). - Set the center a (use 0 for a Maclaurin series).
- 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!}\):
| k | f(k)(x) | f(k)(0) | coef = f(k)(0)/k! |
|---|---|---|---|
| 0 | ex | 1 | 1 |
| 1 | ex | 1 | 1 |
| 2 | ex | 1 | 1/2 |
| 3 | ex | 1 | 1/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:
| k | f(k)(x) | f(k)(0) | term |
|---|---|---|---|
| 0 | sin x | 0 | 0 |
| 1 | cos x | 1 | x |
| 2 | −sin x | 0 | 0 |
| 3 | −cos x | −1 | −x³/3! |
| 4 | sin x | 0 | 0 |
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):
| Function | Maclaurin series | Valid 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 series | Maclaurin series | |
|---|---|---|
| Center | any point \(a\) | \(a = 0\) |
| Powers of | \((x-a)\) | \(x\) |
| Best near | the point \(a\) | the origin |
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:
- Order 1 (linear): the tangent line — it matches the function's value and slope at \(a\).
- Order 2 (quadratic): adds curvature by matching the second derivative too.
- 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
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.
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.