Solution (source code)

= Solution

Take the <Fourier transform> in $x$. The <wave equation> becomes the <ordinary differential equation>
$$
\partial_t^2\widetilde u(k,t)+k^2\widetilde u(k,t)=0,
$$
with initial data $\widetilde u(k,0)=\widetilde f(k)$ and $\partial_t\widetilde u(k,0)=\widetilde g(k)$. Therefore
$$
\widetilde u(k,t)=\widetilde f(k)\cos(kt)
+\widetilde g(k)\frac{\sin(kt)}k.
$$

Part (c) and the <Translation property of the Fourier transform> invert the first term to
$$
\frac12\{f(x+t)+f(x-t)\}.
$$
For the second term choose an <antiderivative> $p$ of $g$. By part (b), $\widetilde g=ik\widetilde p$, and hence
$$
\widetilde g(k)\frac{\sin(kt)}k
=\frac12\widetilde p(k)\{e^{ikt}-e^{-ikt}\}.
$$
Its inverse transform is
$$
\frac12\{p(x+t)-p(x-t)\}
=\frac12\int_{x-t}^{x+t}g(\xi)\,d\xi.
$$
Combining the terms gives the <D'Alembert formula>
$$
\boxed{u(x,t)=\frac12\{f(x+t)+f(x-t)\}
+\frac12\int_{x-t}^{x+t}g(\xi)\,d\xi}.
$$