Skip to content
Family Table Math

Representing Functions as Power Series

Finding a Taylor series from derivatives can get messy fast. Try taking ten derivatives of e−x2e^{-x^2}! Luckily, there’s a shortcut: start from a series you already know, like 11−x\dfrac{1}{1 - x} or exe^x, and change it with algebra and calculus. This is how you get the series for ln⁡(1+x)\ln(1 + x) and arctan⁡x\arctan x, and how you can approximate integrals that have no elementary antiderivative.

Everything on this page builds on the four Maclaurin series you’ve memorized:

ex=∑n=0∞xnn!all xsin⁡x=∑n=0∞(−1)nx2n+1(2n+1)!all xcos⁡x=∑n=0∞(−1)nx2n(2n)!all x11−x=∑n=0∞xn−1<x<1\begin{aligned} e^x &= \sum_{n=0}^{\infty} \frac{x^n}{n!} &&\text{all } x &\qquad \sin x &= \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} &&\text{all } x \\ \cos x &= \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} &&\text{all } x &\qquad \frac{1}{1 - x} &= \sum_{n=0}^{\infty} x^n &&-1 \lt x \lt 1 \end{aligned}
The graph of y = 1/(1 - x), with a vertical asymptote at x = 1, and the partial sums S3 = 1 + x + x squared + x cubed and S8 = 1 + x + ... + x to the 8th. Between the dashed lines x = -1 and x = 1 the partial sums hug the curve, S8 more closely. Outside that interval they pull away from it. −1 1 2 3 4 5 −1 < x < 1 −1 1 1/(1 − x) S3 S8
The geometric series 1+x+x2+⋯1 + x + x^2 + \cdots converges to 11−x\dfrac{1}{1 - x} only for −1<x<1-1 \lt x \lt 1. Any series built from it inherits that radius.

Replace xx with an expression everywhere in a known series. The interval changes to match. For example, replacing xx with −x2-x^2 in the geometric series:

11+x2=11−(−x2)=1−x2+x4−x6+⋯=∑n=0∞(−1)nx2n\frac{1}{1 + x^2} = \frac{1}{1 - (-x^2)} = 1 - x^2 + x^4 - x^6 + \cdots = \sum_{n=0}^{\infty} (-1)^n x^{2n}

valid when ∣−x2∣<1|-x^2| \lt 1, that is, −1<x<1-1 \lt x \lt 1.

To use the geometric series, first rewrite the function in the form first term1−ratio\dfrac{\text{first term}}{1 - \text{ratio}}. For example, 12−x=1/21−x/2\dfrac{1}{2 - x} = \dfrac{1/2}{1 - x/2}.

Multiplying a series by xkx^k or a constant multiplies every term. The interval doesn’t change. For example, xcos⁡x=x−x32!+x54!−⋯x\cos x = x - \dfrac{x^3}{2!} + \dfrac{x^5}{4!} - \cdots for all xx.

Differentiating and integrating term by term

Section titled “Differentiating and integrating term by term”

Inside its interval of convergence, a power series can be differentiated or integrated one term at a time, just like a polynomial:

ddx∑cn(x−a)n=∑n cn(x−a)n−1,∫∑cn(x−a)n dx=C+∑cn(x−a)n+1n+1\frac{d}{dx}\sum c_n (x - a)^n = \sum n\,c_n (x - a)^{n-1}, \qquad \int \sum c_n (x - a)^n\,dx = C + \sum \frac{c_n (x - a)^{n+1}}{n + 1}
  • The new series has the same radius of convergence.
  • The endpoints may change: integrating can make a divergent endpoint converge, and differentiating can make a convergent endpoint diverge. Always recheck them.
  • When you integrate, find CC by plugging in the centre.

Integrating 11+t=1−t+t2−⋯\dfrac{1}{1 + t} = 1 - t + t^2 - \cdots from 00 to xx gives

ln⁡(1+x)=x−x22+x33−x44+⋯=∑n=1∞(−1)n+1xnn,−1<x≤1\ln(1 + x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \cdots = \sum_{n=1}^{\infty} \frac{(-1)^{n+1} x^n}{n}, \qquad -1 \lt x \le 1

Integrating 11+t2=1−t2+t4−⋯\dfrac{1}{1 + t^2} = 1 - t^2 + t^4 - \cdots from 00 to xx gives

arctan⁡x=x−x33+x55−x77+⋯=∑n=0∞(−1)nx2n+12n+1,−1≤x≤1\arctan x = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n + 1}, \qquad -1 \le x \le 1

Both started from series that diverge at x=±1x = \pm 1, and both gained endpoints by integrating (Example 4).

Example 1: Substituting into the geometric series

Section titled “Example 1: Substituting into the geometric series”

