Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Taylor Series Calculator

Enter a function, a center and an order to build its Taylor polynomial, with every derivative evaluated at the center, exact coefficients and, if you give an x-value, the approximation compared with the true value.

0 gives a Maclaurin polynomial. Values like pi/4 are fine.

Whole number from 0 to 12.

Examples

About the Taylor Series Calculator

A Taylor polynomial replaces a complicated function with a simple polynomial that matches it closely near a chosen point. Calculators use the idea to evaluate sin⁡x\sin x and exe^x, physicists use it whenever they say "for small angles, sin⁡θ≈θ\sin\theta \approx \theta", and engineers use it to linearise systems that would otherwise be impossible to analyse. It is one of the most practical ideas in all of calculus.

This calculator builds the polynomial exactly as the formula prescribes. It differentiates your function repeatedly with the symbolic derivative engine, evaluates each derivative at the center, divides by the matching factorial and assembles the terms. Coefficients are kept exact whenever they are rational or simple multiples of constants like 2\sqrt2, π\pi or ee, so you see x36\frac{x^3}{6} rather than 0.1666667x30.1666667x^3.

Give an x-value and the calculator also evaluates the polynomial there, compares it with the actual function value and reports the error, so you can see how good the approximation is. The polynomial is verified by checking that its error shrinks at the rate Taylor's theorem predicts, and functions that cannot be expanded at the chosen center are refused with an explanation.

What is a Taylor series?

The Taylor series of a function ff about a point x=ax = a is the infinite sum ∑k=0∞f(k)(a)k!(x−a)k\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}(x - a)^k. Each term is built from one derivative of ff at the single point aa. When a=0a = 0 the series is usually called a Maclaurin series, after Colin Maclaurin, who used this special case extensively.

Stopping the sum after the (x−a)n(x - a)^n term gives the Taylor polynomial of order nn, written Tn(x)T_n(x). It is the unique polynomial of degree at most nn whose value and first nn derivatives at aa agree with those of ff. Matching more derivatives means matching the shape of the curve more closely, which is why higher orders generally give better approximations near the center.

For many functions the full series equals the function on an interval around aa. The series for exe^x, sin⁡x\sin x and cos⁡x\cos x converge for every real xx; the series for ln⁡x\ln x about 1 converges only for 0<x≤20 < x \le 2. Outside that interval the polynomial still exists, but adding more terms no longer helps, and the approximation can get dramatically worse instead of better. Knowing where a series converges is therefore just as important as knowing its coefficients.

How to use the Taylor Series Calculator

  1. Type the function of x, for example e^x, sin(x), log(x) for the natural logarithm or sqrt(x).
  2. Enter the center a. Use 0 for a Maclaurin polynomial; values such as 1, 4 or pi/4 also work.
  3. Choose the order n, a whole number from 0 to 12.
  4. Optionally enter an x-value to compare the polynomial's approximation with the true value.
  5. Press Find Taylor polynomial to see the derivative table, the coefficients and the finished polynomial.

Formulas

Taylor polynomial of order n

Tn(x)=∑k=0nf(k)(a)k! (x−a)kT_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}\,(x-a)^k

Lagrange remainder

Rn(x)=f(n+1)(c)(n+1)! (x−a)n+1 for some c between a and xR_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}\,(x-a)^{n+1}\ \text{for some } c \text{ between } a \text{ and } x

Exponential

ex=1+x+x22!+x33!+⋯e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots

Sine and cosine

sin⁡x=x−x33!+x55!−⋯ ,cos⁡x=1−x22!+x44!−⋯\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots,\quad \cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots

Geometric series

11−x=1+x+x2+x3+⋯ ,∣x∣<1\frac{1}{1-x} = 1 + x + x^2 + x^3 + \cdots,\quad |x| < 1

Worked example: eˣ about 0, order 4, at x = 1

The worked example below is computed live for exe^x about a=0a = 0 with order 4, approximated at x=1x = 1. Every derivative of exe^x is exe^x, and e0=1e^0 = 1, so the coefficients are simply 1k!\frac{1}{k!}. The polynomial is T4(x)=1+x+x22+x36+x424T_4(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24}.

At x=1x = 1 this gives T4(1)≈2.708333333T_4(1) \approx 2.708333333, while the true value is e≈2.718281828e \approx 2.718281828, an error of about 0.00995. The next term, 1120\frac{1}{120}, is roughly 0.0083, which shows why the error is that size: what is left over is dominated by the first term you left out.

The solution below is generated by the same engine that powers the calculator above.

Final answer

T4(x)=1+x+x22+x36+x424T_{4}(x) = 1+ x+\frac{{x}^{2}}{2}+\frac{{x}^{3}}{6}+\frac{{x}^{4}}{24}

How we read your problem

Find the Taylor polynomial of order 4 for f(x) = e^x centred at x = 0.

