Advanced level

Power series and the Taylor series

Put a letter x into a series and it stops being a number and becomes a function. It turns out that eˣ, sine, cosine and the logarithm can all be written this way — as infinite polynomials. Their finite pieces are what a calculator actually evaluates those functions with.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

Where this is used

Real situations where you count exactly the way this lesson teaches:

  • How a calculator evaluates a sine
    A processor holds no table of sines — it sums a few terms of a series. For x = 0.5 the polynomial x − x³/6 + x⁵/120 alone gives 0.4794255, and the true sine is 0.4794255 — seven digits of agreement from three terms. The next term would change the result by less than 10⁻⁹, so it is simply never computed.
  • A pendulum at small angles
    The formula for the period of a pendulum, T = 2π√(L/g), comes from replacing sin θ by θ, i.e. from truncating the sine series after its first term. At a swing of 5 degrees, or 0.0873 radians, the sine is 0.08716 — a difference of 0.15 percent, so a 1-metre pendulum has a period of 2.006 seconds instead of 2.007. At 30 degrees the error is already 4.5 percent and the formula must not be used.
  • Continuously compounded interest
    A deposit with a nominal rate of 3 percent compounded continuously grows over a year by a factor of e^0.03. The first two terms of the series give 1 + 0.03 = 1.03, and the third adds 0.00045, i.e. 1.03045 — really 3.045 percent rather than 3. On 20,000 that is 9 of difference, and it is exactly that quadratic term which separates continuous compounding from ordinary.
  • Logarithmic returns
    Analysts measure price changes as ln(1 + r) rather than r, because such returns may be added. The logarithm series says when the difference is negligible: a 2 percent rise gives 0.0198, an error of 1 percent, while a 50 percent rise gives 0.405 instead of 0.5 — off by 19 percent. The first term of the expansion is a good approximation only near zero.

All formulas

  • Power series

    n=0an(xx0)n\sum_{n=0}^{\infty} a_n (x - x_0)^n

    a function of its argument x

  • Radius of convergence

    R=limnanan+1R = \lim_{n \to \infty} \left|\frac{a_n}{a_{n+1}}\right|

    convergent for |x − x_0| < R

  • Taylor series

    f(x)=n=0f(n)(x0)n!(xx0)nf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(x_0)}{n!}\,(x - x_0)^n

    the coefficients are derivatives at x_0

  • Maclaurin series

    f(x)=f(0)+f(0)x+f(0)2!x2+f(0)3!x3+f(x) = f(0) + f'(0)\,x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!}x^3 + \dots

    the Taylor series about zero

  • Expansion of eˣ

    ex=n=0xnn!=1+x+x22!+x33!+e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots

    convergent for every x

  • Expansion of sine

    sinx=xx33!+x55!\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots

    odd powers only

  • Expansion of cosine

    cosx=1x22!+x44!\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots

    even powers only

  • Expansion of the logarithm

    ln(1+x)=xx22+x33\ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \dots

    only for −1 < x ≤ 1

  • Approximation error

    Rn(x)Mxx0n+1(n+1)!\big|R_n(x)\big| \leq \frac{M\,|x - x_0|^{n+1}}{(n+1)!}

    M bounds the derivative of order n+1

Every number series in the previous lesson summed to a number. Now put a variable into the terms:

n=0an(xx0)n=a0+a1(xx0)+a2(xx0)2+\sum_{n=0}^{\infty} a_n (x - x_0)^n = a_0 + a_1(x - x_0) + a_2(x - x_0)^2 + \dots

For each fixed xx this is an ordinary number series — convergent for some arguments, not for others. A power series is therefore a function of its argument, defined wherever it converges. You have known the first example for a long time: the geometric series

1+x+x2+x3+=11xfor x<11 + x + x^2 + x^3 + \dots = \frac{1}{1-x} \qquad \text{for } |x| < 1

Infinitely many powers on the left, a short formula on the right. This lesson is about when such a trade is legal and how to find the coefficients it needs.

The radius of convergence

For the geometric series the condition read x<1|x| < 1, and that was no accident. Every power series converges on an interval symmetric about its centre, and its reach is called the radius of convergence:

