We can solve the wave equation u_tt = u_xx on the interval [0,1] with the Dirichlet boundary conditions u(0,t) = u(1,t) = 0 and the initial conditions u(x,0) = 1 and u_t(x,0) = 0 in two different ways.

Using the method of reflections, we find the solution u(x,t) to be piecewise constant in different regions of its domain bounded by characteristic lines (notice that the solution has a singularity along these characteristics).

Using the general series solution, if we know that
1 = Sum_(n odd) 4/(n pi) sin(n pi x)       (picture)

then
u(x,t) = Sum_(n odd) 4/(n pi) sin(n pi x) cos(n pi t)


These two solutions are the same (away from the singularities)! For example, at t = 1/4, we found from the method of reflections that u(x, 1/4) = 0 if 0 < x < 1/4 and if 3/4 < x < 1, but u(x, 1/4) = 1 if 1/4 < x < 3/4. The series solution at t =1/4 is
u(x,1/4) = Sum_(n odd) 4/(n pi) sin(n pi x) cos(n pi / 4)

Here are some pictures of the sum of only the first N terms of this series (for various N). Notice that the more terms we use, the closer the sum becomes to the right answer.

Let phi(x) be the function that equals 1 on (1/4,3/4) and is 0 on the rest of the interval [0,1] (basically, phi(x) is the function u(x,1/4) above.) Here's another picture of the function first 20 terms in Fourier series that converges to phi(x) (at all the points where it's continuous). Notice that at x=1/4 and at x=3/4, the series is actually converging to the number 1/2 (the average of 1 and 0)! Of course, if we plot the sine series on the whole real line, it is approximating the odd periodic extension of phi(x): picture.

The convergence is not uniform! Notice for points close to x=1/4, it takes a very long time for the series to converge to 0 or 1. Here's a table that illustrates the convergence at 1/4 and at some points near 1/4.