Taylor Expansions and Expanding Functions into Power Series

The Taylor Series and the Maclaurin Series

Taylor series

If the function f(x)f(x) has derivatives of every order at the point x0x_0, then the power series

∑n=0∞f(n)(x0)n!(x−x0)n=f(x0)+f′(x0)(x−x0)+f′′(x0)2!(x−x0)2+⋯\sum_{n=0}^{\infty} \frac{f^{(n)}(x_0)}{n!} (x - x_0)^n = f(x_0) + f'(x_0)(x-x_0) + \frac{f''(x_0)}{2!}(x-x_0)^2 + \cdots

is called the Taylor series of the function f(x)f(x) at the point x0x_0.

When x0=0x_0 = 0, the Taylor series becomes

∑n=0∞f(n)(0)n!xn\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} x^n

and is called the Maclaurin series.

Conditions for a Function to Expand into a Power Series

Theorem1

Necessary and sufficient condition: suppose the function f(x)f(x) has derivatives of every order in some neighbourhood of the point x0x_0. Then the necessary and sufficient condition for f(x)f(x) to be expandable into a Taylor series in that neighbourhood is that the remainder Rn(x)R_n(x) in the Taylor formula of f(x)f(x) tends to zero as n→∞n \to \infty, that is,

lim⁡n→∞Rn(x)=0\lim_{n \to \infty} R_n(x) = 0

where the Taylor formula is:

f(x)=∑k=0nf(k)(x0)k!(x−x0)k+Rn(x)f(x) = \sum_{k=0}^{n} \frac{f^{(k)}(x_0)}{k!}(x-x_0)^k + R_n(x)

The common forms of the remainder are:

  • Lagrange remainder: Rn(x)=f(n+1)(ξ)(n+1)!(x−x0)n+1R_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)^{n+1} (ξ\xi lies between x0x_0 and xx)
  • Peano remainder: Rn(x)=o((x−x0)n)R_n(x) = o((x-x_0)^n)
Theorem2

Sufficient condition: if the derivatives of every order of f(x)f(x) are uniformly bounded in some neighbourhood of the point x0x_0 (that is, there is a constant M>0M > 0 such that ∣f(n)(x)∣≤M|f^{(n)}(x)| \leq M holds for all nn and all xx in that neighbourhood), then f(x)f(x) can be expanded into a Taylor series in that neighbourhood.

Maclaurin Expansions of Common Functions

Common Maclaurin expansions
  1. The exponential function: ex=∑n=0∞xnn!=1+x+x22!+⋯e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \cdots (x∈(−∞,+∞)x \in (-\infty, +\infty))

  2. The sine function: sin⁡x=∑n=0∞(−1)nx2n+1(2n+1)!=x−x33!+x55!−⋯\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots (x∈(−∞,+∞)x \in (-\infty, +\infty))

  3. The cosine function: cos⁡x=∑n=0∞(−1)nx2n(2n)!=1−x22!+x44!−⋯\cos x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots (x∈(−∞,+∞)x \in (-\infty, +\infty))

  4. The geometric series: 11−x=∑n=0∞xn=1+x+x2+⋯\frac{1}{1-x} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + \cdots (∣x∣<1|x| < 1)

  5. The logarithmic function: ln⁡(1+x)=∑n=1∞(−1)n−1xnn=x−x22+x33−⋯\ln(1+x) = \sum_{n=1}^{\infty} \frac{(-1)^{n-1} x^n}{n} = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots (x∈(−1,1]x \in (-1, 1])

  6. The binomial expansion: (1+x)α=∑n=0∞(αn)xn=1+αx+α(α−1)2!x2+⋯(1+x)^\alpha = \sum_{n=0}^{\infty} \binom{\alpha}{n} x^n = 1 + \alpha x + \frac{\alpha(\alpha-1)}{2!}x^2 + \cdots (∣x∣<1|x| < 1, with α\alpha any real number)

  7. The arctangent function: arctan⁡x=∑n=0∞(−1)nx2n+12n+1=x−x33+x55−⋯\arctan x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n+1} = x - \frac{x^3}{3} + \frac{x^5}{5} - \cdots (x∈[−1,1]x \in [-1, 1])

Methods for Expanding a Function into a Power Series

Worked Examples

Example 1: Indirect Expansion — a Change of Variable

