Taylor Series Calculator

Build the Maclaurin series for e to the x, sin x or cos x, choose how many terms to add and see the error against the exact value.

Math and PercentUpdated 2026-11-184 min read
Taylor Series Calculator
Use radians when the function is sin or cos.
A whole number from 1 to 30. The sum starts at the k = 0 term.
Partial sum
...
Exact value...
Absolute error...
Last term added...

What it does

A Taylor series rebuilds a function from its derivatives at one point. OpenStax Calculus Volume 2 writes the coefficient of each power as the kth derivative at the centre divided by k factorial, so the series is a sum of f to the (k)(a) times (x - a) to the k over k factorial. When the centre a is zero the series is called a Maclaurin series, and the powers are simply x to the k.

A finite piece of that sum is a polynomial, which is easy to add, multiply and evaluate. That is why these series sit inside software libraries: a few multiplications can reproduce e to the x or a sine to many decimals. Truncating the sum leaves a remainder, and watching how fast that remainder shrinks is the main reason to work through a series by hand.

This page expands three functions whose Maclaurin series converge for every real number. The exponential takes every power of x with a positive coefficient. Sine takes odd powers with signs that alternate, and cosine takes even powers with signs that alternate. The NIST Digital Library of Mathematical Functions records the sine and cosine series exactly in those forms, and MIT OpenCourseWare notes that all three converge for any x.

Choose a function, a point x and a number of terms from 1 to 30. The tool returns the partial sum to six decimals, the value of the function to six decimals, the absolute gap between them to eight decimals, and the very last term it added. That last row is useful when you want to guess what one more term would change.

The tool is a teaching aid rather than a replacement for a library routine. At large absolute x the early terms can be much bigger than the final answer and then cancel away, so a fixed 30 term budget can still leave a visible error. Keep that in mind before treating the printed sum as exact.

How to use

  1. Pick e to the x, sin x or cos x from the function list.
  2. Enter the point x where you want the estimate. For sin and cos this number is in radians.
  3. Set the number of terms. The default is 8, and the tool accepts any whole number from 1 to 30.
  4. Read the partial sum, the exact value and the absolute error in the result panel.
  5. Check the last term row to see the size of the final addend in the sum.
  6. Raise the term count one step at a time and watch how quickly the error row falls.

Formula

Taylor series centred at zero: f(x) = sum from k=0 to infinity of f to the (k)(0) x to the k / k factorial. For e to the x use sum of x to the k / k factorial. For sin x use sum of (-1) to the k x to the (2k+1) / (2k+1) factorial. For cos x use sum of (-1) to the k x to the (2k) / (2k) factorial.
x
The point where the series is evaluated. For sin and cos it is measured in radians.
k
The term index, starting at 0 and rising by one for each added term.
N
The number of terms added, a whole number from 1 to 30.
f to the (k)(0)
The kth derivative of the chosen function evaluated at zero.
k factorial
The product of the whole numbers from 1 to k, with 0 factorial equal to 1.
S sub N
The partial sum of the first N terms, shown as the approximation.

All three Maclaurin series here converge for every real x, so the choice of centre does not restrict them. The sine and cosine sums alternate in sign, which makes successive partial sums bracket the true value; the exponential sum has positive terms, so it approaches from below when x is positive. The tool stops at 30 terms. For large absolute x the individual terms grow before they shrink, and floating point cancellation can cost a little accuracy in that range.

Worked example

Example: eight terms of e to the x at x = 1

Defaults: the function e to the x, x = 1 and 8 terms. Since x is 1, every power of x is 1 and the kth term is simply 1 over k factorial.

  1. The terms from k = 0 to k = 7 are 1, 1, 1/2, 1/6, 1/24, 1/120, 1/720 and 1/5040.
  2. Add the first four: 1 + 1 = 2, then + 0.5 = 2.5, then + 0.16666667 = 2.66666667, then + 0.04166667 = 2.70833333.
  3. Add the next two: + 0.00833333 gives 2.71666667, and + 0.00138889 gives 2.71805556.
  4. Add the last term 1/5040 = 0.00019841 to reach 2.71825397, which rounds to 2.718254.
  5. The exact value of e is 2.71828183, shown by the tool as 2.718282.
  6. The absolute error is 2.71828183 - 2.71825397 = 0.00002786, reported to eight decimals.
  7. The last term added is 0.00019841, and the first omitted term 1/40320 = 0.00002480 already sets the scale of the remaining tail.

Reference table

Leading Maclaurin terms and one partial sum for each function
FunctionFirst four termsPartial sum from the tool
e to the x1 + x + x²/2! + x³/3!2.718254 at x = 1 with 8 terms
sin xx - x³/3! + x⁵/5! - x⁷/7!0.841471 at x = 1 with 6 terms
cos x1 - x²/2! + x⁴/4! - x⁶/6!-0.416147 at x = 2 with 7 terms

Limits

  • Only three functions are offered, and each is expanded about zero rather than a chosen centre a.
  • The term count stops at 30, so very large absolute x can still leave a noticeable error.
  • Angles for sin and cos must be in radians; entering degrees gives the series of a different number.
  • The exact column comes from the browser math library, so the error row measures the gap to that library value rather than to an infinite precision constant.

Common mistakes

  • Typing an angle in degrees for sin or cos; 30 degrees is 0.5236 radians, not 30.
  • Assuming that more terms always help at large absolute x, where early terms can be far larger than the final sum.
  • Treating the last term as the error. The error is the whole omitted tail, which for e to the x is a little larger than the first omitted term.
  • Forgetting that 0 factorial is 1, which would drop the constant term of e to the x and cos x.
  • Claiming full accuracy because the partial sum and exact value print the same six decimals; the error row carries the real detail.

Try it yourself

Quick checks. Answers sit tucked under each question.

Use six terms of the sine series at x = 1 radian. What sum does the tool show?

It shows 0.841471, the same six decimals as sin 1. The absolute error row reads 0.00000000 because the true gap is about 1.6e-10, and the last term added is -0.00000003.

Seven terms of the cosine series at x = 2 give what value?

The partial sum is -0.416147 and the exact value is also -0.416147 to six decimals. The absolute error is 0.00000018 and the last term added is 0.00000855.

Why does e to the x at x = 0 return 1.000000 no matter how many terms you add?

Every term after k = 0 contains x to a positive power, so those terms are all zero at x = 0. The partial sum stays 1.000000, the exact value is 1.000000 and the absolute error is 0.00000000.

Questions

What is a Taylor series?

A sum of polynomial terms built from the derivatives of a function at one point. Cutting it off after a few terms gives a polynomial that approximates the function near that point.

How is a Maclaurin series different?

There is no difference in method. A Maclaurin series is simply a Taylor series centred at zero, which is the centre used on this page.

How many terms should I use?

Start with 8 and raise the count until the error row stops changing at the precision you need. For these three functions the error falls quickly once the terms pass the size of x.

Why must sin and cos use radians?

The derivative pattern that produces x minus x cubed over 3 factorial and its relatives assumes radians. In degrees every coefficient would carry a factor of pi over 180.

Do these series converge for every x?

Yes. The Maclaurin series for e to the x, sin x and cos x all converge for every real number. Other functions can have a finite radius of convergence and need a different treatment.

What does the last term row tell me?

It is the final addend included in the partial sum. For the alternating sine and cosine series the next omitted term bounds the error; for e to the x the error is slightly larger than the first omitted term.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.