TOPIC

Taylor series and Maclaurin series

MY PROGRESS

Pug Score

0%

Best Streak

0 in a row

Study Points

+0

Overview

Practice

Watch

Read

Quiz

Next Steps


Get Started

Get unlimited access to all videos, practice problems, and study tools.

Unlimited practice
Full videos

Back to Menu

Topic Progress

Pug Score

0%

Videos Watched

0/0

Best Practice

No score

Read

Not viewed

Best Quiz

No attempts


Best Streak

0 in a row

Study Points

+0

Read

Taylor and Maclaurin Series

An introduction to Taylor and Maclaurin series: the formula for expanding a function into an infinite power series around a point, the special Maclaurin case at zero, common series to memorize, worked examples, and how to check where the series actually converges.

What Is a Taylor Series?

A Taylor series takes a function \(f(x)\) that is infinitely differentiable near a point \(a\) and rewrites it as an infinite sum of powers of \((x-a)\). Instead of working with \(\sin x\), \(e^x\), or \(\ln x\) directly, you work with a polynomial-like expression built entirely from the function's derivatives at a single point. This is useful because polynomials are easy to differentiate, integrate, and evaluate by hand or by calculator, so a Taylor series turns a hard function into an infinite "polynomial" that behaves the same way near \(a\).

Each partial sum of a Taylor series (stopping after a finite number of terms) is called a Taylor polynomial, and it gives an approximation to \(f(x)\) that gets better the closer \(x\) is to \(a\), and generally better as you include more terms.

The Taylor Series Formula

The Taylor series of \(f(x)\) centered at \(x = a\) is:

\( f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f'''(a)}{3!}(x-a)^3 + \cdots \)

Here \(f^{(n)}(a)\) means the \(n\)-th derivative of \(f\) evaluated at \(x = a\), and \(n!\) is \(n\) factorial. To build a Taylor series, you need to differentiate \(f\) over and over, plug in \(x = a\) each time, and drop the results into this formula.

Maclaurin Series: The Special Case Where a Equals Zero

A Maclaurin series is simply a Taylor series centered at \(a = 0\):

\( f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n = f(0) + f'(0)x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!}x^3 + \cdots \)

Because \(a = 0\), every derivative is evaluated at the origin, which usually makes the arithmetic simpler. Most of the "famous" series you memorize in calculus, such as the expansions of \(e^x\), \(\sin x\), and \(\cos x\), are Maclaurin series.

Common Maclaurin Series You Should Know

These four expansions come up constantly and are worth memorizing:

FunctionMaclaurin series
\(e^x\)\(\sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots\)
\(\sin x\)\(\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\)
\(\cos x\)\(\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots\)
\(\frac{1}{1-x}\)\(\sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \cdots\), valid for \(|x|<1\)

That last one is exactly the geometric series in power-series form, so everything you know about geometric series convergence tells you when this Maclaurin series is actually valid.

Worked Example: Maclaurin Series for sin x

Find the Maclaurin series for \(f(x) = \sin x\) by computing derivatives at \(x = 0\).

\(f(x) = \sin x\), so \(f(0) = 0\).

\(f'(x) = \cos x\), so \(f'(0) = 1\).

\(f''(x) = -\sin x\), so \(f''(0) = 0\).

\(f'''(x) = -\cos x\), so \(f'''(0) = -1\).

\(f^{(4)}(x) = \sin x\), so \(f^{(4)}(0) = 0\), and the pattern \(0, 1, 0, -1\) repeats forever. Plugging these into the Maclaurin formula:

\( \sin x = 0 + 1\cdot x + \frac{0}{2!}x^2 + \frac{-1}{3!}x^3 + \frac{0}{4!}x^4 + \frac{1}{5!}x^5 - \cdots = x - \frac{x^3}{6} + \frac{x^5}{120} - \cdots \)

The graph below shows \(\sin x\) itself, followed by the fifth-degree Taylor polynomial \(x - \frac{x^3}{6} + \frac{x^5}{120}\) built from just the first three nonzero terms. Notice how closely the polynomial tracks the curve near \(x = 0\), and how the two graphs start to separate as \(x\) moves further away from the center.

Graph of f of x equals sine of x Plot of y = sin(x) for x in [-6.28, 6.28] -6 -4 -2 0 2 4 6 -1 -0.5 0 0.5 1 x f(x) center a = 0
The function \(f(x) = \sin x\).
Graph of the fifth degree Maclaurin polynomial approximating sine of x Plot of y = x - x**3/6 + x**5/120 for x in [-6.28, 6.28] -6 -4 -2 0 2 4 6 -40 -20 0 20 40 x P5(x) center a = 0
The fifth-degree Maclaurin polynomial \(x - \frac{x^3}{6} + \frac{x^5}{120}\) approximating \(\sin x\).

Worked Example: Taylor Series for ln x Centered at a = 1

Since \(\ln x\) is undefined at \(x = 0\), a Maclaurin series will not work here, so instead build a Taylor series centered at \(a = 1\), a point where the function and its derivatives are defined.

\(f(x) = \ln x\), so \(f(1) = 0\).

\(f'(x) = \frac{1}{x}\), so \(f'(1) = 1\).

\(f''(x) = -\frac{1}{x^2}\), so \(f''(1) = -1\).

\(f'''(x) = \frac{2}{x^3}\), so \(f'''(1) = 2\).

Substituting into the Taylor formula with \(a = 1\):

\( \ln x = 0 + 1(x-1) + \frac{-1}{2!}(x-1)^2 + \frac{2}{3!}(x-1)^3 - \cdots = (x-1) - \frac{(x-1)^2}{2} + \frac{(x-1)^3}{3} - \cdots \)

Convergence and Approximation Error

A Taylor series is only as useful as the interval on which it actually converges to \(f(x)\). Every power series has a radius of convergence, found using the ratio test on the general term, and the series may converge, diverge, or need separate checking at the two endpoints of that interval.

When a Maclaurin or Taylor series happens to alternate in sign, term by term, as \(\sin x\) and \(\ln x\) do above, the alternating series test conditions also give you a quick bound on how far a truncated Taylor polynomial can be from the true value of the function: the error is no larger than the size of the first omitted term. That bound is what tells you, in the sin x example, exactly how many terms you need to guarantee a given level of accuracy at a particular value of \(x\).

Related lessons