Consider the differential equation $$ y'' + 4y = \cases{2t & \text{if }0\le t \le \pi,\\0 & \text{otherwise},}$$ with initial conditions $y(0)=0,y'(0)=1$. I want to solve this via Fourier Series. The homogeneous problem is solved by $A\cos 2t + B\sin2t$. Also, let $f(t)=2t$. Its Fourier series (extending $f(t)$ periodically) is:
$$f(t) = \frac{\pi}{4} + \sum_{n=1}^\infty\left(-\frac2n\right)\sin 2nt.$$
Suppose that $\displaystyle y_\text{p} = c_0 + \sum_{n=1}^\infty c_n\sin 2nt$ is a particular solution of the differential equation. Then it is obvious that $c_0=\pi/4$ and: $$-\sum_{n=1}^\infty 4n^2c_n\sin 2nt + 4\sum_{n=1}^\infty c_n\sin 2nt = \sum_{n=1}^\infty\left(-\frac2n\right)\sin 2nt.$$
Thus $c_n(1-n^2) = -\frac{1}{2n}$, which doesn't hold for $n=1$. How can I deal with this problem? Note that the term $\sin2(1)t$ is in the homogeneous solution (is this relevant to the problem at $n=1$?). Thanks for your help.