# Derivation of inhomogeneous wave equation

Given an inhomogeneous wave equation on the whole line \begin{align} &u_{tt}-c^2u_{xx}=f(x,t),\\ &u(x,0)=0,\\ &u_t(x,0)=0. \end{align} The solution formula is $$u(x,t)=\frac{1}{2c}\int_{0}^{t}\int_{x-c(t-s)}^{x+c(t-s)}f(y,s)\,dy\,ds.$$ I have trouble with the derivation of the above formula. I wrote the wave equation as $$u_t+cu_x=v,\,v_t-cv_x=f.$$ It follows that \begin{align} &u(x,t)=\int_{0}^{t}v(x-ct+cs,s)\,ds,\\ &v(x,t)=\int_{0}^{t}f(x+ct-cs,s)\,ds. \end{align} Then I substituted $v(x,t)$ into $u(x,t)$ but I am unable to get the solution formula after changing the variables. In particular, I have computed the Jacobian to be $\frac{1}{2c}$ but I am unable to get the upper and lower limits of the integral.

You probably failed to reverse the order of integration. Change the integration variable to $r$ on the $u$ integration:

$$u(x,t)=\int_{0}^{t}v(x-ct+cr,r)\,dr$$ and substitute in the expression for $v$:

$$v(x-ct+cr,r)=\int_{0}^{r}f(x-ct+cr+cr-cs,s)\,ds = \int_{0}^{r}f(x-ct-cs+2cr,s)\,ds.$$

Then

$$u(x,t) =\int_{0}^{t}\int_{0}^{r}f(x-ct - cs +2cr,s)\,dsdr$$

But note in this expression that we are integrating with $s$ first, then with $r$ second. But in your target form, the integration is $y$ first, $s$ second. So we need to reverse the order. In this form, $0 \le r \le t$ and $0 \le s \le r$. So $r$ and $s$ can vary from $0$ to $t$, but always $r \ge s$. If we choose $s$ first, then $s \le r \le t$ are the limits on $r$: $$u(x,t) =\int_{0}^{t}\int_{s}^{t}f(x-ct - cs +2cr,s)\,drds$$

Now you will find that the substitution $y = x-ct - cs +2cr$ gives the correct limits.