I have to solve the follwing wave equation
$$\frac{\partial^{2}u}{\partial t^{2}}=4\frac{\partial^{2}u}{\partial x^{2}}$$
with the boundary conditions
$$u(x,t=0)=0, \quad \frac{\partial u}{\partial t}(x,t=0)=\sin(x)$$
in the domain $(x,t)\in\mathbb{R}\times\mathbb{R_{+}}$. To solve this I tried to use the D'Alembert solution since the general solution for the simple wave equation is
$$u(x,t)=f(x+2t)+g(x-2t)$$
Then using the initial conditions
\begin{align} u(x,t=0) &=0 \\ &=f(x)+g(x) \\ u_{t}(x,t=0) &=\sin(x) \\ &=2[f'(x)-g'(x)] \end{align}
Differentiating the first equation we have the following system
\begin{align} 0 &= f'+g' \\ \frac{\sin(x)}{2} &= f'-g' \end{align}
and solving for $f'$ and $g'$, we find
$$f' = \frac{\sin(x)}{4}, \quad g' = -\frac{\sin(x)}{4}$$
Then we have that
\begin{align} f(x+2t) &= \frac{1}{4}\int_{0}^{x+2t}\sin(z)dz+A \\ g(x-2t) &= -\frac{1}{4}\int_{0}^{x-2t}\sin(z)dz+B \\ \end{align}
As $0 = f(x+2t)+g(x-2t)$, then $A+B=0$ gives us the following solution
\begin{align} u(x,t) &=\frac{1}{4}\int_{x-2t}^{x+2t}\sin(z)dz \\ &=\frac{\cos(x-2t)-\cos(x+2t)}{4} \\ &=\sin(x)\frac{\sin(2t)}{2} \end{align}
I would like to know if my solution is correct and if there is another, faster way to solve this equation.