Solving PDE with Laplace Transform - Non Homogenous ODE Given the following PDE:
$$u_{tt}(x,t)-u_{xx}(x,t)=e^{-t}$$
$$-\infty <x<+ \infty , t>0$$
$$u(x,0)=0,u_t(x,0)=\frac{1}{1+x^2}$$
solve it by using the Laplace transform.
Here's my attempt so far:
Let $$\mathcal L \{u(x,t) \} \equiv U(x,s)\equiv\int_0^\infty u(x,t)e^{-st} \,dt .$$
and the result I've calculated is:
$$U_{xx}(x,s)-s^2 U(x,s) = -\frac{1}{1+x^2}-\frac{1}{s+1}=f(x,s)$$
I've concluded that the relation above is a non-homogenous 2nd order ODE in respect to the variable x. I have tried to solve it but so far it hasn't worked.
Which method do you think would be the best to solve it? Could you provide some guiding steps?
 A: I think initial conditions is
$$u(x,0)=0,u_t(x,0)=\frac{1}{1+x^2}$$
Solve using d’Alembert’s formula  http://www.math.usm.edu/lambers/mat606/lecture12.pdf
I get solution
$$u(x,t) =\frac{\operatorname{atan}\left( x+t\right) -\operatorname{atan}\left( x-t\right) }{2}+e^{-t}+t-1$$
A: So, I solved this the way it asked, by using the Laplace transform.
Continuing from where I left off in the question above, I use the Lagrange method to solve the non homogenous 2nd order linear ODE.
The answer will be in the form:
$$U(x,s)=U_c(x,s)+U_p(x,s)$$
From solving the homogenous part I get the complimentary solution:
$$U_c(x,s)=A(s)e^{sx}+B(s)e^{-sx}$$
But because we need the solution to be finite (since $-\infty<x<\infty$):
$$A(s)=B(s)=0$$
Now, taking the particular solution $U_p(x,s)=C(x,s)e^{sx}+D(x,s)e^{-sx}$, we start by finding the Wronskian and continuing up until we find the derivatives of the factors:
$$C'(x,s)=f(x,s)\frac{e^{-sx}}{2s}$$
$$D'(x,s)=f(x,s)\frac{e^{sx}}{-2s}$$
Then we conclude that $U(x,s)=U_p(x,s)$, while leaving the above in their integral form. Therefore, we can write the following:
$$u(x,t)=\mathcal L^{-1}\{\frac{1}{2s}\int_{-\infty,\infty}(-\frac{1}{1+x'^2}-\frac{1}{1+s})e^{-s|x'-x|}dx'\}$$
By calculating each section of the above we get:
$$\mathcal L^{-1}\{\frac{1}{2s}e^{-s|x'-x|}\}=\frac{1}{2}u_{|x'-x|}(t)$$
and
$$\mathcal L^{-1}\{\frac{1}{2s(s+1)}e^{-s|x'-x|}\}=\frac{1}{2}u_{|x'-x|}(t)-\frac{1}{2}u_{|x'-x|}(t)e^{-t+|x'-x|}$$
where $u_{|x'-x|}(t)$ is the Heaviside function for $c=|x'-x|$. But for $t<|x'-x|=>u_{|x'-x|}(t)=0$, therefore, we limit the solution to where $t\geq|x'-x| => u_{|x'-x|}(t)=1$. That way the new bounds for the integral of $u(x,t)$ are $(x-t,x+t)$.
$$u(x,t)=\frac{1}{2}\int_{(x-t,x+t)}\frac{1}{1+x'^{2}}+1+e^{-t}e^{|x'-x|}dx'$$
and the result is:
$$u(x,t)=\frac{arctan(x+t)-arctan(x-t)}{2}+e^{-t}+t-1$$
which is the same as what @Aleksas Domarkas found by using d'Alambert's formula.
I would say this was solved more easily when tried with a Fourier cosine transform, but since the exercise asked for the Laplace transform I wanted to give the answer just in case anyone else wondered. It's really just a solution to an ODE but I thought the last part was interesting.
