Differential equation with the boundary conditions I'm preparing for the exam and got stuck when solving the following partial differential equation:
$$\frac{\partial^2u}{\partial t^2}=4\frac{\partial^2u}{\partial x^2}$$
Boundary conditions:
$$u(x,t=0)=0$$
$$\frac{\partial u}{\partial t}(x,t=0)=\sin(x)$$
The domain is $(x,t) \in \mathbb R \times \mathbb R_+$.
As I understand, $D=16>0$, so we have a hyperbolic equation and get this:
$$u(x,t)=f\left(t+\frac{x}{2}\right)+g\left(t-\frac{x}{2}\right)$$
If it is right, what I am supposed to do next? 
 A: $$u(x,t)=f\left(t+\frac{x}{2}\right)+g\left(t-\frac{x}{2}\right)\qquad\text{ is OK.} \tag 1$$
Next you are supposed to determine the functions $f$ and $g$ according to the specified conditions.
First condition : $$\quad u(x,t=0)=0=f\left(0+\frac{x}{2}\right)+g\left(0-\frac{x}{2}\right)$$
$$g\left(-\frac{x}{2}\right)=-f\left(\frac{x}{2}\right)$$
Let $X=-\frac{x}{2} \quad;\quad x=-2X$
$$g(X)=-f\left(\frac{(-2X)}{2}\right)$$
$$g(X)=-f(-X)$$
We put $g(X)$ into equation $(1)$ where $X=t-\frac{x}{2}$ 
thus $g\left(t-\frac{x}{2})\right)=-f\left(-(t-\frac{x}{2})\right)$
$$u(x,t)=f\left(t+\frac{x}{2}\right)-f\left(-t+\frac{x}{2}\right)$$
We can check that $\quad u(x,0)=f\left(\frac{x}{2}\right)-f\left(\frac{x}{2}\right)=0.\quad$ So, the first condition is satisfied.
Second condition :
$$\frac{\partial u}{\partial t}(x,t=0)=\sin(x)$$
With $\frac{\partial u}{\partial t}(x,t)=f'\left(t+\frac{x}{2}\right)+f'\left(-t+\frac{x}{2}\right)$
I suppose that you can proceed on the same manner than above in order to find the function $f$. 
If not, edit what you did and where you faced a difficulty.
HINT : Check your final result which should be 
$$u(x,t)=\frac14\left(\cos(x-2t)-\cos(x+2t) \right)$$
