(a) Solution to equation is
\begin{equation}
u(x,t)=\phi(x+t)+\psi(x-t)
\label{eq-3-5}
\end{equation}
with unknown functions $\phi$ and $\psi$. Plugging into initial conditions we get
\begin{gather*}
\phi(x)+\psi(x)=0, \quad \phi'(x)-\psi'(x)=0\implies \phi(x)=\psi(x)=0 \qquad x>0
\end{gather*}
and $u(x,t)=\sin(x+3t)$ as $x>t$.
(b) Plugging into boundary condition we get $\psi (2-2\sqrt{t+1}-t)= t$ as $t>0$. For $t>0$
$2-2\sqrt{t+1}-t$ is a monotone decreasing function, from $0$ to $-\infty$. Solve:
$$
x=-2-2\sqrt{t+1}-t\implies (\sqrt{t+1}+1)^2 = -x\implies \sqrt{t+1}=\sqrt{1-x}-1\implies
t=-1+(\sqrt{1-x}-1)^2,
$$
and therefore $\psi(x)=-1+(\sqrt{1-x}-1)^2$ for $x<0$ and finally
$$
u(x,t)=-1+(\sqrt{1-x+t}-1)^2\qquad x<t.
$$