R=limnanan+1R = \lim_{n \to \infty} \left|\frac{a_n}{a_{n+1}}\right|
xx0\lvert x - x_0 \rvertwhat happens
less than RRseries convergent (absolutely, at that)
greater than RRseries divergent
equal to RRmust be examined separately, endpoint by endpoint

The formula for RR is nothing but the ratio test applied to anxn|a_n x^n| and solved for x|x|.

Find the radius and the interval of convergence of Σ xⁿ/n.
−2−1012⟨−1; 1)
The interval of convergence of Σ xⁿ/n. The filled circle at −1 and the hollow one at 1 are the results of two separate computations, which the radius by itself does not settle.

Two extreme cases are worth knowing:

  • xnn!\sum \tfrac{x^n}{n!} has R=lim(n+1)!n!=R = \lim \tfrac{(n+1)!}{n!} = \infty — it converges for every xx;
  • n!xn\sum n!\,x^n has R=limn!(n+1)!=0R = \lim \tfrac{n!}{(n+1)!} = 0 — it converges only at x=0x = 0, so as a function it is useless.

Where the coefficients come from

Suppose a function ff is the sum of some power series about zero:

f(x)=a0+a1x+a2x2+a3x3+f(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \dots

Setting x=0x = 0 kills everything but the first term, so a0=f(0)a_0 = f(0). Now differentiate both sides:

f(x)=a1+2a2x+3a3x2+a1=f(0)f'(x) = a_1 + 2a_2 x + 3a_3 x^2 + \dots \quad \Longrightarrow \quad a_1 = f'(0) f(x)=2a2+6a3x+a2=f(0)2f''(x) = 2a_2 + 6a_3 x + \dots \quad \Longrightarrow \quad a_2 = \frac{f''(0)}{2}

Each time the constant n!ann!\,a_n is what remains, so in general an=f(n)(0)n!a_n = \tfrac{f^{(n)}(0)}{n!}. Hence the Taylor formula, in the version about an arbitrary point x0x_0:

f(x)=n=0f(n)(x0)n!(xx0)nf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(x_0)}{n!}\,(x - x_0)^n

The version with x0=0x_0 = 0 is called the Maclaurin series and is the one used most often. Note that the coefficients are not chosen — they are forced by the derivatives of the function.

Four expansions

Find the Maclaurin series of eˣ.

Sine and cosine go the same way, except that their derivatives at zero cycle through 0,1,0,10, 1, 0, -1 (for the sine) and 1,0,1,01, 0, -1, 0 (for the cosine) — which is why one expansion keeps only odd powers and the other only even ones.

functionMaclaurin expansionRR
exe^x1+x+x22!+x33!+1 + x + \dfrac{x^2}{2!} + \dfrac{x^3}{3!} + \dots\infty
sinx\sin xxx33!+x55!x - \dfrac{x^3}{3!} + \dfrac{x^5}{5!} - \dots\infty
cosx\cos x1x22!+x44!1 - \dfrac{x^2}{2!} + \dfrac{x^4}{4!} - \dots\infty
ln(1+x)\ln(1+x)xx22+x33x - \dfrac{x^2}{2} + \dfrac{x^3}{3} - \dots11

The last row differs from the rest, and not by chance: ln(1+x)\ln(1+x) does not exist for x1x \leq -1, so no series has any business representing it there. The radius 11 is exactly the distance from the centre of the expansion to that obstacle.

Approximating with a polynomial

Truncating the series after the term of degree nn gives the Taylor polynomial TnT_n — and that is the practical payoff of the whole theory.

T1=x,T3=xx36,T5=xx36+x5120T_1 = x, \qquad T_3 = x - \frac{x^3}{6}, \qquad T_5 = x - \frac{x^3}{6} + \frac{x^5}{120}
−4−3−2−101234−2−1012xyy = sin xT₁ = xT₃ = x − x³/6T₅
The sine and three of its Maclaurin polynomials. They all set off from the same point and hold on to the curve the longer the higher their degree — and then each of them breaks away, because a polynomial cannot oscillate forever.

The drawing shows two things at once. Near zero every one of the polynomials hugs the sine, and that is the content of the Taylor formula. Far from zero each of them breaks away — because a polynomial runs off to infinity while the sine oscillates forever between 1-1 and 11. An expansion is local by nature, even when the radius of convergence is infinite.

The approximation error

