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.
Taylor Series Calculator
Build Taylor and Maclaurin series and compare them with the curve
How to use the Taylor series calculator
- Type the function in the f(x) box, such as e^x or ln(x).
- In Series, type the centre in Centre (0 for Maclaurin).
- Set the Order, from 0 to 12. Order 4 means terms up to (x − a)⁴.
- Type a value in Measure the error at x, or drag the point on the graph.
- 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:
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:
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.
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:
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:
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:
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
| Function | Maclaurin series | Valid for |
|---|---|---|
| eˣ | 1 + x + x²/2! + x³/3! + … | All x |
| sin x | x − x³/3! + x⁵/5! − … | All x |
| cos x | 1 − 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:
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?
What is the difference between a Taylor series and a Maclaurin series?
How do you find a Taylor series?
What does the order of a Taylor polynomial mean?
What is the Lagrange error bound?
Why can't ln x have a Maclaurin series?
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