Limitations of D’Alembert solution of wave equation

wave equation

A simple problem for a $1$D-wave equation $$u_{tt} = u_{xx}$$ with conditions \begin{align} u(0,t) &= 0; \\ u(\pi,t) &= 0; \\ u(x,0) &= f(x) = 1 – \cos(2x); \\ u_t &= 0; \end{align}
can be solved using D'Alembert identity, the solution of this equation is $$ \frac{f(x+at)+f(x-at)}{2} = \frac{1 – \cos(2(x+t)) + 1 – \cos(2(x-t))}{2}. $$
Now, if I put $t = \frac{\pi}{2}$ and $x = 0$, I get $u(0,\frac{\pi}{2}) = 4$. This violates the boundary condition $u(0,t) = 0$.

I think this is due to the fact that that $f(x)$ is only defined on the interval between 0 and $\pi$ (and not defined for $x = -\pi$).
This will mean that D'Alembert solution is only defined only on a certain interval of $t$ (so if we want $t$ to go from $-\infty$ to $\infty$, we cannot use this solution?).

Best Answer

The answer lies in the nature of the function $f(x)$, satisfying the boundary the conditions $u(x,0) = f(x)$. Since in this case we use a sine series to solve the wave equation, then $f(x)$ is an odd function. Therefore $f(-\pi/2) = -f(\pi/2)$. Adding them (i.e. $f(\pi/2)+f(-\pi/2)$) results in zero thereby satisfying the boundary condition.

Related Question