Skip to content
Tutorials Center
My learning

Topics

Lesson 39 of 68 ยท Series, Transforms and PDEs

Sequences and Infinite Series

Learn sequences, partial sums and infinite series: geometric and p-series, the ratio, comparison and alternating tests, power series and radius of convergence.

Can you add infinitely many numbers and get a finite answer? Sometimes yes: 1/2 + 1/4 + 1/8 + ... adds up to exactly 1. Sometimes no: 1 + 1/2 + 1/3 + 1/4 + ... grows without bound, although its terms shrink to zero. Telling the two cases apart is the subject of this lesson, and it matters because nearly every tool later in this chapter (Fourier series, Laplace transforms, PDE solutions) is an infinite sum.

You already met one infinite sum in Taylor and Maclaurin Series. Here we ask the question that lesson postponed: for which x does such a sum actually converge?

Sequences

A sequence is an ordered list of numbers a_1, a_2, a_3, ..., usually given by a formula for a_n. A sequence converges to L if a_n gets and stays as close to L as you like once n is large enough. This is the limit idea from Limits: The Core Idea, with n going to infinity.

  • a_n = 1/n converges to 0.
  • a_n = (1 + 1/n)**n converges to e.
  • a_n = (-1)**n bounces between -1 and 1 and does not converge.
  • a_n = n**2 grows without bound, so it diverges.

