Taylor Series Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Series & Limits#19

Taylor Polynomial Generator

Degree-\(n\) Taylor/Maclaurin polynomial centered at \(a\), with error check.

The Taylor series calculator builds the degree-( n ) Taylor polynomial of a function around any center ( x = a ). With ( a = 0 ) it works as a Maclaurin series calculator. Next, it plugs in a test value so you can see how close the polynomial comes to the real function.

It suits students writing out series by hand, and anyone who wants a quick polynomial approximation of ( ln ), ( sqrt{ } ), trig or exponential functions. Also, it is free and needs no account.

Taylor Series Calculator: The degree-2 Taylor polynomial 1 + x + x²/2 (dashed) matches y = eˣ closely near x = 0 and drifts…
The degree-2 Taylor polynomial 1 + x + x²/2 (dashed) matches y = eˣ closely near x = 0 and drifts away further out.

How to use the Taylor series calculator

  1. Type ( f(x) ). Use ^ for powers, and sqrt(), sin(), cos(), ln(), e^(x) and pi for functions. Implicit multiplication like x e^x works.
  2. Enter the center ( a ). Use 0 for a Maclaurin polynomial. The function must be defined at ( a ), so choose ( a = 1 ) for ln(x), for example.
  3. Choose the degree ( n ), from 0 to 10.
  4. Enter a test value of ( x ) and press Generate series. You get the polynomial ( P_n(x) ), the values ( P_n ) and ( f ) at the test point, and the absolute error between them.

Formula

The Taylor polynomial of degree ( n ) centered at ( a ) is

$$P_n(x) = sum_{k=0}^{n} frac{f^{(k)}(a)}{k!},(x-a)^k$$