Find the Maclaurin series and interval of convergence for f(x)=11+3xf(x) = \dfrac{1}{1 + 3x}, and then for g(x)=x1+3xg(x) = \dfrac{x}{1 + 3x}.

Solution. Write 11+3x=11−(−3x)\dfrac{1}{1 + 3x} = \dfrac{1}{1 - (-3x)} and replace xx with −3x-3x in 11−x=∑xn\dfrac{1}{1 - x} = \sum x^n:

f(x)=∑n=0∞(−3x)n=1−3x+9x2−27x3+⋯f(x) = \sum_{n=0}^{\infty} (-3x)^n = 1 - 3x + 9x^2 - 27x^3 + \cdots

valid when ∣−3x∣<1|-3x| \lt 1, so −13<x<13-\tfrac{1}{3} \lt x \lt \tfrac{1}{3}. (At the endpoints the terms are (±1)n(\pm 1)^n, which don’t approach 00, so they diverge.)

Multiplying by xx doesn’t change the interval:

g(x)=∑n=0∞(−3)nxn+1=x−3x2+9x3−27x4+⋯ ,−13<x<13g(x) = \sum_{n=0}^{\infty} (-3)^n x^{n+1} = x - 3x^2 + 9x^3 - 27x^4 + \cdots, \qquad -\tfrac{1}{3} \lt x \lt \tfrac{1}{3}

Example 2: An integral with no elementary antiderivative

Section titled “Example 2: An integral with no elementary antiderivative”

Find the Maclaurin series for e−x2e^{-x^2}. Then use the first three nonzero terms of a series for ∫01/2e−x2 dx\displaystyle\int_0^{1/2} e^{-x^2}\,dx to approximate the integral, and bound the error.

Solution. Replace xx with −x2-x^2 in the exe^x series:

e−x2=1−x2+x42!−x63!+⋯=∑n=0∞(−1)nx2nn!e^{-x^2} = 1 - x^2 + \frac{x^4}{2!} - \frac{x^6}{3!} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{n!}

Integrate term by term:

∫01/2e−x2 dx=[x−x33+x510−x742+⋯ ]01/2=12−124+1320−15376+⋯\begin{aligned} \int_0^{1/2} e^{-x^2}\,dx &= \left[x - \frac{x^3}{3} + \frac{x^5}{10} - \frac{x^7}{42} + \cdots\right]_0^{1/2} \\ &= \frac{1}{2} - \frac{1}{24} + \frac{1}{320} - \frac{1}{5376} + \cdots \end{aligned}

The first three terms give

12−124+1320≈0.461458≈0.461\frac{1}{2} - \frac{1}{24} + \frac{1}{320} \approx 0.461458 \approx 0.461

This series alternates, and its terms decrease to 00, so by the alternating series error bound, the error is at most 15376≈0.000186\dfrac{1}{5376} \approx 0.000186. (Check: a calculator gives 0.4612810.461281.)

Example 3: Differentiating the geometric series

Section titled “Example 3: Differentiating the geometric series”

Find a power series for 1(1−x)2\dfrac{1}{(1 - x)^2} and its interval of convergence.

Solution. Notice that ddx(11−x)=1(1−x)2\dfrac{d}{dx}\left(\dfrac{1}{1 - x}\right) = \dfrac{1}{(1 - x)^2}. Differentiate 1+x+x2+x3+⋯1 + x + x^2 + x^3 + \cdots term by term:

1(1−x)2=1+2x+3x2+4x3+⋯=∑n=1∞nxn−1\frac{1}{(1 - x)^2} = 1 + 2x + 3x^2 + 4x^3 + \cdots = \sum_{n=1}^{\infty} n x^{n-1}

The radius stays 11. At x=±1x = \pm 1, the terms n(±1)n−1n(\pm 1)^{n-1} don’t approach 00, so both endpoints diverge. The interval of convergence is −1<x<1-1 \lt x \lt 1.

Find the Maclaurin series for ln⁡(1+x)\ln(1 + x) and its interval of convergence.

Solution. Start from 11+t=1−t+t2−t3+⋯\dfrac{1}{1 + t} = 1 - t + t^2 - t^3 + \cdots for −1<t<1-1 \lt t \lt 1, and integrate term by term:

ln⁡(1+x)=∫0x11+t dt=x−x22+x33−x44+⋯\ln(1 + x) = \int_0^x \frac{1}{1 + t}\,dt = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \cdots

(Integrating from 00 handles the constant: ln⁡(1+0)=0\ln(1 + 0) = 0, and the series is also 00 at x=0x = 0.)

The radius is still 11. Now check the endpoints of the new series:

  • At x=1x = 1: 1−12+13−⋯1 - \dfrac{1}{2} + \dfrac{1}{3} - \cdots, the alternating harmonic series, converges (to ln⁡2\ln 2).
  • At x=−1x = -1: −1−12−13−⋯=−∑1n-1 - \dfrac{1}{2} - \dfrac{1}{3} - \cdots = -\sum \dfrac{1}{n}, which diverges.

