Power Series
A power series is a polynomial with infinitely many terms. Where it converges it defines a function, and the set of where it converges is always an interval centred at a single point. This lesson proves that, computes radii of convergence, and treats power series as generating functions for sequences.
For a gentler first pass, see Power Series.
Definition
A power series centred at is
For each fixed it is an ordinary series of numbers, so every test from Strategy for Testing Series applies. The question is: for which does it converge?
The radius of convergence theorem
Theorem. For a power series exactly one of these holds:
- it converges only at (radius );
- it converges absolutely for every ();
- there is such that it converges absolutely for and diverges for .
At the endpoints anything can happen, so each endpoint is checked separately.
Key lemma (Abel). If converges for some , then converges absolutely for every (take to simplify).
Proof. Since converges, its terms tend to 0, so they are bounded: for all . Then
and , so the right side is a convergent geometric series. Comparison gives absolute convergence. ∎
The contrapositive says: if the series diverges at , it diverges for all . Now let be the supremum of the at which the series converges. Abel's lemma gives convergence inside , its contrapositive gives divergence outside, and that is the theorem.
Computing R
The ratio test applied to the terms, with fixed, is the usual tool:
The general formula, which needs no limit to exist, is Cauchy–Hadamard: . It comes from the root test in Absolute Convergence and the Ratio and Root Tests.
| Series | Interval of convergence | |
|---|---|---|
| 1 | : both endpoints have terms , which do not tend to 0 | |
| 1 | : harmonic at 1, alternating harmonic at −1 | |
| 1 | : absolutely convergent at both ends | |
| all real | ||
| 0 | only | |
| 2 |
The first three rows share yet differ at the endpoints, which is why endpoint checks are a separate step.
import sympy as sp
n = sp.symbols("n", integer=True, positive=True)
x = sp.symbols("x")
def radius(c):
return sp.limit(sp.Abs(c / c.subs(n, n + 1)), n, sp.oo)
print("R for x^n/n :", radius(1 / n))
print("R for x^n/n! :", radius(1 / sp.factorial(n)))
print("R for n! x^n :", radius(sp.factorial(n)))
print("R for (x-3)^n/(2^n n):", radius(1 / (2**n * n)))
print("endpoint x=1:", sp.Sum((1 - 3) ** n / (2**n * n), (n, 1, sp.oo)).is_convergent(),
"| endpoint x=5:", sp.Sum((5 - 3) ** n / (2**n * n), (n, 1, sp.oo)).is_convergent())R for x^n/n : 1
R for x^n/n! : oo
R for n! x^n : 0
R for (x-3)^n/(2^n n): 2
endpoint x=1: True | endpoint x=5: False
At the series becomes (converges), at it becomes (diverges): interval .
What happens near the boundary
Inside the interval the partial sums settle quickly; near they converge slowly, and outside they blow up. Here are partial sums of at three points:
import numpy as np
import matplotlib.pyplot as plt
xs = np.linspace(-0.95, 0.95, 400)
plt.figure(figsize=(6, 4))
for N in (2, 5, 10, 30):
plt.plot(xs, sum(xs**k for k in range(N + 1)), label=f"S_{N}")
plt.plot(xs, 1 / (1 - xs), "k--", label="1/(1 − x)")
plt.ylim(-1, 12); plt.legend(); plt.title("Partial sums of ∑ xⁿ")
for x0 in (0.5, 0.9, 1.1):
s = [sum(x0**k for k in range(N + 1)) for N in (10, 50, 100)]
print(f"x={x0}: S_10={s[0]:.6g} S_50={s[1]:.6g} S_100={s[2]:.6g}")x=0.5: S_10=1.99902 S_50=2 S_100=2
x=0.9: S_10=6.86189 S_50=9.95362 S_100=9.99976
x=1.1: S_10=18.5312 S_50=1281.3 S_100=151577
Generating functions
A power series is also a way to package a whole sequence into one function: the sequence becomes the coefficients of . Algebra on then says things about the sequence.
The Fibonacci numbers , , satisfy
The radius of convergence is the distance from 0 to the nearest root of , which is ( the golden ratio). Partial fractions on give Binet's formula with , so grows like and . The same growth rate is why naive recursive fib(n) makes about calls.
import sympy as sp
x = sp.symbols("x")
G = x / (1 - x - x**2)
print("series:", sp.series(G, x, 0, 10))
print("roots of 1 − x − x²:", [sp.nsimplify(r) for r in sp.solve(1 - x - x**2, x)])
print("1/φ =", float((sp.sqrt(5) - 1) / 2))series: x + x**2 + 2*x**3 + 3*x**4 + 5*x**5 + 8*x**6 + 13*x**7 + 21*x**8 + 34*x**9 + O(x**10)
roots of 1 − x − x²: [-1/2 + sqrt(5)/2, -sqrt(5)/2 - 1/2]
1/φ = 0.6180339887498949
O(x**10) is SymPy's way of writing "terms of degree 10 and higher". Generating functions like this are a standard tool for counting problems and recurrences in algorithm analysis (Discrete Mathematics), and the probability generating function packages a whole discrete distribution into one power series (Probability).
Exercises
Exercise 1: Radius and interval
Find the interval of convergence of .
Answer
, interval .
Solution
Exercise 2: Radius from the coefficients
Find for .
Answer
.
Solution
import sympy as sp
n = sp.symbols("n", integer=True, positive=True)
c = sp.factorial(2 * n) / sp.factorial(n) ** 2
print(sp.limit(c / c.subs(n, n + 1), n, sp.oo))1/4
Exercise 3: Only even powers
Find the radius of convergence of .
Answer
.
Solution
It is geometric in , so it converges iff , that is . The formula does not apply directly because every odd coefficient is 0; treat the series as a function of (or use the ratio test on the nonzero terms).
Exercise 4: A generating function
The sequence with (Tower of Hanoi moves) has generating function . Show , find , and check the first coefficients with SymPy.
Answer
, , coefficients .
Solution
import sympy as sp
x = sp.symbols("x")
A = x / ((1 - x) * (1 - 2 * x))
print(sp.series(A, x, 0, 7))x + 3*x**2 + 7*x**3 + 15*x**4 + 31*x**5 + 63*x**6 + O(x**7)
Test yourself
A power series centred at 0 converges at and diverges at . Which is certain?
- It converges at
- It converges absolutely at
- It diverges at
What is the interval of convergence of ?
Why does have radius of convergence ?
- Because
- It is the distance from 0 to the nearest zero of the denominator
- Every rational function has
- Because the coefficients are integers