That sum is ( f(a) + f'(a)(x-a) + frac{f”(a)}{2!}(x-a)^2 + cdots ). The calculator differentiates ( f ) symbolically ( n ) times, evaluates each derivative at ( a ), and divides by ( k! ). Coefficients that are simple fractions are shown exactly. The full Taylor series is the limit as ( n to infty ). This tool gives you the polynomial up to degree 10, which is what most homework and approximation problems ask for.

Worked example

Example 1: a Maclaurin polynomial. Find the degree-4 Maclaurin polynomial of ( f(x) = ln(1+x) ) and use it to estimate ( ln 1.2 ).

A close-up of a Casio calculator with a zero on its display.

Differentiate and evaluate at 0:

( k ) ( f^{(k)}(x) ) ( f^{(k)}(0) ) ( f^{(k)}(0)/k! )
0 ( ln(1+x) ) 0 0
1 ( (1+x)^{-1} ) 1 1
2 ( -(1+x)^{-2} ) ( -1 ) ( -tfrac12 )
3 ( 2(1+x)^{-3} ) 2 ( tfrac13 )
4 ( -6(1+x)^{-4} ) ( -6 ) ( -tfrac14 )

So

$$P_4(x) = x - frac{x^2}{2} + frac{x^3}{3} - frac{x^4}{4}.$$

At ( x = 0.2 ), ( P_4(0.2) = 0.2 – 0.02 + 0.0026667 – 0.0004 approx 0.1822667 ). The true value is ( ln 1.2 approx 0.1823216 ). This shows an error of about ( 5.49times10^{-5} ). For example, this is the example preloaded above in the taylor series calculator.

Because the terms alternate in sign and shrink, the error is at most the next term, ( frac{0.2^5}{5} = 0.000064 ), and the actual error is just under that.

Example 2: a center other than 0. Approximate ( sqrt{4.2} ) with a degree-2 Taylor polynomial at ( a = 4 ).

Here ( f(4) = 2 ), ( f'(x) = frac{1}{2sqrt x} ) so ( f'(4) = frac14 ), and ( f”(x) = -frac{1}{4x^{3/2}} ) so ( f”(4) = -frac1{32} ). Dividing by ( 2! ) gives

$$P_2(x) = 2 + frac{x-4}{4} - frac{(x-4)^2}{64}.$$

Then ( P_2(4.2) = 2 + 0.05 – 0.000625 = 2.049375 ), against ( sqrt{4.2} approx 2.0493902 ), an error of about ( 1.5times10^{-5} ). In the calculator, enter sqrt(x), center 4, degree 2 and test value 4.2.

Getting a good approximation

  • Center near the test point. The error grows with ( |x – a| ). Estimating ( sqrt{4.2} ) around ( a = 4 ) works far better than around ( a = 1 ).
  • Higher degree helps only inside the interval of convergence. The series for ( ln(1+x) ) converges only for ( -1 < x le 1 ). For example, at ( x = 2 ), ( P_4(2) = -frac43 ), nowhere near ( ln 3 approx 1.0986 ). Raising the degree makes it worse. The ratio test is how you find that interval; the series convergence calculator runs a numerical version.
  • Degree 1 is the tangent line. ( P_1 ) is exactly the linear approximation of ( f ) at ( a ), which the linear approximation calculator also computes.
  • Watch the error row. If the error barely changes as you raise ( n ), check that the test point is inside the interval of convergence.

For the derivations of the standard series for ( e^x ), ( sin x ) and ( cos x ), see the guide to Taylor and Maclaurin series.

A magnifying glass examining a document with small symbols on it.

Common Maclaurin series

FunctionSeriesValid for
\( e^x \)\( 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots \)all \( x \)
\( \sin x \)\( x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots \)all \( x \)
\( \cos x \)\( 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots \)all \( x \)
\( \ln(1 + x) \)\( x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \)\( -1 < x \le 1 \)
\( \frac{1}{1 - x} \)\( 1 + x + x^2 + x^3 + \cdots \)\(x< 1 \)

How accurate is it? The remainder

The Lagrange remainder bounds the error of a degree-\( n \) Taylor polynomial:

$$|R_n(x)| \le \frac{M}{(n + 1)!}|x - a|^{n+1}$$

where \( M \) bounds the next derivative. For \( e^{0.5} \) with \( 1 + x + \frac{x^2}{2} = 1.625 \), the error is at most \( e^{0.5} \times \frac{0.5^3}{6} \approx 0.034 \); the true value is 1.6487, so the actual error is 0.024.

Practice problems

  1. Write the first three non-zero terms of the Maclaurin series of \( e^{2x} \).
  2. Use two terms of the sine series to estimate \( \sin 0.2 \).

Answers: 1. \( 1 + 2x + 2x^2 \). 2. \( 0.2 - \frac{0.008}{6} \approx 0.198667 \) (true value 0.198669).

Interpreting the Calculator's Output

After generating your series, the calculator displays several key pieces of information. First, you see the Taylor polynomial P_n(x). This is the algebraic expression that approximates your function.

Next, the taylor series calculator shows P_n’s value at your chosen test point. This number is your approximation. Then, it gives the true value of the original function f(x) at that same test point.

Finally, you will find the absolute error. This is the difference between the true function value and your polynomial approximation. A smaller error means a better fit. You want this number very close to zero for good accuracy, which a taylor series calculator can help achieve.

When Other Methods Are Better

Taylor series are excellent for approximating functions near a specific point. However, they are not always the best tool. If you need a function's value with high precision across a wide range, direct computation is usually better.

For example, if your calculator can directly compute sin(0.5), there is no need to use a Taylor polynomial. Similarly, numerical methods for integration or differentiation might be more suitable for complex scenarios. These methods handle broad intervals more effectively than a single Taylor expansion.

Related guides

Further reading

FAQ

What is the difference between a Taylor and a Maclaurin series?

A Maclaurin series is a Taylor series centered at ( a = 0 ). Set the center to 0 in the calculator to get the Maclaurin polynomial.

What degree can the calculator handle?

Any degree from 0 to 10. That covers typical textbook problems. For higher orders, however, look for the pattern in the coefficients and write the general term.

Why does the calculator give an error at my center?

The function or its derivative is undefined at (a). For example, (ln x) and (sqrt{x}) have no Taylor polynomial at 0. Choose a center inside the domain. For instance, (a = 1) for a Taylor series calculator.

How accurate is a Taylor polynomial?

It depends on the degree and on the distance from the center. The calculator shows the actual error at your test point. For alternating series, the next unused term bounds it.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators