40. Adv: pointwise vs. uniform convergence of series of functions
§8.1 differentiated a power series term by term without comment, and §8.3 computed \pi by integrating one. Both steps quietly assumed something that was never actually justified: that operations like differentiation and "take the limit" can be swapped in order for an infinite series of functions. This advanced lesson names the missing condition and closes the gap.
Pointwise convergence
A series of functions \sum f_n(x) converges pointwise to S(x) on a domain if, for every individual x in that domain, the numerical series \sum f_n(x) converges to S(x) — exactly §7.2's definition, applied separately at each point. This is the notion of convergence every test in Module 7 and §8.0 has used so far.
Pointwise convergence is weaker than it sounds. The rate of convergence is allowed to be completely different from one x to the next — arbitrarily slow near some points, fast near others — as long as convergence eventually happens everywhere.
A concrete failure: convergent but not "nicely" so
Consider the sequence f_n(x)=x^n on [0,1] (a sequence, for simplicity — the same idea applies to the partial sums of a series). For each fixed x<1, x^n\to0 (§7.0's geometric decay); at x=1, x^n=1 for every n. So f_n converges pointwise to
S(x)=\begin{cases}0&0\le x<1\\1&x=1\end{cases}
Every f_n is continuous, but the limit S is not — it jumps at x=1. This is the central warning of the lesson: a pointwise limit of continuous functions need not be continuous, and by extension, term-by-term differentiation or integration of a pointwise-convergent series can silently produce wrong answers, because the limit function doesn't have to inherit the good behavior of the terms.
Uniform convergence
Uniform convergence demands a single rate that works for every x in the domain simultaneously:
\sum f_n(x)\text{ converges uniformly to }S(x)\text{ if }\sup_x|S_N(x)-S(x)|\to0\text{ as }N\to\infty
— the worst-case error across the whole domain must shrink to zero, not just the error at each individual point. In the x^n example above, the worst-case error at "stage N" is always exactly 1 (look at x values extremely close to 1: x^N stays close to 1 for a long time, however large N is, before eventually dropping) — the convergence is pointwise but not uniform.
Uniform convergence is what actually justifies the operations §8.1 and §8.3 used freely:
If \sum f_n converges uniformly and each f_n is continuous, the sum S(x) is continuous. If each f_n is differentiable and \sum f_n'(x) converges uniformly, then S'(x)=\sum f_n'(x) — term-by-term differentiation is valid. Term-by-term integration works under the analogous condition.
The Weierstrass M-test: the practical tool
Checking uniform convergence directly from the definition is awkward. The Weierstrass M-test makes it routine:
If |f_n(x)|\le M_n for every x in the domain, and \sum M_n converges (as an ordinary numerical series, checkable with any Module 7 test), then \sum f_n(x) converges uniformly on that domain.
Why this works: it's direct comparison (§7.7) applied uniformly — the same bound M_n works at every x at once, so the tail \left|\sum_{n>N}f_n(x)\right|\le\sum_{n>N}M_n is small for every x simultaneously, the moment the numerical tail \sum_{n>N}M_n is small.
This is exactly why power series behave so well strictly inside their radius of convergence. For a power series with radius R, and any r<R, on the interval [a-r,a+r] every term satisfies |c_n(x-a)^n|\le|c_n|r^n=M_n, and \sum M_n converges absolutely by the same ratio-test argument that established R in the first place (§8.0). The M-test then guarantees uniform convergence on [a-r,a+r] — which is precisely what licenses the term-by-term differentiation §8.1 used to derive the Taylor coefficient formula, and the term-by-term integration §8.3 used implicitly when integrating the geometric series to get \arctan x's series.
Doing it in Python
Watching x^n fail to converge uniformly — same N, wildly different distance from the limit depending on how close x is to the problem point x=1:
print(f"{'N':>5} {'x=0.5':>14} {'x=0.99':>14}")
for N in (10, 50, 100, 500):
print(f"{N:>5} {0.5**N:>14.6e} {0.99**N:>14.6f}")
print("\nat x=0.5, essentially converged by N=10")
print("at x=0.99, still far from 0 even at N=500 -- no single N works for all x")
Confirming the Weierstrass M-test for \sum\frac{x^n}{n^2} on [-1,1] — bounding every term uniformly and checking the resulting numerical series:
import sympy as sp
n = sp.Symbol('n', positive=True, integer=True)
# for x in [-1,1], |x^n/n^2| <= 1/n^2 = M_n, regardless of x
M_series = sp.summation(1/n**2, (n, 1, sp.oo))
print(f"sum of M_n = sum(1/n^2) = {M_series}")
print("finite -- so sum(x^n/n^2) converges uniformly on all of [-1,1]")
print("(including both endpoints, matching the interval-of-convergence result from 8.0)")
Confirming term-by-term differentiation actually reproduces the correct derivative for a power series safely inside its radius of convergence:
import sympy as sp
x = sp.Symbol('x')
f = 1 / (1 - x) # sum x^n, R = 1
series_terms = [x**n for n in range(15)]
term_by_term_derivative = sum(sp.diff(t, x) for t in series_terms)
direct_derivative = sp.diff(f, x)
test_point = sp.Rational(1, 2) # well inside R=1
print(f"term-by-term derivative at x=0.5 (15 terms): {float(term_by_term_derivative.subs(x, test_point)):.6f}")
print(f"true derivative 1/(1-x)^2 at x=0.5: {float(direct_derivative.subs(x, test_point)):.6f}")
Worked example
Show that \displaystyle\sum_{n=1}^\infty\frac{\cos(nx)}{n^2} converges uniformly for every real x, using the Weierstrass M-test.
For every real x and every n, |\cos(nx)|\le1 (cosine is always bounded by 1, regardless of its argument), so:
\left|\frac{\cos(nx)}{n^2}\right|\le\frac1{n^2}=M_n
\sum M_n=\sum\frac1{n^2} is a convergent p-series (p=2>1, §7.6).
\boxed{\text{converges uniformly on all of }\mathbb R\text{, by the Weierstrass M-test}}
Sanity check. This series has nothing to do with a power series (it's not even built from powers of x — it's a Fourier series, the subject of §8.5, next), yet the M-test applies identically: it never needed the series to be a power series at all, only a uniform bound whose own series converges. Because the bound \frac1{n^2} doesn't depend on x whatsoever, the same single argument certifies uniform convergence everywhere, not just on some bounded sub-interval — a much stronger conclusion than what §8.0's radius-of-convergence argument could offer a typical power series. ✓
Your turn
1. Show that \displaystyle\sum_{n=1}^\infty\frac{\sin(nx)}{2^n} converges uniformly for every real x, using the Weierstrass M-test.
2. The power series \sum\frac{x^n}{n^2} has R=1 (check with the ratio test if you'd like to confirm). Explain why the M-test argument in the worked-example style used above for \sum\frac{\cos(nx)}{n^2} can also certify uniform convergence on the entire closed interval [-1,1] for this power series — not just on a smaller [-r,r] with r<1.
3. True or false: if \sum f_n(x) converges pointwise to a continuous function S(x), the convergence must be uniform.
Solutions
1. |\sin(nx)|\le1 for every real x and n, so \left|\frac{\sin(nx)}{2^n}\right|\le\frac1{2^n}=M_n. \sum\frac1{2^n} is a convergent geometric series (§7.3, r=\frac12<1). By the Weierstrass M-test, \boxed{\text{converges uniformly on all of }\mathbb R}.
2. On [-1,1], |x|\le1 for every point in the domain, so \left|\frac{x^n}{n^2}\right|\le\frac{1^n}{n^2}=\frac1{n^2}=M_n — the bound doesn't need |x|<1 strictly, since \frac1{n^2} already accounts for the worst case |x|=1. \sum\frac1{n^2} converges, so the M-test certifies uniform convergence on the full closed interval, endpoints included — matching §8.0's finding that this particular series' interval of convergence is [-1,1], both endpoints included.
3. False. The M-test gives a sufficient condition for uniform convergence, never a necessary one, and the implication does not run backwards: pointwise convergence to a continuous limit doesn't force uniformity. (The x^n example in the concept section shows the contrapositive — a discontinuous limit definitely rules out uniform convergence — but a continuous limit doesn't rule uniform convergence in either; there exist sequences of continuous functions converging pointwise to a continuous limit without ever converging uniformly. Uniformity is a strictly stronger, separately-checkable condition, not something that comes for free once the limit happens to look nice.)
Check yourself in code
Verify the Weierstrass M-test bound for \sum\frac{x^n}{n^2} on [-1,1] by computing \sum\frac1{n^2} with SymPy.
Print exactly this:
sum of M_n = sum(1/n^2) = pi**2/6
import sympy as sp
n = sp.Symbol('n', positive=True, integer=True)
M_series = sp.summation(1/n**2, (n, 1, sp.oo))
print("sum of M_n = sum(1/n^2) = ...")
import sympy as sp
n = sp.Symbol('n', positive=True, integer=True)
M_series = sp.summation(1/n**2, (n, 1, sp.oo))
print(f"sum of M_n = sum(1/n^2) = {M_series}")
Pointwise convergence only guarantees that each individual point eventually settles down, at whatever rate it happens to; uniform convergence demands one rate that works everywhere at once, and it's the condition that actually licenses swapping a limit with differentiation, integration, or continuity — the steps §8.1 and §8.3 used without pausing to justify. The Weierstrass M-test turns this into a routine check: bound every term by a number M_n independent of x, confirm \sum M_n converges by any Module 7 test, and uniform convergence follows immediately — exactly the argument that makes power series trustworthy to differentiate and integrate term by term, strictly inside their radius of convergence.
Next: a first look at Fourier series — the \sum\frac{\cos(nx)}{n^2}-style series from this lesson's worked example, generalized into a way to build any periodic function out of sines and cosines.