# Wave equation and multiple boundary conditions

#### Markov

##### Member
I need to apply D'Lembert's method but in this case I don't know how. How to proceed?

Determine the solution of the wave equation on a semi-infinite interval $u_{tt}=c^2u_{xx},$ $0<x<\infty,$ $t>0,$ where $u(0,t)=0$ and the initial conditions:

\begin{aligned} & u(x,0)=\left\{ \begin{align} & 0,\text{ }0<x<2 \\ & 1,\text{ }2<x<3 \\ & 0,\text{ }x>3 \\ \end{align} \right. \\ & {{u}_{t}}(x,0)=0. \\ \end{aligned}

#### Sudharaka

##### Well-known member
MHB Math Helper
I need to apply D'Lembert's method but in this case I don't know how. How to proceed?

Determine the solution of the wave equation on a semi-infinite interval $u_{tt}=c^2u_{xx},$ $0<x<\infty,$ $t>0,$ where $u(0,t)=0$ and the initial conditions:

\begin{aligned} & u(x,0)=\left\{ \begin{align} & 0,\text{ }0<x<2 \\ & 1,\text{ }2<x<3 \\ & 0,\text{ }x>3 \\ \end{align} \right. \\ & {{u}_{t}}(x,0)=0. \\ \end{aligned}
Hi Markov,

The d'Alembert's solution for the wave equation, $$u_{tt}=c^2u_{xx}$$ can be written as,

$u(x,t)=\frac{1}{2}u(x-ct,\,0)+\frac{1}{2}u(x+ct,\,0)-\frac{1}{2c}\int_{x-ct}^{x+ct}u_{t}(s,\,0)\,ds$

Since, $$u_{t}(x,0)=0$$ we get,

$u(x,t)=\frac{1}{2}u(x-ct,\,0)+\frac{1}{2}u(x+ct,\,0)$

Case I: When $$0<x-ct<2\mbox{ or }x-ct>3$$

$u(x,t)=0$

Case II: When $$2<x-ct<3$$

$u(x,t)=1$

Kind Regards,
Sudharaka.