The interval of convergence is −1<x≤1-1 \lt x \le 1. The original series for 11+x\dfrac{1}{1 + x} diverged at x=1x = 1; integrating gained that endpoint.

Forgetting to change the interval after substituting. For 11−x2/4\dfrac{1}{1 - x^2/4}, the condition is ∣x24∣<1\left|\dfrac{x^2}{4}\right| \lt 1, so ∣x∣<2|x| \lt 2, not ∣x∣<1|x| \lt 1.

Not rewriting into geometric form first. 12−x\dfrac{1}{2 - x} is not ∑(x−1)n\sum (x - 1)^n or ∑(2−x)n\sum (2 - x)^n. Factor out the constant: 12−x=12⋅11−x/2=∑xn2n+1\dfrac{1}{2 - x} = \dfrac{1}{2} \cdot \dfrac{1}{1 - x/2} = \sum \dfrac{x^n}{2^{n+1}}.

Forgetting the constant when integrating. Integrating term by term gives CC plus a series. Find CC by plugging in the centre, or write the integral from 00 to xx as in Example 4.

Assuming the endpoints stay the same. Differentiation and integration keep the radius but can change what happens at the endpoints. Check them again in the new series.

Substituting in only some places. When you replace xx with −x2-x^2, every xx becomes −x2-x^2, including inside the powers: (−x2)n=(−1)nx2n(-x^2)^n = (-1)^n x^{2n}.

1. (Warm-up) Find the Maclaurin series for 11+x\dfrac{1}{1 + x} and its interval of convergence.

Solution

Replace xx with −x-x in the geometric series:

11+x=1−x+x2−x3+⋯=∑n=0∞(−1)nxn,−1<x<1\frac{1}{1 + x} = 1 - x + x^2 - x^3 + \cdots = \sum_{n=0}^{\infty} (-1)^n x^n, \qquad -1 \lt x \lt 1

(At x=±1x = \pm 1, the terms don’t approach 00.)

2. (Warm-up) Find the first three nonzero terms and the general term of the Maclaurin series for sin⁡(x2)\sin(x^2).

Solution

Replace xx with x2x^2 in the sine series:

sin⁡(x2)=x2−x63!+x105!−⋯=∑n=0∞(−1)nx4n+2(2n+1)!\sin(x^2) = x^2 - \frac{x^6}{3!} + \frac{x^{10}}{5!} - \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n x^{4n+2}}{(2n+1)!}

valid for all xx.

3. (Warm-up) Find the first four nonzero terms and the general term of the Maclaurin series for xexx e^x.

Solution

Multiply the exe^x series by xx:

xex=x+x2+x32!+x43!+⋯=∑n=0∞xn+1n!x e^x = x + x^2 + \frac{x^3}{2!} + \frac{x^4}{3!} + \cdots = \sum_{n=0}^{\infty} \frac{x^{n+1}}{n!}

4. (Core) Find a power series for 12−x\dfrac{1}{2 - x} and its interval of convergence.

Solution12−x=12⋅11−x/2=12∑n=0∞(x2)n=∑n=0∞xn2n+1=12+x4+x28+⋯\frac{1}{2 - x} = \frac{1}{2} \cdot \frac{1}{1 - x/2} = \frac{1}{2}\sum_{n=0}^{\infty} \left(\frac{x}{2}\right)^n = \sum_{n=0}^{\infty} \frac{x^n}{2^{n+1}} = \frac{1}{2} + \frac{x}{4} + \frac{x^2}{8} + \cdots

Valid when ∣x2∣<1\left|\dfrac{x}{2}\right| \lt 1: −2<x<2-2 \lt x \lt 2 (the endpoints give terms of constant size 12\tfrac{1}{2}, so they diverge).

5. (Core) Integrate a geometric series to find the Maclaurin series for ln⁡(1−x)\ln(1 - x), and find its interval of convergence.

Solution

ddxln⁡(1−x)=−11−x\dfrac{d}{dx}\ln(1 - x) = -\dfrac{1}{1 - x}, so

ln⁡(1−x)=−∫0x11−t dt=−∫0x(1+t+t2+⋯ )dt=−x−x22−x33−⋯=−∑n=1∞xnn\ln(1 - x) = -\int_0^x \frac{1}{1 - t}\,dt = -\int_0^x \left(1 + t + t^2 + \cdots\right)dt = -x - \frac{x^2}{2} - \frac{x^3}{3} - \cdots = -\sum_{n=1}^{\infty} \frac{x^n}{n}

