Taylor and Maclaurin series calculator
Find the Taylor or Maclaurin polynomial of a function to order 20, with exact coefficients, an error estimate and a graph.
A clear answer. Here’s how.
The coefficients cₖ = f⁽ᵏ⁾(a)/k! are computed by truncated power-series (Taylor jet) arithmetic on the expression tree: sums term by term, products by convolution, quotients by series division, and exp, ln, sin, cos, sinh, cosh, powers u^α (Miller’s recurrence), asin, acos and atan by their standard recurrences, with composition handled automatically. No derivative formula is expanded and nothing is estimated numerically. The arithmetic is exact (BigInt fractions) while every value stays rational, for example at a = 0 for e^x, sin x or √(1 + x); otherwise, such as e^x about 1, it runs in double precision. The polynomial is written as Σ cₖ(x − a)ᵏ in a form you can paste into a plotter. The error on the interval is estimated from the next non-zero term, |cₘ|·max|x − a|ᵐ, which is an estimate and not a bound (it fails beyond the radius of convergence), and is compared with the largest difference found at 401 sample points. The Lagrange remainder Rₙ(x) = f⁽ⁿ⁺¹⁾(ξ)/(n + 1)!·(x − a)ⁿ⁺¹ is stated. Centres where f has a pole or is not smooth (ln x or √x at 0, |x| at 0) are refused. It does not find the radius of convergence or Laurent series.
How this is checked
5 reference checks passed These 5 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- Function f(x) exp(x)Order n 5
- Expected, and what Toolmoz gave
- Taylor polynomial expected 1 + x + x^2/2 + x^3/6 + x^4/24 + x^5/120, Toolmoz 1 + x + x^2/2 + x^3/6 + x^4/24 + x^5/120Coefficients expected Exact rational numbers, Toolmoz Exact rational numbers
- Where the expected answer comes from
- Textbook Maclaurin series of eˣ: cₖ = 1/k!, so 1, 1, 1/2, 1/6, 1/24, 1/120
- Allowed difference
- exact
Case 2
- Inputs
- Function f(x) sin(x)Order n 7
- Expected, and what Toolmoz gave
- Taylor polynomial expected x - x^3/6 + x^5/120 - x^7/5040, Toolmoz x - x^3/6 + x^5/120 - x^7/5040
- Where the expected answer comes from
- Textbook Maclaurin series of sin x: x − x³/3! + x⁵/5! − x⁷/7!
- Allowed difference
- exact
Case 3
- Inputs
- Function f(x) sqrt(1+x)Order n 4
- Expected, and what Toolmoz gave
- Taylor polynomial expected 1 + x/2 - x^2/8 + x^3/16 - 5*x^4/128, Toolmoz 1 + x/2 - x^2/8 + x^3/16 - 5*x^4/128
- Where the expected answer comes from
- Binomial series of (1 + x)^(1/2): binomial coefficients 1, 1/2, −1/8, 1/16, −5/128
- Allowed difference
- exact
Case 4
- Inputs
- Function f(x) tan(x)Order n 7
- Expected, and what Toolmoz gave
- Taylor polynomial expected x + x^3/3 + 2*x^5/15 + 17*x^7/315, Toolmoz x + x^3/3 + 2*x^5/15 + 17*x^7/315
- Where the expected answer comes from
- Textbook Maclaurin series of tan x: x + x³/3 + 2x⁵/15 + 17x⁷/315 (Wikipedia, Taylor series, list of Maclaurin series)
- Allowed difference
- exact
Case 5
- Inputs
- Function f(x) exp(x)Centre a (0 gives a Maclaurin series) 1Order n 3Interval from x = 0Interval to x = 2
- Expected, and what Toolmoz gave
- Coefficient c0 expected 2.718281828459045, Toolmoz 2.718281828459045Coefficient c2 expected 1.3591409142295225, Toolmoz 1.3591409142295225Coefficient c3 expected 0.45304697140984085, Toolmoz 0.45304697140984085Coefficients expected Floating point (the exact values are irrational), Toolmoz Floating point (the exact values are irrational)
- Where the expected answer comes from
- Taylor series of eˣ about 1: cₖ = e/k!, so e, e/2 = 1.3591409142295225 and e/6 = 0.45304697140984085 (Python math.e)
- Allowed difference
- ±1e-12 relative
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Function f(x)
- sin(x)
- Centre a (0 gives a Maclaurin series)
- 0
- Order n
- 7
- Interval from x =
- -4
- Interval to x =
- 4
- x values for the comparison table
- 0.5, 1, 2, 3
- Table shows
- The coefficients c_k
Example result
| k | Coefficient c_k (exact) | c_k as a decimal | k-th derivative at the centre, k!·c_k |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 0 | 0 | 0 |
| 3 | -1/6 (≈ -0.16666667) | -0.166666666667 | -1 |
| 4 | 0 | 0 | 0 |
Coefficients come from truncated power-series arithmetic on the expression (no numerical differentiation), exactly in fractions while every value stays rational and in double precision otherwise. Error on [-4, 4]: the next non-zero term gives an estimate of 0.722399 (an estimate, not a bound: it assumes the terms keep shrinking, which fails outside the radius of convergence); the largest difference found by sampling 401 points is 0.627324 at x = -4. Exact remainder (Lagrange form): R7(x) = f^(8)(ξ)/40320 · x^8, for some ξ between 0 and x. Refused: centres where f has a pole or is not smooth (ln at 0, sqrt at 0, abs at 0, tan at a pole).