Taylor Series Calculator
Taylor Series Calculator
A Taylor series expresses a smooth function as an infinite sum of powers of (x - a), with coefficients built from the function's derivatives at a single point. When that point is zero, the series is called a Maclaurin series. These expansions let us approximate complicated functions — exponentials, sines, logarithms — using only addition and multiplication, which is exactly what computers and calculators do [stewart].
The idea was introduced by Brook Taylor in 1715, though James Gregory and Colin Maclaurin had explored special cases earlier. Taylor expansions underpin numerical methods, physics perturbation theory, and the hardware implementations of transcendental functions in every processor. Without them, your calculator could not evaluate sin(1) or e² to many digits.
This calculator builds the Taylor polynomial for four classic functions — eˣ, sin(x), cos(x), and ln(1+x) — about x = 0, up to an order N you choose. It sums the terms and shows how closely the polynomial matches the true value. Higher N means more terms and a better approximation (except near singularities).
Pick a Function from the menu: eˣ, sin(x), cos(x), or ln(1+x). Then enter the point x and the polynomial order N.
Example 1 — eˣ: approximate e¹ with N = 8. The terms are 1 + 1 + 1/2 + 1/6 + ... + 1/40320, summing to about 2.718279, very close to the true e ≈ 2.718282.
Example 2 — sin(x): approximate sin(1) (radians) with N = 9. The series is x - x³/3! + x⁵/5! - ..., giving about 0.841471, matching the true sine.
Example 3 — cos(x): approximate cos(1) with N = 8. The series 1 - x²/2! + x⁴/4! - ... gives about 0.540302.
Example 4 — ln(1+x): approximate ln(1.5) with N = 10. The series x - x²/2 + x³/3 - ... requires |x| < 1; x = 0.5 is valid and gives about 0.405465, close to the true ln(1.5).
Edge cases: for ln(1+x) the calculator rejects |x| ≥ 1 because the series only converges there. Orders must be non-negative integers. Very high N is fine mathematically but may hit floating-point limits in the factorial.
The Maclaurin series (about 0) of each function is:
Manual example: e¹ to N = 3. Sum the terms n = 0 to 3: 1/0! + 1/1! + 1/2! + 1/3! = 1 + 1 + 0.5 + 0.166667 = 2.666667. Adding more terms pushes this toward e ≈ 2.718282. The calculator loops over n, accumulating xⁿ/n! and alternating signs where the formula requires.
The Taylor series is the theoretical justification for almost every approximation a computer makes. When a calculator returns the sine of an angle, it is not consulting a table of every possible value but summing a few terms of the sine series, stopping once the next term is too small to matter at the requested precision.
The same idea powers optimization and machine learning, where a function is approximated locally by its first or second derivatives to decide which direction to move. A first-order Taylor approximation is the familiar tangent line; a second-order approximation adds curvature and underlies Newton's method for finding minima.
In physics, Taylor series are used to linearize complicated laws near an equilibrium point, turning a nonlinear system into a tractable linear one. Small-angle approximations such as sin θ ≈ θ are simply first-order Taylor truncations, valid precisely because the neglected terms are tiny when the angle is small.
Understanding the remainder term is as important as the series itself. The Lagrange remainder guarantees that the error is bounded by the next unused term, so you can choose the order N to achieve any target accuracy before computing a single coefficient. This is why Taylor series are trusted in safety-critical numerical work.
Taylor Approximation of eˣ at x = 1
| Order N | Approximation | Error |
|---|---|---|
| 1 | 1.000000 | 1.718282 |
| 2 | 2.000000 | 0.718282 |
| 4 | 2.666667 | 0.051615 |
| 6 | 2.718056 | 0.000226 |
| 8 | 2.718279 | 0.000003 |
| 10 | 2.718282 | ~0 |
The chart shows the characteristic convergence: early orders make large jumps, then each added term contributes less. This rapid settling is why a handful of terms suffice for good accuracy near the expansion point.
These additional cases show how the order N controls accuracy in practice.
Example A — approximating cos(π/3) with N = 6: cos x = 1 - x²/2! + x⁴/4! - ..., with x = π/3 ≈ 1.0472. The terms are 1 - 0.5·1.0966 + 0.04167·1.216 + ... ≈ 0.5000, matching cos(60°) = 0.5. Six terms already give four correct decimals.
Example B — ln(1.2) with N = 12: x = 0.2, so the alternating series 0.2 - 0.02 + 0.00267 - 0.0004 + ... approaches ln(1.2) ≈ 0.182322. Because x is small, convergence is fast; twelve terms are more than enough.
Example C — e^(-1) with N = 10: the series 1 - 1 + 0.5 - 0.1667 + ... sums to about 0.367879, the true e⁻¹. The alternating signs mean adjacent partial sums straddle the limit, a useful visual check.
Example D — sin(0.5) with N = 5: x - x³/6 + x⁵/120 with x = 0.5 gives 0.5 - 0.020833 + 0.00026 ≈ 0.4794, close to the true sin(0.5) ≈ 0.479426. Few terms suffice for small arguments.
Example E — catastrophic behavior at the edge: ln(1+x) with x = 0.99 and N = 10 still converges but slowly, needing hundreds of terms for full accuracy. This demonstrates why the radius of convergence matters even when x is technically inside it.
Example F — comparing eˣ and its truncated polynomial: at x = 3, the N = 8 polynomial gives about 19.4 versus the true e³ ≈ 20.085; raising N to 12 closes most of the gap. The exponential converges everywhere, but large x needs more terms.
Example G — using the remainder estimate: for sin(x), the error after keeping through x⁵ is at most |x|⁷/7!. At x = 1 that is about 1/5040 ≈ 0.0002, so N = 5 already guarantees three correct decimals. This bound lets you pick N without computing further terms.
Example H — building a cosine from sines: any smooth periodic function can be written as a sum of sines and cosines (a Fourier series), which is itself a kind of infinite series of the very functions this calculator expands. Taylor series are the local cousin of Fourier series.
- Increase N until the result stops changing in the digits you care about; that signals you have reached the precision floating point allows.
- For ln(1+x), keep |x| well below 1. Near x = 1 the series converges very slowly, and at x ≥ 1 it diverges entirely.
- Remember these expansions are about x = 0. To expand about another point a, shift the variable: use the series for e^(x-a), sin(x-a), etc.
- The alternating series (sin, cos, ln) have their error bounded by the first omitted term, a useful rule of thumb for stopping order.
- Match the angle unit: the sin and cos templates use radians. An input of 90 would mean 90 radians, not 90 degrees.
- Use Taylor polynomials when you need a function value but only have basic arithmetic; this is how calculators evaluate transcendentals.
- Expansion Point Fixed at 0: Only Maclaurin (about zero) series are offered; general Taylor expansions about arbitrary a are not.
- Convergence Radius: The ln(1+x) series only converges for |x| < 1; the calculator blocks |x| ≥ 1, but even x near 1 needs many terms.
- Radian Input for Trig: sin and cos take x in radians. Entering degrees produces meaningless numbers.
- No Symbolic Output: Results are numeric sums, not the symbolic series expression.
- Factorial Overflow: Extremely high N makes n! overflow or lose precision in floating point, though orders below a few hundred are safe.
- Local Accuracy: Far from the expansion point, even high-order polynomials may diverge (except eˣ, which converges everywhere).
- What is a Taylor series?
- It is an infinite polynomial that equals a smooth function near a chosen point, built from the function's derivatives there. About zero it is called a Maclaurin series.
- Why do calculators use Taylor series?
- A polynomial needs only addition and multiplication, which hardware does efficiently. Calculators sum enough terms of a Taylor expansion to reach the required precision for eˣ, sine, and so on.
- What does the order N control?
- N is the highest power kept. Larger N means more terms and a closer approximation to the true function, up to the limits of floating-point arithmetic.
- Why does ln(1+x) require |x| < 1?
- That is the radius of convergence of its series. Outside that interval the infinite sum does not approach a finite limit, so partial sums are meaningless.
- Are the sin and cos inputs in degrees or radians?
- Radians. The standard series sin x = x - x³/3! + ... assumes x is in radians; entering degrees gives wrong values.
- What is the difference between Taylor and Maclaurin series?
- A Maclaurin series is simply a Taylor series expanded about the point zero. The general Taylor form centers at any point a.
- How accurate is a low-order approximation?
- For e¹, order 2 gives 2.0 and order 8 gives 2.718279 versus the true 2.718282. Accuracy improves dramatically with each few terms near the center.
- Can Taylor series approximate any function?
- Only smooth (infinitely differentiable) functions on the interval of interest, and only within the radius of convergence. Functions with corners or singularities are excluded or poorly approximated.
- Why does eˣ converge everywhere but ln does not?
- The exponential series has an infinite radius of convergence, so it works for any x. The logarithm series has radius 1, so it fails once |x| reaches 1.
- What is the error of a Taylor approximation?
- For alternating series it is bounded by the first omitted term. More generally it depends on the next derivative and how far x is from the expansion point.
Taylor series turn the uncomputable into the computable. A processor has no "sine" instruction; it evaluates sin(x) by summing a few terms of the alternating series, stopping when the next term is smaller than the rounding tolerance. The order N you choose here is exactly the trade-off a chip designer makes between speed and accuracy.
Extended example 1 — small-angle approximations in physics: for small x in radians, sin x ≈ x, cos x ≈ 1 - x²/2, and eˣ ≈ 1 + x. These are just the first one or two terms of the respective Maclaurin series. Pendulum motion, the spring equation, and the simple lens formula all rely on these truncations, which is why introductory physics works so well for small oscillations.
Extended example 2 — approximating e² without a calculator: take the eˣ series with x = 2 and N = 10. The terms are 1 + 2 + 2 + 1.333 + 0.667 + 0.267 + 0.089 + 0.025 + 0.006 + 0.001 + 0.0003, summing to about 7.389, the true e². This shows how a few powers and factorials reconstruct a transcendental number.
Extended example 3 — relativity corrections: Einstein's energy formula E = mc² is the leading term; the next corrections for a moving body involve (v/c)², (v/c)⁴, and so on — a Taylor expansion of the relativistic factor in the small parameter v/c. Engineers use the first correction term to keep GPS satellite clocks accurate to nanoseconds.
Extended example 4 — compound interest limit: the formula for continuous compounding, A = Pe^(rt), emerges from the limit of the geometric series (1 + rt/n)ⁿ as n → ∞. Expanding e^(rt) as a Taylor series lets you approximate growth over short intervals using only polynomial terms.
Extended example 5 — error bounding with the alternating series test: for sin and cos, the error after N terms is no larger than the first omitted term. If you keep terms through x⁵/5! for sin(x), your error is at most |x|⁷/7!. This gives a rigorous stopping rule: choose N so the next term is below your tolerance, which is far cheaper than estimating high derivatives.
Extended example 6 — numerical differentiation and integration: many finite-difference and quadrature formulas are derived by Taylor-expanding the function at nearby points and canceling terms. The central difference (f(x+h) - f(x-h))/2h comes from adding two Taylor expansions so the h and h³ terms cancel. Understanding the series explains both the accuracy and the error of these methods.
Extended example 7 — perturbation theory in quantum mechanics: when a small disturbance is added to a system you can already solve, the new energy levels are expressed as a Taylor-like series in the perturbation strength. Each term is computed from the unperturbed solution, a direct use of expansion about a known point.
Extended example 8 — computing logarithms: before computers, ln(1+x) was evaluated by the alternating series for x between -1 and 1. To find ln(2), rewrite it as 2·ln(1.25) - ln(1.5625) or use a transformation that keeps the argument small, because the series converges faster near zero. This is why the calculator restricts the argument to below 1: outside that window the partial sums drift instead of settling.
When using the tool, watch how quickly each function settles. eˣ and the trig functions converge for any reasonable x, but ln(1+x) demands a small argument. Begin with N = 6 or 8, then raise it until the displayed digits stabilize; that stability is your signal that floating-point precision — not the mathematics — has become the limiting factor.
The order N is a budget of accuracy. Each additional term you keep costs one more multiplication and addition but typically shrinks the error by a predictable amount, so the trade-off between work and precision is explicit. This is exactly the decision a numerical library makes internally when evaluating a transcendental function to a fixed number of digits.
A Taylor series is only as good as the smoothness of the function at the expansion point. A function with a corner or a vertical asymptote there cannot be represented well, and forcing more terms will not fix a fundamental mismatch. The four functions offered here are all infinitely differentiable, which is why their expansions behave so nicely.
The alternating series among the templates — sine, cosine, and the logarithm — have a comforting property: their partial sums oscillate above and below the true value, and the gap after stopping is no larger than the first term you discarded. That single fact gives you a rigorous, easy stopping rule without estimating any derivative.
Maclaurin series are a special case of the more general Taylor form centered at an arbitrary point a. Shifting the center lets you approximate a function near wherever you actually need it, not just near zero, which is why the theory extends from these examples to the local linearizations used throughout engineering and physics.
The coefficients of a Taylor series are the function's derivatives at the center point divided by factorials. That is why a function must be smooth — differentiable as many times as you like — for the series to exist, and why a function with a corner or cusp cannot be represented well no matter how many terms you keep.
Truncating a Taylor series trades exactness for speed. Keeping only the first few terms gives a polynomial that is easy to evaluate and differentiate, and the error you introduce is bounded by a later term, so you can choose the order to match the precision your application actually needs rather than computing infinitely many terms.
The exponential series converges for every real x, which makes it exceptionally useful. Unlike the logarithm, which only works for arguments below one in magnitude, the exponential never hits a wall, and that global convergence is why e^x appears as the model for unbounded growth and decay everywhere from biology to finance.
Function approximation is the practical payoff. A computer evaluates sin, cos, and the exponential by summing a short Taylor polynomial, stopping once the next term falls below the rounding threshold. The order N you select here mimics that internal trade-off, showing directly how more terms buy more digits of accuracy.
- [1]Paul's Online Math Notes. (Calculus I-III).
- [2]Thomas, George B., Weir, Maurice D., and Hass, Joel. (2014). Thomas' Calculus (13th ed.). Pearson.
- [3]Apostol, Tom M. (1967). Calculus, Vol. 1 (2nd ed.). Wiley.
- [4]Paul's Online Math Notes. (n.d.). Taylor Series. Retrieved from
- [5]Khan Academy. (n.d.). Taylor & Maclaurin polynomials. Retrieved from
- [6]Weisstein, Eric W. (n.d.). Taylor Series. MathWorld — A Wolfram Web Resource.
Last updated: July 20, 2026
UnByte — Independent Software Engineering
Every calculator references authoritative sources — Editorial policy