Taylor Series Calculator
How this Taylor series calculator constructs a polynomial
This Taylor series calculator turns a function of x into a finite polynomial centered at the expansion point a. It symbolically differentiates the expression, evaluates every derivative at a, divides that value by the corresponding factorial, and combines the terms through the maximum order n you select. The result is displayed with decimal coefficients and powers of x - a, which makes the chosen center visible in every nonconstant term.
Choosing a = 0 produces a Maclaurin polynomial, the common special case of a Taylor expansion centered at zero. That center is convenient for expressions such as sin(x), cos(x), exp(x), and log(1+x). A nonzero center can be more useful when the behavior of interest is elsewhere, such as expanding sqrt(x) near x = 4. The center is not merely a display choice: it is the point where this calculator evaluates the function and all of the derivatives that supply its coefficients.
The polynomial shown here is a local stand-in for the entered function rather than a statement that the two agree everywhere. A fifth-order expansion can closely follow a function near its center while differing substantially farther away. Use the selected order and center deliberately, and compare the polynomial with the original expression at values near a when deciding whether it is useful. If the application matters away from the center, changing the center can be as important as adding terms.
Taylor output is especially useful for examining local value, slope, curvature, and higher-order change in one expression. The constant term anchors the polynomial at the function value at a; the linear term reflects the tangent behavior there; later terms refine that local shape. A missing displayed term does not necessarily mean the calculator skipped a derivative: it can mean that the calculated coefficient is zero or small enough to be omitted from the rendered polynomial.
Taylor polynomial formula and symbolic method
The Taylor polynomial calculated through order n for f, centered at a, is:
For this calculator, the term with order zero is f(a); order one uses the slope f′(a); and order two uses the curvature contribution f″(a) / 2!. Each subsequent term comes from one more symbolic derivative and one larger factorial. Coefficients whose absolute values are below the calculator's display threshold are left out of the rendered polynomial, although the coefficient breakdown still lists the computed terms.
The factorial in the denominator is essential to the Taylor construction. It scales each derivative so that the coefficient belongs with the matching power of x - a, rather than treating derivative values alone as polynomial coefficients. The breakdown beneath a computed result shows this division explicitly for every requested order. Reading that list is a practical way to check whether an unexpectedly large term comes from the derivative evaluation at the center or from the degree you chose.
The calculator constructs only the finite polynomial through the requested order. It does not report a remainder term or an error bound. In mathematical analysis, the difference between a function and its finite Taylor polynomial is described by an appropriate remainder expression, but the form and usefulness of such a bound depend on the particular function and interval. Treat the displayed series as an approximation to investigate, not as an automatic accuracy certificate.
How to generate a Taylor polynomial
To build a Taylor polynomial with this page, enter an expression that math.js can differentiate and then set the center and degree of the local expansion.
- Enter a math.js-compatible function using x as the variable, such as
sin(x),exp(x),log(1+x), orsqrt(x). - Choose the expansion point a. Use 0 when you want a Maclaurin polynomial.
- Choose an integer order from 0 to 15. Begin with a low degree, then raise it only after confirming that the function and its needed derivatives are defined at a.
- Read the polynomial and the derivative-by-derivative coefficient breakdown. The Copy Series button copies both the displayed approximation and that breakdown.
Domain and differentiability matter for a Taylor expansion. For instance, log(x) cannot be evaluated at zero, while sqrt(x) has derivative behavior at zero that can prevent the requested expansion from being formed. If the calculator reports an evaluation or differentiation problem, choose another center, lower the order, or rewrite the expression in a form math.js can handle.
It is sensible to start by checking the constant and linear portions of the result. At the chosen center, the polynomial should begin with the entered function's value; when a linear term is present, it describes the local tangent contribution. Then increase the order one step at a time and inspect the new coefficient. This process helps distinguish a meaningful refinement of the local approximation from a request that reaches syntax, domain, or symbolic-differentiation limitations.
Worked example: the sine Maclaurin polynomial
For sin(x) centered at a = 0, the nonzero derivative values cycle through 1 and -1 while the even-order derivative values at zero vanish. Through order 5, the calculator gives the Maclaurin polynomial:
sin(x) ≈ x - 0.166667 x^3 + 0.00833333 x^5
This sine expansion illustrates why the selected center is so important. Close to zero, its leading term gives sin(x) ≈ x when x is measured in radians. The cubic and fifth-order corrections account for the curve's departure from that straight-line approximation as values move away from the origin. The coefficients are displayed as rounded decimals, so the calculator output is intended for numerical use and inspection rather than exact symbolic proof notation.
The derivative breakdown for this example also explains the gaps between powers. Although the calculator evaluates every order through 5, the even-order coefficients at zero are zero and therefore do not appear in the rendered polynomial. That omission is specific to the derivative values at this center, not a general rule that Taylor polynomials use only odd powers. A different expression or a different expansion point can produce constant, linear, quadratic, and higher powers in succession.
Assumptions and limitations of Taylor polynomial output
This Taylor series calculator relies on math.js for symbolic differentiation, so elementary expressions that math.js can parse are its most suitable inputs. Piecewise definitions, absolute values at nondifferentiable locations, discontinuities, branch-related behavior, and unsupported syntax can cause differentiation to fail or can yield coefficients that do not answer the mathematical question you have in mind. The displayed polynomial and coefficient list are rounded for readability.
A finite Taylor polynomial is most informative near its chosen expansion point a. Its accuracy depends on the function's behavior, the available derivatives, the order entered here, and the distance from a; a higher order is not an automatic guarantee of a better approximation everywhere. For a formal error bound, apply an appropriate remainder theorem to the particular function. For exploratory work, calculate several orders and compare them with the original function over the local interval that matters to you.
Changing the order changes the number of derivatives the calculator must form and evaluate. An expression may work at a low order but fail at a later one because a higher derivative cannot be produced or evaluated at the selected center. Similarly, a valid numerical point is not automatically a suitable Taylor center if the expression has a singularity, discontinuity, or inadequate derivative behavior there. When a result is surprising, verify the original function at a, then inspect the coefficient list before relying on the approximation.
The output is numerical formatting of a symbolic-derivative process, so rounded coefficients can conceal exact relationships such as repeated zeros or rational factors. Use the displayed series for local numerical exploration, checking algebra, and studying derivative contributions. For exact symbolic notation, convergence questions, or a rigorously bounded approximation, supplement this tool with the relevant analytic work for the entered function.
Taylor Series Terms Arcade
This optional Taylor series game turns the construction of a local polynomial into a sequence: catch derivative terms in order and avoid the remainder token. It is a visual reminder that each added Taylor term comes from the next derivative at the expansion point.
Catch order 0 first, then order 1, order 2, and so on. Missing the sequence resets the local approximation.
