# Solving Wave Equation with strange boundary conditions

I'd wish to solve

\boxed{\begin{align}{\partial_x}^2\,\psi(x,t) - \frac{1}{c^2}{\partial_t}^2\,\psi(x,t) = 0 \qquad (\star)\end{align}}

with somewhat strange boundary conditions:

$$\psi(x,0) = e^{\displaystyle -\dfrac{x^2}{a^2}}\quad \text{and} \quad\partial_t\psi(x,t)|_{t = 0} = 0\\[12pt]$$

$${\textsf{Strange since the conditions depend on the variables itself!}}$$

To tackle this let's use the powerful property of a FT: $$\quad\hat{\psi}(k,t) = \int{\psi(x,t)\,e^{\displaystyle -i\,x\,k}}\,\mathrm{dk}\\[12pt]$$

$$\text{applying it on (\star) brings:}$$

$$\boxed{-k^2\cdot \hat{\psi}(k,t) - \frac{1}{c^2}{\partial_t}^2\,\hat{\psi}(k,t) = 0}\\[12pt]$$

This is an ODE with solutions: $$\\[12pt]$$

$$\boxed{\hat{\psi}(k,t) = A\,e^{\displaystyle i\,\omega\,t}+ B\,e^{\displaystyle -i\,\omega\,t}\quad \text{where} \quad \omega = c\cdot k}\\[12pt]$$

Now how to proceed from here? From a similar problem I adapted:

$$A + B = \hat{\psi}(k,0) = \int{\psi(x,0)\,e^{\displaystyle -i\,x\,k}}\,\mathrm{dx}$$

$$\textsf{But How to treat 2 variables at once?}$$

$$\textbf{Let's just ignore B for a while! \quad (\mathbf{B = 0)}}$$

This will presumably lead to a solution in real space just by taking the inverse FT of $$\hat{\psi}(k,t)$$: $$\\[12pt]$$

$$\boxed{\psi(x,t) = \frac{1}{2\,\pi}\int \underbrace{\color{blue}{A\,e^{\displaystyle i\,\omega\,t}}}_{\color{blue}{\hat{\psi}(k,t)}}\,e^{\displaystyle i\,k\,x}\mathrm{dk} = \frac{1}{2\,\pi}\int \int{\psi(x,0)\,e^{\displaystyle -i\,x\,k}}\,\mathrm{dx}\,e^{\displaystyle i\,\omega\,t}\,e^{\displaystyle i\,k\,x}\mathrm{dk}}\\[12pt]$$

Now substituting the initial condition $$\quad \psi(x,0)\quad$$ (given above!) and solving all the integrals may give:

$$\color{red}{\boxed{\psi(x,t) = e^{\displaystyle -\frac{x^2}{a^2} + i\,\omega\,t}}}$$

Now this solves one of the initial conditions, but not the Wave equation anymore!

I know the steps so far might seem overcomplicated, but does the final solution fails because:

$$\textbf{1)}\quad$$ I miscalculated the Integral$$\\[12pt]$$

$$\textbf{2)}\quad$$ The constant B really matters ?

• There's nothing strange about specifying $\psi(x,0)$ and $\psi_t(x,0)$; in fact, that's the most typical kind of initial conditions you'll ever see for the wave equation, and d'Alembert's formula gives you the solution right away. Feb 2, 2023 at 21:23

As Hans Lundmark pointed out in his comment, it's easier to use d'Alembert's formula for the general solution: $$\psi(x,t)=f(x-ct)+g(x+ct)$$ The boundary condition $$\ \partial_t\psi(x,t)|_{t=0}=0\$$ gives you $$-cf'(x)+cg'(x)=0$$ —that is $$\ f(x)=g(x)+k\$$, where $$\ k\$$ is constant. The boundary condition $$\ \psi(x,0)=e^{-\frac{x^2}{a^2}}\$$ then gives \begin{align} e^{-\frac{x^2}{a^2}}&=f(x)+g(x)\\\ &=2g(x)+k\ , \end{align} —that is \begin{align} g(x)&=\frac{e^{-\frac{x^2}{a^2}}-k}{2}\ ,\\ f(x)&=\frac{e^{-\frac{x^2}{a^2}}+k}{2}\ \text{, and}\\ \psi(x,t)&=\frac{1}{2}\left(e^{-\frac{(x-ct)^2}{a^2}}+e^{-\frac{(x+ct)^2}{a^2}}\right)\ . \end{align}