How much exactly is lost by truncating? The remainder bound answers that:

Rn(x)Mxx0n+1(n+1)!\big|R_n(x)\big| \leq \frac{M\,|x - x_0|^{n+1}}{(n+1)!}

where MM bounds the derivative of order n+1n+1 on the stretch examined. The crucial part is the factorial in the denominator: one extra term can improve the result by an order of magnitude.

Bound the error of approximating sin 0.5 by T₃ and compare it with reality.

The same computation lies behind the formula for the period of a pendulum: replacing sinθ\sin\theta by θ\theta is a truncation of the sine series after its first term, allowed only at small angles — and at angles expressed in radians, because the whole theory rests on the derivative of the sine being the cosine, which stops being true in degrees. The angle converter will turn a value in degrees into radians for you.

Exercises

The set asks four things: the radius of convergence (a number or a fraction), the coefficient of xⁿ in a Maclaurin expansion (a fraction, zero included — a missing power is a full answer), the Maclaurin polynomial of a given degree (typed as a formula, e.g. 1+x+x^2/2), and the approximate value that polynomial produces, rounded to four places.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
Radius of convergence: Σ(n = 1 … ∞) xⁿ/3ⁿ

The set draws only series with a finite radius, and it never asks for the interval of convergence: that answer is a pair of endpoints together with which of them is open, and that is not a number. Both cases are worked out in the examples above.

Common mistakes

  • Confusing the radius with the interval — the radius is a single number, the interval is a set with endpoints; those endpoints have to be examined separately and can give different answers.
  • Skipping the endpoints — the ratio test says nothing at xx0=R|x - x_0| = R, so leaving those two points out leaves the exercise unfinished.
  • Assuming that R=R = \infty makes a Taylor polynomial good everywhere — it is the whole series that converges; its finite truncation still breaks away far from the centre.
  • Expanding lnx\ln x instead of ln(1+x)\ln(1+x) — the logarithm has no value at zero, so it is the shifted version that is expanded; this is not a cosmetic choice of notation.
  • Losing the factorial in the denominator — the coefficient is f(n)(x0)/n!f^{(n)}(x_0)/n!, not the derivative alone; at n=5n = 5 that is a factor of 120.
  • Approximating far from the centre of the expansion — the error grows like xx0n+1|x - x_0|^{n+1}, so doubling the distance can multiply it several dozen times.

Formula card

Topic: Power and Taylor series

  • Power series

    n=0an(xx0)n\sum_{n=0}^{\infty} a_n (x - x_0)^n

    a function of its argument x

  • Radius of convergence

    R=limnanan+1R = \lim_{n \to \infty} \left|\frac{a_n}{a_{n+1}}\right|

    convergent for |x − x_0| < R

  • Taylor series

    f(x)=n=0f(n)(x0)n!(xx0)nf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(x_0)}{n!}\,(x - x_0)^n

    the coefficients are derivatives at x_0

  • Maclaurin series

    f(x)=f(0)+f(0)x+f(0)2!x2+f(0)3!x3+f(x) = f(0) + f'(0)\,x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!}x^3 + \dots

    the Taylor series about zero

  • Expansion of eˣ

    ex=n=0xnn!=1+x+x22!+x33!+e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots

    convergent for every x

  • Expansion of sine

    sinx=xx33!+x55!\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots

    odd powers only

  • Expansion of cosine

    cosx=1x22!+x44!\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots

    even powers only

  • Expansion of the logarithm

    ln(1+x)=xx22+x33\ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \dots

    only for −1 < x ≤ 1

  • Approximation error

    Rn(x)Mxx0n+1(n+1)!\big|R_n(x)\big| \leq \frac{M\,|x - x_0|^{n+1}}{(n+1)!}

    M bounds the derivative of order n+1

−4−3−2−101234−2−1012xyy = sin xT₁ = xT₃ = x − x³/6T₅
The sine and three of its Maclaurin polynomials. Each one stays with the curve longer than the last: the line y = x only near zero, the degree-5 polynomial across the whole visible hump.
−2−1012⟨−1; 1)
The interval of convergence of Σ xⁿ/n. The radius is 1, so inside (−1; 1) the series converges for certain; each endpoint is settled separately and they give different answers.

Frequently asked questions

Related articles