A Taylor series approximates a smooth function near a chosen point aa with a polynomial that matches the function's derivatives at that point. The more terms you keep, the more derivatives the polynomial agrees with, and the tighter the fit becomes around aa.

Explorer

Use the controls to choose a function, move the expansion point, and increase the number of terms. The graph compares the exact function to the Taylor polynomial, and the error plot shows where the approximation starts to drift.

f(x) = e^x
Maclaurin series is the special case a = 0.
Converges for every real x.
a = 0window: -3 to 3
Black: exact functionBlue: Taylor polynomialDashed: expansion point
Approximation error: polynomial minus exact value
mean absolute error: 0.8563max absolute error: 7.0855
Current polynomial
T3(x) = 1 + x + 0.5x^2 + 0.1667x^3

Formula

For a function ff, the first NN terms of the Taylor expansion about aa are:

f(x)n=0N1f(n)(a)n!(xa)nf(x) \approx \sum_{n=0}^{N-1} \frac{f^{(n)}(a)}{n!}(x-a)^n

When a=0a = 0, this is called a Maclaurin series.

Worked Example: Expanding exe^x to Third Order

Let us build the Maclaurin polynomial for f(x)=exf(x) = e^x by hand. The exponential function is special because every derivative is itself: f(x)=exf'(x) = e^x, f(x)=exf''(x) = e^x, f(x)=exf'''(x) = e^x, and so on. Evaluating at a=0a = 0 gives

f(0)=f(0)=f(0)=f(0)=e0=1.f(0) = f'(0) = f''(0) = f'''(0) = e^0 = 1.

Now plug these into the formula, dividing each by the matching factorial:

ex10!x0+11!x1+12!x2+13!x3=1+x+x22+x36.e^x \approx \frac{1}{0!}x^0 + \frac{1}{1!}x^1 + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}.

To test it, estimate e0.5e^{0.5}. Substituting x=0.5x = 0.5:

1+0.5+0.252+0.1256=1+0.5+0.125+0.0208=1.6458.1 + 0.5 + \frac{0.25}{2} + \frac{0.125}{6} = 1 + 0.5 + 0.125 + 0.0208 = 1.6458.

The true value is e0.51.6487e^{0.5} \approx 1.6487, so three terms past the constant already land within 0.0020.002. Notice how the contribution of each term shrinks: the factorial in the denominator grows faster than the power xnx^n, which is exactly why the series settles down.

The same recipe works for sin(x)\sin(x). Its derivatives cycle through cosx,sinx,cosx,sinx\cos x, -\sin x, -\cos x, \sin x, which at a=0a = 0 give 0,1,0,10, 1, 0, -1. Only the odd-power terms survive, producing sin(x)xx3/6\sin(x) \approx x - x^3/6 to third order.

Radius of Convergence

A finite polynomial only ever approximates ff, but the full infinite series may equal ff exactly on some interval. The radius of convergence RR is the largest distance from aa over which the series converges. For xa<R|x - a| < R the series adds up to the function; for xa>R|x - a| > R it diverges no matter how many terms you take.

You can often find RR with the ratio test. For a power series cn(xa)n\sum c_n (x-a)^n,

1R=limncn+1cn.\frac{1}{R} = \lim_{n \to \infty} \left| \frac{c_{n+1}}{c_n} \right|.

For exe^x the coefficients are cn=1/n!c_n = 1/n!, so the ratio cn+1/cn=1/(n+1)0|c_{n+1}/c_n| = 1/(n+1) \to 0, giving R=R = \infty. The exponential series converges everywhere, which matches the worked example above. The same is true for sinx\sin x and cosx\cos x.

Other functions are not so lucky. The geometric-style series for ln(1+x)=xx2/2+x3/3\ln(1+x) = x - x^2/2 + x^3/3 - \cdots has R=1R = 1, because ln(1+x)\ln(1+x) misbehaves at x=1x = -1. Even though ln(1+x)\ln(1+x) looks perfectly smooth for large xx, the nearby singularity caps the radius at 11. This is why the error plot in the explorer can blow up past a certain distance even when the function itself is well behaved there.

Common Maclaurin Series

Function First terms Radius RR
exe^x 1+x+x2/2!+x3/3!+1 + x + x^2/2! + x^3/3! + \cdots \infty
sin(x)\sin(x) xx3/3!+x5/5!x - x^3/3! + x^5/5! - \cdots \infty
cos(x)\cos(x) 1x2/2!+x4/4!1 - x^2/2! + x^4/4! - \cdots \infty
ln(1+x)\ln(1 + x) xx2/2+x3/3x - x^2/2 + x^3/3 - \cdots 11

Taylor series convert hard functions into polynomials you can differentiate, integrate, and compute term by term. Try the explorer above: switch functions, drag the expansion point, and watch where the error stays small versus where the radius of convergence wins.

Frequently Asked Questions

What is a Taylor series?
A Taylor series approximates a smooth function near a chosen point with a polynomial that matches the function's derivatives at that point. Each term uses a derivative value divided by a factorial, multiplied by a power of the distance from the expansion point. It turns complicated functions into polynomials that are easier to analyze, differentiate, and compute.
What is the difference between a Taylor series and a Maclaurin series?
A Maclaurin series is simply a Taylor series whose expansion point is zero. The general Taylor expansion can be centered at any point a, while the Maclaurin form is the special case a equals 0. Common Maclaurin series include those for the exponential function, sine, cosine, and the natural log of 1 plus x.
Does adding more terms to a Taylor polynomial always make it more accurate?
Adding terms usually improves the local fit near the expansion point, and the polynomial is typically most accurate near that point. However, some functions have a limited radius of convergence because of nearby singularities, so the approximation can still drift or fail far from the expansion point no matter how many terms you add.
Where is a Taylor polynomial most accurate?
A Taylor polynomial is usually most accurate near the expansion point, where it is built to match the function's derivatives. As you move away from that point, the error grows, which you can see on an error plot. Choosing an expansion point close to the region you care about gives a better approximation.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →