Solution
= Solution
Combine the <complementary function> and <particular solution>:
$$
y=C_1\cos x+C_2\sin x+\frac12+\frac16\cos2x.
$$
The <boundary condition> at zero gives $C_1+2/3=0$, while that at $\pi/2$ gives $C_2+1/3=0$. Hence
$$
\boxed{y(x)=-\frac23\cos x-\frac13\sin x+\frac12+\frac16\cos2x.}
$$
The two <boundary conditions> determine both constants uniquely; substitution at each endpoint gives zero.