Initial Boundary value problem Please guide me the general solution of the equation in format $u_{tt} - u_{xx} = g(x,t)$
I am familiar with the solution of $u_{tt}-u_{xx}$ however the RHS  is little confusing.
I have attached the exact problem where i need to implement this.enter image description here
 A: The reference for the following is H. F. Weinberger: "A First Course in Partial Differential Equations" section 5 "The Nonhomogeneous Wave Equation." 
Consider the problem: $u_{tt}-c^2u_{xx}=F(x,t)$ for $t>0$ together with the initial conditions $u(x,0)=f(x)$ and $u_t(x,0)=g(x)$. The corresponding d'Alembert solution is 
$u(x,t)=\frac{1}{2}[f(x+ct)+f(x-ct)]+\frac{1}{2c}\int_{x-ct}^{x+ct} \! g(\xi) \, \mathrm{d}\xi + \frac{1}{2c}\int_{0}^{t}\int_{x-c(t-\eta)}^{x+c(t-\eta)} \! F(\xi,\eta) \, \mathrm{d}\xi \mathrm{d}\eta $
To deal with fixed boundary conditions, we extend the functions $F(x,t)$, $f(x)$, and $g(x)$ as odd functions about $x=0$ and $x=L$. That is, we extend the domain of definition of these functions from $[0,L]$ to $[-L,3L]$ by the formulas $f(x)=-f(-x)$ for negative values of $x$ and $f(x)=-f(2L-x)$ for $L\leq x\leq 3L$, then repeat this process indefinitely until the functions are defined for all  $x\in\mathbb{R}$. This process is called odd periodic extension. 
For example, the odd periodic extension of the function $h(x)=x$ for $0\leq x\leq L$ is a saw-tooth wave with period and amplitude $2L$. The range of the wave is $[-L,L]$. 
This is assuming a d'Alembert solution is satisfactory. You can also find a solution by Fourier transforms which may or may not be easier. 
