Expressing a constant function in terms of a Fourier sine series (for initiaal boundary problem in wave equation)

fourier analysisfourier seriespartial differential equations

So my question is motivated by the following initial boundary problem for the wave equation:

\begin{align}
u_{tt} &= u_{xx} \\
u(t, 0) &= u(t, \pi) = 0 \\
u(0, x) &= 1 \\
u_t(0, x) &= 0
\end{align}

It should be a very simple example but I seem to be missing something. The exercise is explictly asking to write the solution in the form of Fourier series (so no d'Alemebert formula I guess).

After some very straight forward calculations I conclude that the solution must be of the form

$$\sum_{n = 1}^{\infty} b_n \cos(nt) \sin(nx) + d_n \sin(nt) \sin(nx)$$

The condition $u_t(0, x) = 0$ clearly forces all $d_n$ to be $0$. So now I only need to satisfy

$$u(0,x) = \sum_{n = 1}^{\infty} b_n \sin(nx) = 1$$

If I try to compute the Fourier sine coefficients, they are, of course, all $0$, as it happens with any constant function where the Fourier series is just the constant itself.

Is this really the way I'm supposed to solve the equation? And, in such case, what am I doing wrong?

Best Answer

Your solution seems to be correct up until trying to make sense of the initial condition $u(0,x)=1$. Indeed, what you need to do next is to compute the Fourier series of 1. Then, you will be able to identify the coefficients $b_n$. Because the boundaries conditions are given at $x=0$ and $x=\pi$, and because the solution contains $\sin(nx)$, an odd half range Fourier series should be used:

$$1=\sum_{n=1}^\infty c_n\sin(nx),$$

where, by definition,

$$c_n=\frac{2}{\pi}\int_0^{\pi}1\cdot\sin(nx)dx=\frac{2}{\pi}\left[-\frac{\cos(nx)}{n}\right]_0^{\pi}=\frac{2(1-(-1)^n)}{n\pi},$$

so that

$$1 = \sum_{n=1}^{\infty}\frac{2(1-(-1)^n)}{n\pi}\sin(nx).$$

Then, the initial condition becomes

$$u(0,x)=\sum_{n=1}^{\infty}b_n\sin(nx)=1=\sum_{n=1}^{\infty}\frac{2(1-(-1)^n)}{n\pi}\sin(nx),$$

from which you can easily identify that

$$b_n=\frac{2(1-(-1)^n)}{n\pi}.$$

I.e the Fourier coefficients are not all zero as you originally suggested.