Expand f(x)=e−x2f(x) = e^{-x^2} into a Maclaurin series.

indirect expansiona change of variablethe exponential function

Approach:

The Maclaurin expansion of ete^t is known, so substitute t=−x2t = -x^2 directly — there is no need to differentiate term by term all over again.

Steps:

  1. It is known that et=∑n=0∞tnn!e^t = \sum_{n=0}^{\infty} \frac{t^n}{n!} (t∈(−∞,+∞)t \in (-\infty, +\infty))
  2. Put t=−x2t = -x^2 and substitute: e−x2=∑n=0∞(−x2)nn!=∑n=0∞(−1)nx2nn!=1−x2+x42!−x63!+⋯e^{-x^2} = \sum_{n=0}^{\infty} \frac{(-x^2)^n}{n!} = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{n!} = 1 - x^2 + \frac{x^4}{2!} - \frac{x^6}{3!} + \cdots
  3. Domain of convergence: x∈(−∞,+∞)x \in (-\infty, +\infty)

Answer: e−x2=∑n=0∞(−1)nx2nn!e^{-x^2} = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{n!} (x∈Rx \in \mathbb{R}).

Example 2: Indirect Expansion — Term-by-Term Integration

Expand f(x)=arctan⁡xf(x) = \arctan x into a Maclaurin series.

indirect expansionterm-by-term integrationthe arctangent function

Approach:

First differentiate to turn arctan⁡x\arctan x into 1/(1+x2)1/(1+x^2), which is easy to expand, and then expand it and integrate term by term back.

Steps:

  1. f′(x)=11+x2f'(x) = \frac{1}{1+x^2}
  2. It is known that 11−t=∑n=0∞tn\frac{1}{1-t} = \sum_{n=0}^{\infty} t^n (∣t∣<1|t| < 1); put t=−x2t = -x^2: 11+x2=∑n=0∞(−x2)n=∑n=0∞(−1)nx2n\frac{1}{1+x^2} = \sum_{n=0}^{\infty} (-x^2)^n = \sum_{n=0}^{\infty} (-1)^n x^{2n} (∣x∣<1|x| < 1)
  3. Integrate term by term: arctan⁡x=∫0x11+t2dt=∑n=0∞(−1)n∫0xt2ndt=∑n=0∞(−1)nx2n+12n+1\arctan x = \int_0^x \frac{1}{1+t^2} dt = \sum_{n=0}^{\infty} (-1)^n \int_0^x t^{2n} dt = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n+1}
  4. Check the endpoints: at x=±1x = \pm 1 the series converges (it is an alternating series), so the domain of convergence is [−1,1][-1, 1]

Answer: arctan⁡x=∑n=0∞(−1)nx2n+12n+1\arctan x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n+1} (x∈[−1,1]x \in [-1, 1]).

Example 3: Indirect Expansion — the Four Arithmetic Operations

Expand f(x)=1x2+4x+3f(x) = \frac{1}{x^2 + 4x + 3} into a power series in (x−1)(x-1).

indirect expansionpartial fractionsa shifted expansion

Approach:

First do a partial fraction decomposition, and then expand each part separately into a power series in (x−1)(x-1).

Steps:

  1. Partial fractions: 1x2+4x+3=1(x+1)(x+3)=12(1x+1−1x+3)\frac{1}{x^2+4x+3} = \frac{1}{(x+1)(x+3)} = \frac{1}{2}\left(\frac{1}{x+1} - \frac{1}{x+3}\right)
  2. Put t=x−1t = x - 1, so x=t+1x = t + 1: 1x+1=1t+2=12⋅11+t2=12∑n=0∞(−t2)n=∑n=0∞(−1)ntn2n+1\frac{1}{x+1} = \frac{1}{t+2} = \frac{1}{2} \cdot \frac{1}{1+\frac{t}{2}} = \frac{1}{2}\sum_{n=0}^{\infty} \left(-\frac{t}{2}\right)^n = \sum_{n=0}^{\infty} \frac{(-1)^n t^n}{2^{n+1}} (∣t∣<2|t| < 2) 1x+3=1t+4=14⋅11+t4=∑n=0∞(−1)ntn4n+1\frac{1}{x+3} = \frac{1}{t+4} = \frac{1}{4} \cdot \frac{1}{1+\frac{t}{4}} = \sum_{n=0}^{\infty} \frac{(-1)^n t^n}{4^{n+1}} (∣t∣<4|t| < 4)
  3. Take the intersection ∣t∣<2|t| < 2: f(x)=12(∑n=0∞(−1)ntn2n+1−∑n=0∞(−1)ntn4n+1)=∑n=0∞(−1)n(12n+2−12⋅4n+1)tnf(x) = \frac{1}{2}\left(\sum_{n=0}^{\infty} \frac{(-1)^n t^n}{2^{n+1}} - \sum_{n=0}^{\infty} \frac{(-1)^n t^n}{4^{n+1}}\right) = \sum_{n=0}^{\infty} (-1)^n \left(\frac{1}{2^{n+2}} - \frac{1}{2 \cdot 4^{n+1}}\right) t^n
  4. Substitute t=x−1t = x-1 back; the domain of convergence is ∣x−1∣<2|x-1| < 2, that is, x∈(−1,3)x \in (-1, 3)

