= Solution
The <complementary function> is $C\cos2x+D\sin2x$. A <particular solution> is $(\sin x+\cos x)/3$, since applying $d^2/dx^2+4$ to either <sine> or <cosine> multiplies it by $3$. Thus
$$
y=C\cos2x+D\sin2x+\frac13(\sin x+\cos x).
$$
At zero, $C+1/3=3$, giving $C=8/3$. At $x=\pi/4$, the <cosine> term vanishes and the particular term is $\sqrt2/3$, so $D=-\sqrt2/3$. Consequently
$$
\boxed{y(x)=\frac{8\cos2x-\sqrt2\sin2x+\sin x+\cos x}{3}.}
$$
The two boundary conditions determine the two constants uniquely because their evaluation matrix on $\cos2x,\sin2x$ is the identity.
Back to article page