Solution (source code)

= Solution

At $t=0$, the <initial conditions> imply
$$
f(x)+g(x)=u(x),\qquad c\bigl(f'(x)-g'(x)\bigr)=v(x).
$$
Differentiate the first relation and solve for the two <derivatives>:
$$
f'=\frac12u'+\frac1{2c}v,\qquad
g'=\frac12u'-\frac1{2c}v.
$$
Fix a reference point $x_*$ and set $V(x)=\int_{x_*}^xv(s)\,ds$. Taking <antiderivatives> gives
$$
\boxed{f(x)=\frac12u(x)+\frac1{2c}V(x)+K,\qquad
g(x)=\frac12u(x)-\frac1{2c}V(x)-K}.
$$
The constants must be opposite to preserve the first <initial condition>; the arbitrary <constant of integration> $K$ does not change $\psi$. Substitution yields <D'Alembert's formula>:
$$
\boxed{\psi(x,t)=\frac{u(x+ct)+u(x-ct)}2
+\frac1{2c}\int_{x-ct}^{x+ct}v(s)\,ds}.
$$
The <fundamental theorem of calculus> verifies that its time <derivative> at zero is $v(x)$, and its value at zero is $u(x)$. The oriented <integral> also makes the formula valid for negative $t$.