Answer: f(x)=∑n=0∞(−1)n(12n+2−12⋅4n+1)(x−1)nf(x) = \sum_{n=0}^{\infty} (-1)^n \left(\frac{1}{2^{n+2}} - \frac{1}{2 \cdot 4^{n+1}}\right)(x-1)^n (x∈(−1,3)x \in (-1, 3)).

Exercises

Exercise 1

Expand f(x)=cos⁡2xf(x) = \cos^2 x into a Maclaurin series.

indirect expansiona trigonometric identitythe cosine function

Approach:

Use the double-angle identity to write cos⁡2x\cos^2 x as a constant plus a cosine, and the expansion of the cosine is known.

Steps:

  1. Use the identity cos⁡2x=1+cos⁡2x2\cos^2 x = \frac{1+\cos 2x}{2}
  2. cos⁡2x=∑n=0∞(−1)n(2x)2n(2n)!=∑n=0∞(−1)n4nx2n(2n)!\cos 2x = \sum_{n=0}^{\infty} \frac{(-1)^n (2x)^{2n}}{(2n)!} = \sum_{n=0}^{\infty} \frac{(-1)^n 4^n x^{2n}}{(2n)!}
  3. cos⁡2x=12+12∑n=0∞(−1)n4nx2n(2n)!=1+∑n=1∞(−1)n22n−1x2n(2n)!\cos^2 x = \frac{1}{2} + \frac{1}{2}\sum_{n=0}^{\infty} \frac{(-1)^n 4^n x^{2n}}{(2n)!} = 1 + \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n-1} x^{2n}}{(2n)!}

Answer: cos⁡2x=1+∑n=1∞(−1)n22n−1x2n(2n)!\cos^2 x = 1 + \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n-1} x^{2n}}{(2n)!} (x∈Rx \in \mathbb{R}).

Exercise 2

Expand f(x)=1(1−x)2f(x) = \frac{1}{(1-x)^2} into a Maclaurin series.

indirect expansionterm-by-term differentiationthe geometric series

Approach:

Differentiating the geometric series once term by term gives this expansion.

Steps:

  1. It is known that 11−x=∑n=0∞xn\frac{1}{1-x} = \sum_{n=0}^{\infty} x^n (∣x∣<1|x| < 1)
  2. Differentiate both sides: 1(1−x)2=∑n=1∞nxn−1=∑n=0∞(n+1)xn\frac{1}{(1-x)^2} = \sum_{n=1}^{\infty} n x^{n-1} = \sum_{n=0}^{\infty} (n+1) x^n (∣x∣<1|x| < 1)

Answer: 1(1−x)2=∑n=0∞(n+1)xn\frac{1}{(1-x)^2} = \sum_{n=0}^{\infty} (n+1)x^n (∣x∣<1|x| < 1).

Summary

Symbols Used in This Article

SymbolTypePronunciation/ExplanationMeaning in This Article
f(n)(x)f^{(n)}(x)nth derivativenth derivativeThe nn-th derivative of the function
Rn(x)R_n(x)RemainderremainderThe remainder in the Taylor formula
x0x_0Centre of expansioncenterThe centre of the Taylor expansion
ξ\xiIntermediate pointxiThe intermediate point in the Lagrange remainder
(αn)\binom{\alpha}{n}Binomial coefficientbinomial coefficientThe generalised binomial coefficient

Found an issue with this content?

Tell us what could be improved.