Uni-Sine
MathematicsCalculus

Taylor series calculator

A Taylor series calculator writes a function as a polynomial that matches it near a chosen point, called the centre. Our calculator expands any function about any centre, up to order 12, and shows each derivative, its value at the centre and the coefficient it gives. It plots the series against the real curve and measures the error at a point you choose.

A Maclaurin series is a Taylor series centred at 0, so the same calculator does both: leave the centre at 0 for a Maclaurin series.

Try it

Taylor Series Calculator

Build Taylor and Maclaurin series and compare them with the curve

Go to its page

How to use the Taylor series calculator

  1. Type the function in the f(x) box, such as e^x or ln(x).
  2. In Series, type the centre in Centre (0 for Maclaurin).
  3. Set the Order, from 0 to 12. Order 4 means terms up to (x − a)⁴.
  4. Type a value in Measure the error at x, or drag the point on the graph.
  5. Read the polynomial, then the readouts: f at your point, the series at your point, the true error and the Lagrange error bound.

The working lists each derivative and its value at the centre, then divides by k factorial to get each coefficient. The graph shows the function, the series of your order and the lower-order sums, so you can watch the fit improve. For practice, Practice and help sets Taylor series questions with worked solutions.

The Taylor series formula

The Taylor series of f about the centre x = a is:

f(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \frac{f'''(a)}{3!}(x - a)^3 + \cdotsEach term uses the next derivative, divided by its factorial

Stopping after the (x − a)ⁿ term gives the Taylor polynomial of order n, written Pₙ(x). With a = 0 it is the Maclaurin series: f(x) = f(0) + f'(0)x + f''(0)x²/2! + ….

Worked examples you can check in the calculator

Example 1: the Maclaurin series of eˣ

Every derivative of eˣ is eˣ, and e⁰ = 1, so every coefficient is 1 over a factorial. To order 4:

e^x \approx 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24}

At x = 1 this gives 2.7083, against the true value e = 2.7183, an error of about 0.0099. Type e^x with centre 0, order 4 and the error point 1: the calculator shows exactly these readouts, with a Lagrange bound of 0.022652.

y = \mathrm{P4}\left( x\right)
-3-2.5-2-1.5-1-0.50.511.522.5-224681012centreP4(1) = 2.7083
Drag to pan, scroll to zoom. x from -3 to 2.5, y from -2.17 to 13.

Here x is the input and y is the value of the polynomial P₄(x). Near the centre it is almost the same as eˣ; further away, the two curves part. In the calculator, eˣ is drawn alongside so you can see the gap.

Example 2: sin x

The derivatives of sin x go sin, cos, −sin, −cos and repeat. At 0 they are 0, 1, 0, −1, so only odd powers appear:

\sin x \approx x - \frac{x^3}{6} + \frac{x^5}{120}

At x = 0.5 this order 5 polynomial is out by only about 1.5 × 10⁻⁶. Set order 5 in the calculator to see it.

Example 3: a Taylor series about another centre

ln x cannot have a Maclaurin series, because ln 0 is undefined, so expand it about x = 1. The derivatives at 1 are 1, −1 and 2, giving:

\ln x \approx (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3}

Type ln(x) with centre 1 and order 3. At x = 1.2 the series gives 0.18267, against ln 1.2 = 0.18232.

Example 4: approximating a square root

To estimate √4.1, expand √x about 4, where the square root is easy. To order 2:

\sqrt{x} \approx 2 + \frac{x - 4}{4} - \frac{(x - 4)^2}{64}

At x = 4.1 this gives 2 + 0.025 − 0.00015625 = 2.02484, which is correct to about 2 × 10⁻⁶. That is the main use of a Taylor polynomial: a simple formula that is very accurate close to the centre.

Common Maclaurin series

FunctionMaclaurin seriesValid for
eˣ1 + x + x²/2! + x³/3! + …All x
sin xx − x³/3! + x⁵/5! − …All x
cos x1 − x²/2! + x⁴/4! − …All x
ln(1 + x)x − x²/2 + x³/3 − …−1 < x ≤ 1
1/(1 − x)1 + x + x² + x³ + …−1 < x < 1

Each can be checked in the calculator. Outside the range in the last column the series does not converge, so adding more terms makes the approximation worse, not better.

Error and the Lagrange error bound

The error is how far the polynomial is from the real function at a point. The calculator gives the true error and the Lagrange bound, the largest the error could be, which is what AP Calculus BC and university courses ask for:

|R_n(x)| \le \frac{M}{(n + 1)!}|x - a|^{n + 1}M is the largest value of the (n + 1)th derivative between a and x

For eˣ to order 4 at x = 1, the true error is 0.0099 and the bound is 0.0227, so the bound is a safe overestimate. The error shrinks quickly as you add terms or move closer to the centre.

Common mistakes

  • Forgetting the factorials. The coefficient of (x − a)ⁿ is f⁽ⁿ⁾(a) ÷ n!, not just f⁽ⁿ⁾(a).
  • Evaluating derivatives at x instead of at the centre. Every derivative is worked out at a, then becomes a number.
  • Using powers of x for a series about a ≠ 0. The terms are powers of (x − a).
  • Confusing order with number of terms. The order 5 series of sin x has only three terms, because the even ones are zero.
  • Using a series outside where it converges. The series for ln(1 + x) is no good at x = 3.

Practise series in a short timed paper

Taylor and Maclaurin series come up in our AP Calculus BC and College Calculus II & III daily papers, and in A-level Further Maths in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. The derivatives come from the Derivative Calculator, which our derivative calculator guide explains.

Common questions

What is a Taylor series?
A way of writing a function as an infinite sum of powers of (x − a), using its derivatives at the point a. Cutting it off after a few terms gives a polynomial that closely matches the function near a.
What is the difference between a Taylor series and a Maclaurin series?
A Maclaurin series is a Taylor series centred at 0. Every Maclaurin series is a Taylor series, but not the other way round.
How do you find a Taylor series?
Differentiate the function repeatedly, evaluate each derivative at the centre a, divide the nth one by n!, and use it as the coefficient of (x − a)ⁿ.
What does the order of a Taylor polynomial mean?
The highest power it includes. An order 3 polynomial has terms up to (x − a)³.
What is the Lagrange error bound?
The largest possible error when a Taylor polynomial of order n is used to approximate the function at a point. It uses the size of the next derivative.
Why can't ln x have a Maclaurin series?
ln x and its derivatives are not defined at x = 0, so there is nothing to build the series from. Expand about x = 1 instead.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Taylor Series Calculator

    Build Taylor and Maclaurin series and compare them with the curve

    Open the tool
  • Learn it

    Calculus

    Differentiation, integration and the mathematics that drives physics and engineering

    Start the course
  • Test it

    AP Calculus BC

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · CalculusDerivative calculator with steps: every rule shownFree derivative calculator with steps: each rule named, second and higher derivatives, the slope and tangent at any point, and partial derivatives in x.