= Solution
The equation as printed requires $v\ne0$; its sign does not affect the result. Seek separated solutions $\psi=X(x)T(t)$. Substitution into the <wave equation> gives
$$
\frac{X''}{X}=\frac{T''}{v^2T}=-\lambda,
\qquad X''+\lambda X=0,\qquad T''+v^2\lambda T=0.
$$
The <Neumann boundary conditions> impose $X'(0)=X'(\pi)=0$. Multiplying the spatial equation by $X$ and <integration by parts> gives $\int_0^\pi(X')^2dx=\lambda\int_0^\pi X^2dx$, so nontrivial spatial <eigenfunctions> require $\lambda\geq0$.
For $\lambda=0$, $X$ is constant and $T=A_0+B_0t$. For $\lambda=k^2>0$, $X=C\cos kx+D\sin kx$. The first <boundary condition> gives $D=0$, and the second gives $\sin k\pi=0$. Thus $k=n$ is a positive integer and the spatial <eigenfunctions> are $\cos nx$. Their time dependence is $A_n\cos(nvt)+B_n\sin(nvt)$. By <superposition>,
$$
\psi=A_0+B_0t+\sum_{n\geq1}\bigl[A_n\cos(nvt)+B_n\sin(nvt)\bigr]\cos nx.
$$
The zero initial <velocity> sets $B_0=B_n=0$. The <trigonometric identity> gives the initial profile $\cos^2(x/2)=(1+\cos x)/2$, so only the constant mode and the first cosine mode occur. Hence
$$
\boxed{\psi(x,t)=\frac12+\frac12\cos x\cos(vt)}.
$$
Its spatial <derivative> is $-\tfrac12\sin x\cos(vt)$, which vanishes at both boundaries, and its time <derivative> vanishes initially. Thus it satisfies all the required data.
Back to article page