How to solve this equation by Fourier series? $$  y''+3y=\sin ^4 x ,\quad y=\frac{1}{8} +\frac{\cos2x}{2}-\frac{\cos4x}{104}.$$
Now the text book states the solution, but I don't know the process of solving this equation. I need  your help!

The first thing you should do is express $\sin^4{x}$ in terms of cosines:
$$\begin{align}\sin^4{x} &= \left ( \frac{1-\cos{2 x}}{2} \right )^2\\ &= \frac{1}{4} - \frac{1}{2} \cos{2 x} + \frac{1}{4} \cos^2{2 x}\\ &= \frac{1}{4} - \frac{1}{2} \cos{2 x} + \frac{1}{4} \left (\frac{1+\cos{4 x}}{2} \right )\\ &= \frac38 - \frac{1}{2} \cos{2 x} + \frac18 \cos{4 x}\end{align}$$
Because $y'' + 3 y$ is a linear differential expression, it follows that the solution to the above equation must be a linear combination of $1$, $\cos{2 x}$, and $\cos{4 x}$:
$$y(x) = a_0 + a_2 \cos{2 x} + a_4 \cos{4 x}$$
Plug this into the differential expression:
$$y'' + 3 y = 3 a_0 - a_2 \cos{2 x} - 13 a_4 \cos{4 x} = \frac38 - \frac{1}{2} \cos{2 x} + \frac18 \cos{4 x}$$
Equating the coefficients of $1$, $\cos{2 x}$, and $\cos{4 x}$, we get the stated result.
