Solve IVP
\begin{equation*}
\left\{\begin{aligned}
&u_{tt}-c^2u_{xx}=0,
\\
&u|_{t=0}=g(x),\\
&u_t|_{t=0}=h(x)
\end{aligned}\right.
\end{equation*}
with
\begin{align}
&g(x)=\left\{\begin{aligned}
&\cos (x) &&|x| < \pi/2,\\
&0 &&|x| \ge \pi/2 ,
\end{aligned}\right.
&&h(x)=0\tag*{Part (a)}\\[5pt]
&g(x)=0, &&h(x)=\left\{\begin{aligned}
&0 &&x < 0,\\
&1 &&x \ge 0.
\end{aligned}\right.
\tag*{Part (b)}
\end{align}