Taylor Series Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Curves approximating a smooth function near a shared expansion point.
Higher-order Taylor polynomials usually track the original function best near the expansion point and drift farther away from it.

What this Taylor series calculator does

A Taylor series rewrites a smooth function near a chosen point as a polynomial built from the function's derivatives at that point. The calculator below asks for a function of x, an expansion point a, and a maximum order n. It then differentiates symbolically, evaluates each derivative at a, divides by the appropriate factorial, and assembles the Taylor polynomial through order n.

When the expansion point is a = 0, the result is often called a Maclaurin polynomial. Maclaurin series are common for functions such as sin(x), cos(x), exp(x), and log(1+x). Expansions around another point are just as useful when you care about a local neighborhood that is not centered at zero, for example approximating sqrt(x) near x = 4.

The result is a local approximation, not a promise of global accuracy. A fifth-order polynomial may be excellent near the expansion point and poor far away. The best way to use the output is to inspect the order, compare a few nearby values in a separate graphing tool or CAS, and increase the order gradually only when the function is smooth at the expansion point.

Formula and method

The Taylor polynomial of order n for a function f around a is:

Pn(x)= k=0n f(k)(a)k! (x-a)k

The calculator follows that formula directly. The zero-order term is just f(a). The first-order term uses the slope f'(a). The second-order term uses curvature through f''(a) / 2!, and each later term adds another derivative divided by another factorial. Terms whose coefficient rounds to zero are omitted from the displayed polynomial to keep the result readable.

How to use it

  1. Enter a math.js-compatible function using x as the variable, such as sin(x), exp(x), log(1+x), or sqrt(x).
  2. Choose the expansion point a. Use 0 for a Maclaurin polynomial.
  3. Choose an integer order from 0 to 15. Start low, then raise the order after checking that the function and derivatives are defined at a.
  4. Read the polynomial and coefficient breakdown. Copy the result if you want to paste it into notes, a graphing calculator, or a CAS.

Some functions have domain restrictions. For example, log(x) is undefined at zero, and sqrt(x) has derivative issues at zero. If a function cannot be evaluated or differentiated at the chosen point, use a different expansion point or simplify the expression.

Worked example

For sin(x) around a = 0, the nonzero derivatives alternate between 1 and -1. Through order 5, the Maclaurin polynomial is:

sin(x) ≈ x - 0.166667 x^3 + 0.00833333 x^5

This approximation is very good near zero. It is useful in physics and engineering whenever angles are small, because the first term says sin(x) ≈ x for radians close to zero. The cubic and fifth-order terms show how the approximation bends back toward the true sine curve as the angle grows.

Assumptions and limitations

This page uses symbolic derivatives from math.js, so it works best with elementary expressions that math.js can parse and differentiate. Piecewise functions, absolute values at nondifferentiable points, discontinuities, branch cuts, and functions outside the parser's vocabulary can fail or produce coefficients that are not useful for your goal. The displayed polynomial is rounded for readability, so do not treat it as exact proof notation.

A Taylor polynomial is strongest near the expansion point. Accuracy depends on smoothness, convergence radius, the order you choose, and how far the evaluation point is from a. For rigorous error bounds, use the Lagrange remainder or another theorem suited to the function. For routine learning and sanity checks, compare orders side by side and watch whether the polynomial stabilizes over the interval you care about.

Enter a function recognizable by math.js, choose an expansion point, and set the series order from 0 to 15.

Enter a function, point, and order.

Series Terms Arcade

Catch coefficient terms in order near the expansion point and dodge far-field error tokens. The game is optional, but it mirrors the idea that Taylor polynomials are built one derivative term at a time.

Build the local polynomial

Move with touch, pointer, or arrow keys. Catch the next derivative term and avoid error tokens that are far from the expansion point.

0Score
40sTime
0Next order
0Streak

Catch order 0 first, then order 1, order 2, and so on. Missing the sequence resets the local approximation.