Engineers meet sequences constantly: every iterative algorithm (Newton's method, a simulation loop) produces one, and "does it converge?" is the first question you ask of it.

Series and partial sums

A series is the sum of a sequence: S = a_1 + a_2 + a_3 + .... Since we cannot literally add forever, we define the meaning through partial sums:

S_N = a_1 + a_2 + ... + a_N

The series converges to S when the sequence of partial sums S_1, S_2, S_3, ... converges to S. Otherwise it diverges. Everything reduces to a sequence question about the partial sums.

flowchart LR
    A["terms a_n"] --> B["partial sums S_N"]
    B --> C{"S_N settles?"}
    C -->|"yes"| D["series converges to S"]
    C -->|"no"| E["series diverges"]

A series is judged by what its running total does, not by its individual terms.

Python Partial sums of three series

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The first two settle (to 1 and to pi**2/6, about 1.6449). The harmonic series keeps creeping upward: it grows roughly like ln N, slowly but forever.

A first test: do the terms go to zero?

If a series converges, its terms must shrink to zero. The reverse is false, and the harmonic series is the classic counterexample. So the logic is one-directional:

  • If a_n does not tend to 0, the series diverges (the divergence test).
  • If a_n tends to 0, you learn nothing yet; you need another test.

Never conclude "converges" from "terms go to zero".

Two families to know by heart

Geometric series. a + a*r + a*r**2 + ... converges exactly when |r| < 1, and then its sum is

a / (1 - r)

For a = 1, r = 1/2 this gives 2 (starting at n = 0), or 1 if you start at n = 1. Geometric series show up in discounting, signal decay and the geometric-type Taylor series 1/(1 - x).

p-series. 1/1**p + 1/2**p + 1/3**p + ... converges when p > 1 and diverges when p <= 1. The harmonic series is p = 1, the borderline case that just barely diverges.

The main convergence tests

Most series are compared with one of the families above, or tested with one of these tools.

Comparison test. If 0 <= a_n <= b_n and sum b_n converges, then sum a_n converges. If a_n >= b_n >= 0 and sum b_n diverges, then sum a_n diverges. For example, 1/(n**2 + 1) < 1/n**2, and the p-series with p = 2 converges, so our series converges.

Ratio test. Compute L = lim |a_(n+1) / a_n|. If L < 1 the series converges (absolutely), if L > 1 it diverges, and if L = 1 the test says nothing. It works beautifully on factorials and exponentials, such as sum x**n / n!.

Alternating series test. If the signs alternate, the terms decrease in size and tend to 0, then the series converges. This is why 1 - 1/2 + 1/3 - 1/4 + ... converges (to ln 2) even though the all-positive version diverges. A bonus: the error after N terms is no bigger than the first omitted term.

Integral test. If f(x) is positive and decreasing and a_n = f(n), then sum a_n and the improper integral of f from 1 to infinity converge or diverge together. That is how the p-series rule is proved, and it connects directly to Improper Integrals and Convergence.

Absolute vs conditional convergence. A series converges absolutely if sum |a_n| converges. The alternating harmonic series converges, but not absolutely, so it is only conditionally convergent. Absolutely convergent series are the well-behaved ones: you may reorder their terms freely. Reordering a conditionally convergent series can change the sum.

Python Letting sympy decide

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The ratio for n/2**n tends to 1/2, which is below 1, so that series converges. Use is_convergent() as a check on your own reasoning rather than a replacement for it.

Power series

A power series has a variable inside it:

c_0 + c_1*(x - a) + c_2*(x - a)**2 + ...

Taylor series are power series. For each x it is an ordinary series of numbers, so the question becomes: for which x does it converge? The answer is always an interval centred at a, with half-width R, the radius of convergence:

  • inside |x - a| < R the series converges (absolutely),
  • outside |x - a| > R it diverges,
  • at the two endpoints you must test separately.

The ratio test finds R. For the coefficients, R = lim |c_n / c_(n+1)| when that limit exists. For e**x the coefficients are 1/n!, so c_n / c_(n+1) = n + 1 and R is infinite. For 1/(1 - x) all coefficients are 1, so R = 1.

flowchart LR
    A["x far left<br/>diverges"] --- B["a - R<br/>test endpoint"]
    B --- C["inside interval<br/>converges"]
    C --- D["a + R<br/>test endpoint"]
    D --- E["x far right<br/>diverges"]

The interval of convergence is centred at a; only the two endpoints need separate checks.

Python Estimating a radius of convergence

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The ratios settle near 1, 1, 3, and grow without limit, giving radii of 1, 1, 3 and infinity. Inside the radius the 60-term sum matches 1/(1 - x); at x = 1.2 it explodes.

Why this matters for engineers

Power series turn hard functions into polynomials you can differentiate, integrate and add term by term inside the radius of convergence. That gives solutions to differential equations (the Bessel functions of circular drums come from series), error estimates for truncated sums, and the Fourier series of the next lesson, where the sum is over sines and cosines instead of powers of x.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. A series has terms a_n that tend to 0. What can you conclude?

    Terms tending to 0 is necessary but not sufficient. The harmonic series 1 + 1/2 + 1/3 + ... has terms tending to 0 and still diverges.
  2. 2. For which values of r does the geometric series a + ar + ar**2 + ... converge?

    It converges exactly when |r| < 1, and the sum is a / (1 - r). For r = -2, for example, the terms grow, so it diverges even though r < 1.
  3. 3. The ratio test gives lim |a(n+1)/a(n)| = 1. What does it tell you?

    L = 1 is the borderline case where the ratio test says nothing. The p-series sum 1/n and sum 1/n**2 both give L = 1, yet one diverges and one converges.
  4. 4. What is the radius of convergence of the Maclaurin series of e**x?

    The coefficients are 1/n!, so the ratio c_n/c_(n+1) = n + 1 grows without limit. The series converges for every real x.
  5. 5. Why does the alternating harmonic series 1 - 1/2 + 1/3 - ... converge?

    That is exactly the alternating series test. It converges only conditionally, because the series of absolute values is the divergent harmonic series.

Summary

  • A series converges when its partial sums S_N settle to a limit; the terms tending to 0 is necessary but never enough.
  • Geometric series converge for |r| < 1 (sum a/(1 - r)); p-series converge for p > 1.
  • Use comparison, ratio, alternating and integral tests; the ratio test is the workhorse for factorials and powers.
  • A power series converges on an interval around its centre, of half-width R; test the endpoints separately.
  • sympy's Sum(...).is_convergent() and summation() are good for checking your work.

Next: Fourier Series.