Forced wave equation question? I'm studying for my PDEs midterm and trying to do practice problems.  I'm really not sure how to do this question - I've never seen anything like it.  Thanks in advance for your help.
Solve the forced wave equation $u_{tt} = c^2 u_{xx} + f(x,t)$, where $f(x,t) = 1$ if $-x_0 < x < x_0$ and zero otherwise.  Assume the initial conditions are $u(x,0) = u_t(x,0) = 0$.
 A: I will assume that the domain of the problem is $x \in (-\infty,\infty)$ and $t \ge 0$.  Because of the domain in $x$, let's define the Fourier transform of the solution as
$$U(k,t) = \int_{-\infty}^{\infty} dx \, u(x,t) \, e^{i k x}$$
Then the PDE becomes an ODE of the form by applying the FT:
$$\frac{d^2}{dt^2} U(k,t) + c^2 k^2 U(k,t) = F(k)$$
where
$$F(k) = \int_{-\infty}^{\infty} dx \, f(x) \, e^{i k x} = 2 \frac{\sin{k x_0}}{k}$$
and $U$ satisfies $U(k,0)=0$, $U_t(k,0)=0$.  Now define
$$V(k,s) = \int_0^{\infty} dt \, U(k,t) \, e^{-s t} $$
as the Laplace transform of $U$.  This allows us to turn the inhomogeneous ODE in to a simple algebraic equation for $V$:
$$V(k,s) = \frac{F(k)}{s (s^2+c^2 k^2)} $$
Now we invert the Laplace transform to get the solution to the ODE $U$:
$$U(k,t) = \frac{F(k)}{i 2 \pi} \int_{\gamma-i \infty}^{\gamma+i \infty} ds \, \frac{e^{s t}}{s (s^2+c^2 k^2)} $$
This last integral may be evaluated either using residue theory or a lookup table; either way, I get
$$U(k,t) = \frac{2 \sin^2{\frac{k c t}{2}}}{k^2} \frac{2 \sin{k x_0}}{k}$$
Finally, to get the solution to the wave equation $u$, we invert the Fourier transform to get
$$u(x,t) = \frac1{2 \pi} \int_{-\infty}^{\infty} dk \, U(k,t) \, e^{-i k x}$$
Evaluation of this integral may be done either using the residue theorem or the convolution theorem.
