Definition & Notation

What is a Taylor Series?

A Taylor series is a representation of a function as an infinite sum of terms calculated from the values of the function's derivatives at a single point. If the function \(f(x)\) has derivatives of all orders at \(x = a\), then the Taylor series of \(f\) centered at \(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 + \ldots\)

where \(f^{(n)}(a)\) represents the \(n\)th derivative of \(f\) evaluated at \(x = a\), and \(n!\) is the factorial of \(n\).

The Taylor series provides a way to approximate functions using polynomials. The more terms we include in the series, the better the approximation becomes (within the radius of convergence).

Important Note

Not every function equals its Taylor series, even if the Taylor series converges. A function equals its Taylor series within the radius of convergence if and only if the function is analytic.

Maclaurin Series

What is a Maclaurin Series?

A Maclaurin series is a special case of a Taylor series centered at \(a = 0\). If the function \(f(x)\) has derivatives of all orders at \(x = 0\), then the Maclaurin series of \(f\) is:

\(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 + \ldots\)

Example 1: Maclaurin Series for \(e^x\)

Find the Maclaurin series for \(f(x) = e^x\).

Solution:

We need to find the derivatives of \(f(x) = e^x\) and evaluate them at \(x = 0\):

\begin{align} f(x) &= e^x & f(0) &= e^0 = 1 \\ f'(x) &= e^x & f'(0) &= e^0 = 1 \\ f''(x) &= e^x & f''(0) &= e^0 = 1 \\ f'''(x) &= e^x & f'''(0) &= e^0 = 1 \\ \end{align}

Since all derivatives of \(e^x\) are \(e^x\), all derivatives evaluated at \(x = 0\) are 1.

Substituting into the Maclaurin series formula:

\begin{align} e^x &= \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n \\ &= \sum_{n=0}^{\infty} \frac{1}{n!}x^n \\ &= 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \ldots \end{align}

This series converges for all values of \(x\) (the radius of convergence is \(\infty\)).

Constructing Taylor Series

There are several methods to construct Taylor series for functions:

Method 1: Direct Computation

This method involves finding the derivatives of the function, evaluating them at the center point, and substituting into the Taylor series formula.

Example 2: Taylor Series for \(\sin(x)\) at \(a = 0\)

Find the Taylor series (Maclaurin series) for \(f(x) = \sin(x)\).

Solution:

We need to find the derivatives of \(f(x) = \sin(x)\) and evaluate them at \(x = 0\):

\begin{align} f(x) &= \sin(x) & f(0) &= \sin(0) = 0 \\ f'(x) &= \cos(x) & f'(0) &= \cos(0) = 1 \\ f''(x) &= -\sin(x) & f''(0) &= -\sin(0) = 0 \\ f'''(x) &= -\cos(x) & f'''(0) &= -\cos(0) = -1 \\ f^{(4)}(x) &= \sin(x) & f^{(4)}(0) &= \sin(0) = 0 \\ f^{(5)}(x) &= \cos(x) & f^{(5)}(0) &= \cos(0) = 1 \\ \end{align}

We can see a pattern: the derivatives cycle through \(\sin(x)\), \(\cos(x)\), \(-\sin(x)\), and \(-\cos(x)\).

Substituting into the Maclaurin series formula:

\begin{align} \sin(x) &= \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n \\ &= 0 + 1 \cdot x + 0 \cdot \frac{x^2}{2!} + (-1) \cdot \frac{x^3}{3!} + 0 \cdot \frac{x^4}{4!} + 1 \cdot \frac{x^5}{5!} + \ldots \\ &= x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \ldots \\ &= \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} \end{align}

This series converges for all values of \(x\) (the radius of convergence is \(\infty\)).

Method 2: Using Known Series

Once we know the Taylor series for some basic functions, we can use algebraic operations, substitution, differentiation, or integration to find Taylor series for other functions.

Example 3: Taylor Series for \(\cos(x)\) Using \(\sin(x)\)

Find the Taylor series for \(f(x) = \cos(x)\) using the Taylor series for \(\sin(x)\).

Solution:

We know that \(\frac{d}{dx}[\sin(x)] = \cos(x)\). Using the Taylor series for \(\sin(x)\) from Example 2:

\begin{align} \sin(x) &= x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \ldots \\ \frac{d}{dx}[\sin(x)] &= \frac{d}{dx}\left[x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \ldots\right] \\ \cos(x) &= 1 - \frac{3x^2}{3!} + \frac{5x^4}{5!} - \frac{7x^6}{7!} + \ldots \\ &= 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \ldots \\ &= \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} \end{align}

This series converges for all values of \(x\) (the radius of convergence is \(\infty\)).

Method 3: Using the Binomial Series

The binomial series can be used to find Taylor series for functions of the form \((1+x)^k\):

\((1+x)^k = \sum_{n=0}^{\infty} \binom{k}{n} x^n = 1 + kx + \frac{k(k-1)}{2!}x^2 + \frac{k(k-1)(k-2)}{3!}x^3 + \ldots\)