f(x)=ex, a=0, n=4f(x) = {e}^{x},\ a = 0,\ n = 4

Step-by-step solution

  1. Taylor polynomial of order 4 about x = 0 (a Maclaurin polynomial)

    T4(x)=∑k=04f(k)(0)k!(x−0)kT_{4}(x) = \sum_{k=0}^{4} \frac{f^{(k)}(0)}{k!}(x - 0)^k
  2. Differentiate and evaluate at the center

    f(0)(x)=ex⇒f(0)(0)=1f(1)(x)=ex⇒f(1)(0)=1f(2)(x)=ex⇒f(2)(0)=1f^{(0)}(x) = {e}^{x} \Rightarrow f^{(0)}(0) = 1 \\ f^{(1)}(x) = {e}^{x} \Rightarrow f^{(1)}(0) = 1 \\ f^{(2)}(x) = {e}^{x} \Rightarrow f^{(2)}(0) = 1
  3. Continue differentiating

    f(3)(x)=ex⇒f(3)(0)=1f(4)(x)=ex⇒f(4)(0)=1f^{(3)}(x) = {e}^{x} \Rightarrow f^{(3)}(0) = 1 \\ f^{(4)}(x) = {e}^{x} \Rightarrow f^{(4)}(0) = 1
  4. Divide each value by k! and assemble the polynomial

    T4(x)=1+x+x22+x36+x424T_{4}(x) = 1+ x+\frac{{x}^{2}}{2}+\frac{{x}^{3}}{6}+\frac{{x}^{4}}{24}
  5. Approximate f(1) with the polynomial

    T4(1)≈2.708333333,f(1)≈2.718281828,∣error∣≈0.00995T_{4}(1) \approx 2.708333333,\quad f(1) \approx 2.718281828,\quad |\text{error}| \approx 0.00995

Formulas used

  • Taylor polynomial

    Tn(x)=∑k=0nf(k)(a)k!(x−a)kT_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k

Each coefficient is the k-th derivative at the center divided by k!, so the polynomial matches f and its first 4 derivatives at x = 0. Near the center it approximates f with an error of order (x − a)^5.

Verification

  • Checked: the error f(a + h) − Tₙ(a + h) shrinks like h^5 (h = 0.1 → 8.47e-8, h = 0.05 → 2.63e-9).

Detailed explanation

Where the coefficients come from

Suppose a polynomial c0+c1(x−a)+c2(x−a)2+⋯c_0 + c_1(x - a) + c_2(x - a)^2 + \cdots is to match ff at aa. Setting x=ax = a kills every term except c0c_0, so c0=f(a)c_0 = f(a). Differentiating once and setting x=ax = a leaves c1=f′(a)c_1 = f'(a). Differentiating twice leaves 2c2=f′′(a)2c_2 = f''(a), and in general k! ck=f(k)(a)k!\,c_k = f^{(k)}(a).

That is the whole derivation, and it explains the factorials: they undo the constants that pile up when (x−a)k(x - a)^k is differentiated kk times. The calculator displays this as a table of f(k)(a)f^{(k)}(a) and f(k)(a)k!\frac{f^{(k)}(a)}{k!} for each kk, which is the same table you would build by hand.

Patterns in the standard series

For sin⁡x\sin x about 0 the derivatives cycle through sin⁡,cos⁡,−sin⁡,−cos⁡\sin, \cos, -\sin, -\cos, which at 0 take the values 0,1,0,−10, 1, 0, -1. Every even-power coefficient is zero, and the order-7 polynomial is x−x36+x5120−x75040x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040}. Cosine gives the even powers instead: to order 4 it is 1−x22+x4241 - \frac{x^2}{2} + \frac{x^4}{24}.

For ln⁡x\ln x about 1 the kkth derivative is (−1)k+1(k−1)!/xk(-1)^{k+1}(k-1)!/x^k, so the coefficients are ±1k\pm\frac1k and the series is (x−1)−(x−1)22+(x−1)33−⋯(x - 1) - \frac{(x-1)^2}{2} + \frac{(x-1)^3}{3} - \cdots. Recognising these patterns lets you write down many series without computing derivatives at all, and substitute into them, for example replacing xx with −x2-x^2 in the series for exe^x.

How accurate is the approximation?

Taylor's theorem bounds the error. The remainder Rn(x)=f(x)−Tn(x)R_n(x) = f(x) - T_n(x) equals f(n+1)(c)(n+1)!(x−a)n+1\frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1} for some cc between aa and xx. Two things make it small: being close to the center, so (x−a)n+1(x - a)^{n+1} is tiny, and the factorial in the denominator, which eventually beats any power.

