Skip to content

Taylor and Maclaurin Series

In this lesson you’ll learn how to build Taylor and Maclaurin series, which represent functions as infinite polynomials. This is one of the most powerful ideas in all of calculus.

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

f(x)=n=0f(n)(a)n!(xa)nf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x - a)^n

Each coefficient comes from the nth derivative of f evaluated at the center, divided by n factorial. The more terms you include, the better the polynomial matches the function near x = a.

A Maclaurin series is just a Taylor series centered at a = 0

f(x)=n=0f(n)(0)n!xnf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}\,x^n

These four are worth memorizing

ex=1+x+x22!+x33!+x44!+=n=0xnn!e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots = \sum_{n=0}^{\infty} \frac{x^n}{n!} sinx=xx33!+x55!x77!+=n=0(1)nx2n+1(2n+1)!\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{(2n+1)!} cosx=1x22!+x44!x66!+=n=0(1)nx2n(2n)!\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{(2n)!} 11x=1+x+x2+x3+=n=0xnfor x<1\frac{1}{1 - x} = 1 + x + x^2 + x^3 + \cdots = \sum_{n=0}^{\infty} x^n \quad \text{for } |x| \lt 1

Notice that sin x only has odd powers and cos x only has even powers. The exponential has all powers. The geometric series 1/(1 - x) is the simplest of all.

The blue curve is the actual sin(x). Each colored line is a Taylor polynomial of increasing degree. Near x = 0 they all agree, but higher-degree polynomials stay accurate over a wider range. The degree-7 polynomial (purple) tracks sin(x) closely all the way out to about x = 4.

Example 1: Maclaurin series for e to the x

All derivatives of e to the x are e to the x, so every derivative evaluated at 0 gives 1

f(0)=1,f(0)=1,f(0)=1,f(0)=1,f(0) = 1, \quad f'(0) = 1, \quad f''(0) = 1, \quad f'''(0) = 1, \quad \ldots

Plugging into the formula

ex=n=01n!xn=1+x+x22+x36+x424+e^x = \sum_{n=0}^{\infty} \frac{1}{n!}\,x^n = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24} + \cdots

This converges for all real x (radius of convergence is infinity).

Example 2: Taylor series for ln x centered at x = 1

Compute the first few derivatives at x = 1

f(x)=lnxf(1)=0f(x) = \ln x \quad \Rightarrow \quad f(1) = 0 f(x)=1xf(1)=1f'(x) = \frac{1}{x} \quad \Rightarrow \quad f'(1) = 1 f(x)=1x2f(1)=1f''(x) = -\frac{1}{x^2} \quad \Rightarrow \quad f''(1) = -1 f(x)=2x3f(1)=2f'''(x) = \frac{2}{x^3} \quad \Rightarrow \quad f'''(1) = 2 f(4)(x)=6x4f(4)(1)=6f^{(4)}(x) = -\frac{6}{x^4} \quad \Rightarrow \quad f^{(4)}(1) = -6

The pattern for the nth derivative at 1 is (-1)^(n+1) times (n - 1) factorial. Plugging into the Taylor formula

lnx=(x1)(x1)22+(x1)33(x1)44+\ln x = (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3} - \frac{(x - 1)^4}{4} + \cdots =n=1(1)n+1n(x1)n= \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}(x - 1)^n

This converges for 0 less than x less than or equal to 2 (radius R = 1 centered at 1).

The blue curve is ln(x). The Taylor polynomials all pass through (1, 0) and match ln(x) well near the center, but diverge outside the interval (0, 2]. Higher-degree polynomials hug the curve longer before peeling away.

Example 3: Building new series from known ones

Find the Maclaurin series for x times e to the x.

Start with the known series for e to the x and multiply every term by x

xex=x(1+x+x22!+x33!+)xe^x = x\left(1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots\right) =x+x2+x32!+x43!+=n=1xn(n1)!= x + x^2 + \frac{x^3}{2!} + \frac{x^4}{3!} + \cdots = \sum_{n=1}^{\infty} \frac{x^n}{(n-1)!}

You don’t need to recompute derivatives from scratch. Multiplying, substituting, differentiating, or integrating known series is often the fastest approach.

Taylor and Maclaurin series are used constantly in practice:

  • Game engines approximate sin, cos, and exp with low-degree Taylor polynomials for speed
  • Physics uses Taylor expansions to linearize complex equations near equilibrium points
  • Machine learning uses Taylor expansions to analyze loss functions and optimization landscapes
  • Signal processing represents signals as polynomial approximations for filtering and compression
  • Numerical computing uses series to evaluate special functions to arbitrary precision
A Maclaurin series is a Taylor series centered at
The coefficient of the nth term in a Taylor series is
The Maclaurin series for $\sin x$ contains only
To find the series for $xe^x$, you can
Adding more terms to a Taylor polynomial