The radius is 11. At x=1x = 1: −∑1n-\sum \dfrac{1}{n} diverges. At x=−1x = -1: −∑(−1)nn-\sum \dfrac{(-1)^n}{n} converges by the alternating series test. The interval is −1≤x<1-1 \le x \lt 1.

6. (Core) Let f(x)=∑n=1∞xnn2f(x) = \displaystyle\sum_{n=1}^{\infty} \frac{x^n}{n^2}, which converges for −1≤x≤1-1 \le x \le 1. Find a power series for f′(x)f'(x) and its interval of convergence.

Solution

Differentiate term by term:

f′(x)=∑n=1∞nxn−1n2=∑n=1∞xn−1n=1+x2+x23+⋯f'(x) = \sum_{n=1}^{\infty} \frac{n x^{n-1}}{n^2} = \sum_{n=1}^{\infty} \frac{x^{n-1}}{n} = 1 + \frac{x}{2} + \frac{x^2}{3} + \cdots

The radius is still 11. At x=1x = 1: ∑1n\sum \dfrac{1}{n} diverges. At x=−1x = -1: ∑(−1)n−1n\sum \dfrac{(-1)^{n-1}}{n} converges by the alternating series test. The interval is −1≤x<1-1 \le x \lt 1: differentiating lost the endpoint x=1x = 1.

7. (Core) Use the first two nonzero terms of a series to approximate ∫01sin⁡(x2) dx\displaystyle\int_0^1 \sin(x^2)\,dx, and bound the error.

Solution

From Question 2, sin⁡(x2)=x2−x66+x10120−⋯\sin(x^2) = x^2 - \dfrac{x^6}{6} + \dfrac{x^{10}}{120} - \cdots, so

∫01sin⁡(x2) dx=[x33−x742+x111320−⋯ ]01=13−142+11320−⋯\int_0^1 \sin(x^2)\,dx = \left[\frac{x^3}{3} - \frac{x^7}{42} + \frac{x^{11}}{1320} - \cdots\right]_0^1 = \frac{1}{3} - \frac{1}{42} + \frac{1}{1320} - \cdots

Two terms: 13−142=1342≈0.310\dfrac{1}{3} - \dfrac{1}{42} = \dfrac{13}{42} \approx 0.310.

The series alternates with terms decreasing to 00, so the error is at most 11320≈0.00076\dfrac{1}{1320} \approx 0.00076. (Since that first omitted term is positive, 1342\dfrac{13}{42} is an underestimate; a calculator gives 0.3102680.310268.)

8. (Challenge) Use the series from Example 3 to find the exact sum of ∑n=1∞n2n=12+24+38+⋯\displaystyle\sum_{n=1}^{\infty} \frac{n}{2^n} = \frac{1}{2} + \frac{2}{4} + \frac{3}{8} + \cdots

Solution

Multiply 1(1−x)2=∑n=1∞nxn−1\dfrac{1}{(1 - x)^2} = \displaystyle\sum_{n=1}^{\infty} n x^{n-1} by xx:

x(1−x)2=∑n=1∞nxn,−1<x<1\frac{x}{(1 - x)^2} = \sum_{n=1}^{\infty} n x^n, \qquad -1 \lt x \lt 1

At x=12x = \tfrac{1}{2}, which is inside the interval:

∑n=1∞n2n=1/2(1/2)2=2\sum_{n=1}^{\infty} \frac{n}{2^n} = \frac{1/2}{(1/2)^2} = 2

9. (Challenge) Let f(x)=arctan⁡(x2)f(x) = \arctan\left(\dfrac{x}{2}\right).

  • (a) Find the first three nonzero terms and the general term of the Maclaurin series for ff.
  • (b) Find the interval of convergence.
  • (c) Find f(5)(0)f^{(5)}(0).
Solution

(a) Replace xx with x2\dfrac{x}{2} in the arctan series:

f(x)=x2−(x/2)33+(x/2)55−⋯=x2−x324+x5160−⋯f(x) = \frac{x}{2} - \frac{(x/2)^3}{3} + \frac{(x/2)^5}{5} - \cdots = \frac{x}{2} - \frac{x^3}{24} + \frac{x^5}{160} - \cdots

The general term is (−1)nx2n+1(2n+1) 22n+1\dfrac{(-1)^n x^{2n+1}}{(2n + 1)\,2^{2n+1}}.

(b) The arctan series converges for −1≤x≤1-1 \le x \le 1, so this converges for −1≤x2≤1-1 \le \dfrac{x}{2} \le 1, that is, −2≤x≤2-2 \le x \le 2.

(c) The coefficient of x5x^5 is 1160=f(5)(0)5!\dfrac{1}{160} = \dfrac{f^{(5)}(0)}{5!}, so

f(5)(0)=120160=34f^{(5)}(0) = \frac{120}{160} = \frac{3}{4}