So far we have only considered the method of separation of variables for the diffusion equation on the spatial interval Œ0; 1. What about other intervals, say, Œ0; L, where L is a positive constant? Can we generalize the theory developed above to handle such cases? We will now investigate this question
(a) Let l and k be two positive integers. Show that
(b) Assume that f is a function defined on .0; L/. We want to compute the Fourier sine coefficients of this function on this interval. That is, we want to compute constants c1; c2;::: such that
(c) Show by differentiation that the function
(d) Compute the Fourier sine series of the function
(e) Write a computer program that graphs an approximation of the formal solution that you derived in (d). The program should take L, T , and N as input parameters and plot the N partial sum uN .x; T /, x 2 .0; L/, of the Fourier series of the formal solution, see (8.80).
(f) Derive and implement an explicit finite difference scheme for (8.93)–(8.95). The program should take the discretization parameters
and the time T (the time at which we want to evaluate the solution) as input parameters. The code should plot an approximation of
Compare the results with those obtained in (e).