The square root example shows the first effect. The order-3 polynomial for x\sqrt{x} about 4 is 2+x−44−(x−4)264+(x−4)35122 + \frac{x-4}{4} - \frac{(x-4)^2}{64} + \frac{(x-4)^3}{512}. At x=4.1x = 4.1 it gives about 2.024845703 against the true 2.024845673, an error near 3×10−83\times10^{-8}, because 0.140.1^4 is already very small.

Far from the center the picture changes. For 11−x\frac{1}{1-x}, the polynomials match well at x=0.1x = 0.1 but are useless at x=2x = 2, because the series only converges for ∣x∣<1|x| < 1. At x=2x = 2 the order-5 polynomial gives 63 while the function equals −1-1, an error of 64 that grows with every extra term. The calculator's error report makes this visible: try the same function and order at a near point and a far point and compare.

Choosing the center

Pick a center where the function and its derivatives are easy to evaluate and that lies close to where you need the approximation. Expanding x\sqrt{x} about 4 is natural because 4=2\sqrt4 = 2 exactly. Expanding ln⁡x\ln x about 0 is impossible because the function is undefined there, and expanding ∣x∣|x| about 0 fails because it has no derivative at that point; the calculator explains such cases instead of producing a meaningless polynomial.

Taylor polynomials in practice

The small-angle approximation sin⁡θ≈θ\sin\theta \approx \theta is simply the order-1 Maclaurin polynomial of sine, and it is accurate to better than 1% for angles below about 14 degrees. A pendulum's period formula, the paraxial approximation in optics and the linear spring law all come from keeping only the first one or two terms of a Taylor expansion.

Taylor polynomials also turn hard problems into easy ones. A limit such as 1−cos⁡xx2\frac{1 - \cos x}{x^2} becomes obvious once cos⁡x\cos x is replaced by 1−x22+⋯1 - \frac{x^2}{2} + \cdots, and an integral with no elementary antiderivative, like ∫01e−x2 dx\int_0^1 e^{-x^2}\,dx, can be approximated by integrating a polynomial term by term.

Common mistakes

  • Forgetting to divide each derivative by k!k!.
  • Writing powers of xx instead of (x−a)(x - a) when the center is not zero.
  • Evaluating derivatives at xx instead of at the center aa.
  • Assuming more terms always improve the approximation, even outside the interval of convergence.
  • Confusing order with the number of nonzero terms; sin⁡x\sin x to order 7 has only four terms.
  • Using degrees in trigonometric series, which are valid only for angles in radians.

Tips

  • Choose the center close to the x-values you care about.
  • Memorise the series for exe^x, sin⁡x\sin x, cos⁡x\cos x and 11−x\frac{1}{1-x}; many others follow by substitution.
  • Estimate the error with the first omitted term when the series alternates.
  • Check Tn(a)=f(a)T_n(a) = f(a) as a quick sanity test of your polynomial.
  • Use order 1 to get the tangent line, the simplest linear approximation.
  • Compare two orders at the same x-value; if the answers barely change, the approximation has settled.
  • Graph the function and its polynomial together to see exactly where the match starts to fail.

Frequently asked questions

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

A Maclaurin series is a Taylor series centred at 0. Enter a = 0 for a Maclaurin polynomial; any other center gives a general Taylor polynomial in powers of (x − a).

What order should I choose?

Use the order your problem asks for. Otherwise, low orders such as 2 to 4 show the idea, and higher orders give better accuracy close to the center. The calculator allows orders from 0 to 12.

Why are some powers missing from my polynomial?

Their coefficients are zero. Odd functions such as sin x have only odd powers about 0, and even functions such as cos x have only even powers. Zero terms are left out of the final polynomial.

How do I enter the natural logarithm?

Type log(x); the calculator reads log as the natural logarithm ln. Remember that ln x cannot be expanded about 0, so use a center such as a = 1.

What does the error value tell me?

It is the difference between the true function value and the polynomial's value at your chosen x. Small errors mean the polynomial is a good stand-in for the function there.

Why does the calculator refuse to expand some functions?

A Taylor polynomial needs the function and its derivatives to exist at the center. If one of them is undefined, as for |x| or √x at 0, the calculator reports which derivative fails and suggests choosing another center.

Can the center be an irrational number like π/4?

Yes. Enter pi/4 or similar. Coefficients are shown exactly when they match simple multiples of constants such as √2, and otherwise as decimals marked with ≈.

Is the order-1 Taylor polynomial the tangent line?

Yes. T₁(x) = f(a) + f′(a)(x − a) is exactly the tangent line at x = a, also called the linear approximation or linearisation of f.

How is a Taylor polynomial different from a Taylor series?

A Taylor polynomial stops after a finite number of terms and is an approximation. A Taylor series continues forever and, inside its interval of convergence, equals the function exactly. This calculator builds the polynomial of the order you choose.

Build your Taylor polynomial

Enter a function, a center and an order above to get every derivative, the exact coefficients and the approximation error.

More math calculators