This series converges for \(|x| < 1\) when \(k\) is not a non-negative integer.

Common Taylor Series

Here are some important Taylor series centered at \(a = 0\) (Maclaurin series):

Common Maclaurin Series

  1. \(e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \ldots\) (for all \(x\))
  2. \(\sin(x) = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \ldots\) (for all \(x\))
  3. \(\cos(x) = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \ldots\) (for all \(x\))
  4. \(\ln(1+x) = \sum_{n=1}^{\infty} \frac{(-1)^{n+1}x^n}{n} = x - \frac{x^2}{2} + \frac{x^3}{3} - \ldots\) (for \(|x| < 1\))
  5. \(\frac{1}{1-x} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \ldots\) (for \(|x| < 1\))
  6. \((1+x)^k = \sum_{n=0}^{\infty} \binom{k}{n} x^n = 1 + kx + \frac{k(k-1)}{2!}x^2 + \ldots\) (for \(|x| < 1\) when \(k\) is not a non-negative integer)
  7. \(\arctan(x) = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n+1} = x - \frac{x^3}{3} + \frac{x^5}{5} - \ldots\) (for \(|x| \leq 1\))

Operations with Taylor Series

Taylor series can be manipulated using various operations to find series representations for more complex functions:

1. Addition and Subtraction

If \(f(x) = \sum_{n=0}^{\infty} a_n(x-a)^n\) and \(g(x) = \sum_{n=0}^{\infty} b_n(x-a)^n\), then:

\(f(x) \pm g(x) = \sum_{n=0}^{\infty} (a_n \pm b_n)(x-a)^n\)

2. Multiplication by a Constant

If \(f(x) = \sum_{n=0}^{\infty} a_n(x-a)^n\) and \(c\) is a constant, then:

\(c \cdot f(x) = \sum_{n=0}^{\infty} (c \cdot a_n)(x-a)^n\)

3. Substitution

If \(f(x) = \sum_{n=0}^{\infty} a_n(x-a)^n\) and \(g(x)\) is another function, then:

\(f(g(x)) = \sum_{n=0}^{\infty} a_n(g(x)-a)^n\)

This is valid when \(|g(x)-a| < R\), where \(R\) is the radius of convergence of the original series.

4. Differentiation

If \(f(x) = \sum_{n=0}^{\infty} a_n(x-a)^n\), then:

\(f'(x) = \sum_{n=1}^{\infty} n \cdot a_n(x-a)^{n-1} = \sum_{n=0}^{\infty} (n+1) \cdot a_{n+1}(x-a)^n\)

5. Integration

If \(f(x) = \sum_{n=0}^{\infty} a_n(x-a)^n\), then:

\(\int f(x) \, dx = C + \sum_{n=0}^{\infty} \frac{a_n}{n+1}(x-a)^{n+1} = C + \sum_{n=1}^{\infty} \frac{a_{n-1}}{n}(x-a)^n\)

where \(C\) is a constant of integration.

Example 4: Using Operations to Find Taylor Series

Find the Taylor series for \(f(x) = e^{x^2}\) centered at \(a = 0\).

Solution:

We know the Maclaurin series for \(e^x\):

\(e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \ldots\)

Using substitution with \(x\) replaced by \(x^2\):

\begin{align} e^{x^2} &= \sum_{n=0}^{\infty} \frac{(x^2)^n}{n!} \\ &= \sum_{n=0}^{\infty} \frac{x^{2n}}{n!} \\ &= 1 + x^2 + \frac{x^4}{2!} + \frac{x^6}{3!} + \frac{x^8}{4!} + \ldots \end{align}

This series converges for all values of \(x\) (the radius of convergence is \(\infty\)).

Error Estimation

When we use a finite number of terms from a Taylor series to approximate a function, there is an error in the approximation. This error can be estimated using Taylor's Remainder Theorem.

Taylor's Remainder Theorem

If \(f\) has \(n+1\) continuous derivatives on an interval containing \(a\) and \(x\), then there exists a point \(c\) between \(a\) and \(x\) such that:

\(R_n(x) = f(x) - P_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}\)

where \(P_n(x)\) is the \(n\)th-degree Taylor polynomial of \(f\) centered at \(a\), and \(R_n(x)\) is the remainder (error) term.

Example 5: Error Estimation

Estimate the error when approximating \(\sin(0.1)\) using the 3rd-degree Taylor polynomial centered at \(a = 0\).

Solution:

The 3rd-degree Taylor polynomial for \(\sin(x)\) centered at \(a = 0\) is:

\(P_3(x) = x - \frac{x^3}{3!} = x - \frac{x^3}{6}\)

Using Taylor's Remainder Theorem, the error is:

\(R_3(x) = \frac{f^{(4)}(c)}{4!}x^4\)

where \(c\) is between 0 and \(x\), and \(f^{(4)}(c) = \sin(c)\).

Since \(|\sin(c)| \leq 1\) for all \(c\), we have:

