About the Taylor Series Calculator
This Taylor series calculator expands a function f(x) into its Taylor polynomial of degree n around a centre x = a, using the exact derivatives of f. Enter something like e^x, sin(x), ln(1 + x) or 1/(1 − x), choose the centre and the order, and it returns the polynomial with clean fractional coefficients such as x³/6 and the table of derivatives used to build it. With a = 0 the result is the Maclaurin series.
It also evaluates the polynomial at a test point and compares it with the true function value, so you can see how quickly the approximation improves as the order rises — and where it breaks down far from the centre. The chart overlays the function and its polynomial.
It is intended for calculus and analysis students, and for physicists and engineers who use small-angle and first-order approximations such as sin x ≈ x or √(1 + x) ≈ 1 + x/2. Orders up to 10 are supported; trigonometric functions use radians.
How to use the taylor series calculator
- 1Type the function f(x), e.g. sin(x) or ln(1+x).
- 2Choose the centre a — use 0 for a Maclaurin series.
- 3Pick the order n (how many powers to include, up to 10).
- 4Enter a test x to compare the polynomial with the true value.
- 5Read the polynomial, the coefficient table, and the error.
Formula and method
A Taylor polynomial matches the value and the first n derivatives of f at the centre a. Its coefficient on (x − a)ᵏ is the k-th derivative at a divided by k factorial. The calculator computes these derivatives exactly with Taylor-mode automatic differentiation (power-series arithmetic on the expression, free of rounding from finite differences), divides by k!, and displays the coefficients as exact fractions when they are rational (for example 1/120 for x⁵ in sin x).
The Lagrange remainder Rₙ(x) gives the error: for some c between a and x it equals f⁽ⁿ⁺¹⁾(c)(x − a)ⁿ⁺¹/(n + 1)!. Because of the factorial the error usually shrinks quickly near a, but the full infinite series only converges inside its radius of convergence — for ln(1 + x) that is |x| < 1 — so far from the centre the polynomial can diverge from f.
- a
- Centre of the expansion (a = 0 gives a Maclaurin series)
- n
- Order (highest power) of the polynomial
- f⁽ᵏ⁾(a)
- k-th derivative of f evaluated at a
- Rₙ(x)
- Remainder (error) after n terms
Worked examples
Maclaurin polynomial of eˣ, order 4
All derivatives of eˣ equal 1 at 0, so the coefficients are 1/k!: 1 + x + x²/2 + x³/6 + x⁴/24. At x = 1 that gives 2.708333 against e ≈ 2.718282, an error of about 0.00995.
sin(x), order 7, tested at x = 1
The derivatives of sin at 0 cycle 0, 1, 0, −1, so only odd powers appear with alternating signs over k!. With four terms, P₇(1) = 0.8414683 versus sin 1 = 0.8414710 — an error below 3 × 10⁻⁶.
ln(x) around a = 1, order 3, at x = 1.5
At a = 1, ln 1 = 0 and the derivatives are 1, −1, 2, giving coefficients 1, −1/2, 1/3. At x = 1.5: 0.5 − 0.125 + 0.041667 = 0.416667, versus ln 1.5 ≈ 0.405465.
Square root around 4 (order 2)
√x = 2 at x = 4, with f′(4) = 1/4 and f″(4) = −1/32, so P₂ = 2 + (x − 4)/4 − (x − 4)²/64. At 4.2 that is 2 + 0.05 − 0.000625 = 2.049375, matching √4.2 ≈ 2.049390 to five digits.
Frequently asked questions
What is the difference between a Taylor and a Maclaurin series?+
A Maclaurin series is simply a Taylor series centred at a = 0. Taylor series can be centred anywhere, which helps when the function is undefined or poorly behaved at 0, such as ln(x), which is usually expanded around a = 1.
What are the most common Maclaurin series?+
eˣ = 1 + x + x²/2! + x³/3! + …; sin x = x − x³/3! + x⁵/5! − …; cos x = 1 − x²/2! + x⁴/4! − …; 1/(1 − x) = 1 + x + x² + … for |x| < 1; and ln(1 + x) = x − x²/2 + x³/3 − … for −1 < x ≤ 1.
How many terms do I need for a good approximation?+
It depends on how far x is from the centre and how fast the derivatives grow. Use the Lagrange remainder bound |f⁽ⁿ⁺¹⁾(c)|·|x − a|ⁿ⁺¹/(n + 1)! — or simply increase n here until the error shown falls below your tolerance.
Why does the Taylor polynomial get worse far from the centre?+
Each Taylor series has a radius of convergence. Inside it, adding terms improves the approximation; outside it, the terms grow and the polynomial diverges from the function. For 1/(1 − x) and ln(1 + x) the radius is 1.
What is the order of a Taylor polynomial?+
The order (or degree) n is the highest power of (x − a) that is kept. An order-1 polynomial is the tangent line, an order-2 polynomial is the best-fitting parabola at the centre, and so on.