\(|R_3(0.1)| \leq \frac{1}{4!}(0.1)^4 = \frac{1}{24} \cdot 0.0001 \approx 4.17 \times 10^{-6}\)

Therefore, the error in approximating \(\sin(0.1)\) using \(P_3(0.1) = 0.1 - \frac{(0.1)^3}{6} \approx 0.09983\) is at most \(4.17 \times 10^{-6}\).

The actual value of \(\sin(0.1) \approx 0.09983\), so the approximation is quite accurate.

Examples

Example 6: Taylor Series for \(\ln(1+x)\) at \(a = 0\)

Find the Taylor series for \(f(x) = \ln(1+x)\) centered at \(a = 0\).

Solution:

We need to find the derivatives of \(f(x) = \ln(1+x)\) and evaluate them at \(x = 0\):

\begin{align} f(x) &= \ln(1+x) & f(0) &= \ln(1) = 0 \\ f'(x) &= \frac{1}{1+x} & f'(0) &= \frac{1}{1+0} = 1 \\ f''(x) &= -\frac{1}{(1+x)^2} & f''(0) &= -\frac{1}{(1+0)^2} = -1 \\ f'''(x) &= \frac{2}{(1+x)^3} & f'''(0) &= \frac{2}{(1+0)^3} = 2 \\ f^{(4)}(x) &= -\frac{6}{(1+x)^4} & f^{(4)}(0) &= -\frac{6}{(1+0)^4} = -6 \\ \end{align}

We can see a pattern: \(f^{(n)}(0) = (-1)^{n+1}(n-1)!\) for \(n \geq 1\).

Substituting into the Maclaurin series formula:

\begin{align} \ln(1+x) &= \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n \\ &= 0 + \frac{1}{1!}x + \frac{-1}{2!}x^2 + \frac{2}{3!}x^3 + \frac{-6}{4!}x^4 + \ldots \\ &= x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \ldots \\ &= \sum_{n=1}^{\infty} \frac{(-1)^{n+1}x^n}{n} \end{align}

This series converges for \(|x| < 1\) (the radius of convergence is 1).

Example 7: Taylor Series for \(\frac{1}{1+x}\) at \(a = 0\)

Find the Taylor series for \(f(x) = \frac{1}{1+x}\) centered at \(a = 0\).

Solution:

We can use the geometric series formula:

\(\frac{1}{1-r} = \sum_{n=0}^{\infty} r^n \quad \text{for } |r| < 1\)

Substituting \(r = -x\):

\begin{align} \frac{1}{1+x} &= \frac{1}{1-(-x)} \\ &= \sum_{n=0}^{\infty} (-x)^n \\ &= \sum_{n=0}^{\infty} (-1)^n x^n \\ &= 1 - x + x^2 - x^3 + x^4 - \ldots \end{align}

This series converges for \(|x| < 1\) (the radius of convergence is 1).

Example 8: Taylor Series for \(\arctan(x)\) at \(a = 0\)

Find the Taylor series for \(f(x) = \arctan(x)\) centered at \(a = 0\).

Solution:

We know that \(\frac{d}{dx}[\arctan(x)] = \frac{1}{1+x^2}\).

From Example 7, we have:

\(\frac{1}{1+x} = \sum_{n=0}^{\infty} (-1)^n x^n \quad \text{for } |x| < 1\)

Substituting \(x^2\) for \(x\):

\begin{align} \frac{1}{1+x^2} &= \sum_{n=0}^{\infty} (-1)^n (x^2)^n \\ &= \sum_{n=0}^{\infty} (-1)^n x^{2n} \\ &= 1 - x^2 + x^4 - x^6 + \ldots \end{align}

Integrating both sides:

\begin{align} \int \frac{1}{1+x^2} \, dx &= \int \sum_{n=0}^{\infty} (-1)^n x^{2n} \, dx \\ \arctan(x) &= \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{2n+1} + C \end{align}

Since \(\arctan(0) = 0\), we have \(C = 0\).

\(\arctan(x) = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n+1} = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \ldots\)

This series converges for \(|x| \leq 1\) (the radius of convergence is 1).

Interactive Visualizations

Explore Taylor Polynomial Approximations

Use the controls below to explore how Taylor polynomials approximate functions with increasing accuracy as more terms are included.

3
0

Taylor Series Information

Function: f(x) = sin(x)

Taylor Series: x - x³/3! + x⁵/5! - ...

Current Approximation: x - x³/6

Maximum Error in [-π,π]: 0.0741

Practice Exercises

Exercise 1

Find the Taylor series for \(f(x) = \cos(2x)\) centered at \(a = 0\).

Exercise 2

Find the Taylor series for \(f(x) = \frac{1}{(1-x)^2}\) centered at \(a = 0\).

Exercise 3

Find the Taylor series for \(f(x) = x\sin(x)\) centered at \(a = 0\).

Exercise 4

Use Taylor's Remainder Theorem to estimate the error when approximating \(e^{0.2}\) using the 3rd-degree Taylor polynomial centered at \(a = 0\).