How do you solve differential equation using Fourier series for y"+2y=f(x) where f is 2pi periodic and f(x)= sin x for 0
what i found is that the function is seems to be and odd function hence, a0=0 and an=0 while bn=1/pi(int(sin^2x))from 0 to pi? is this correct? I also found that the homogeneous solution is Acos(sqrt(2))x+Bsin(sqrt(2))x. hence, their general solution is sin(x)+Acos(sqrt(2))x+Bsin(sqrt(2))x. But how to use the fourier series?
If you expand $f=\sum_{n=-\infty}^{\infty}f_ne^{inx}$, then you can try $y=\sum_{n=-\infty}^{\infty}y_n e^{inx}$ and see if you can solve for the constants $y_n$: $$ \sum_{n=-\infty}^{\infty}(-y_nn^2+2y_n)e^{inx}=\sum_{n=-\infty}^{\infty}f_n e^{inx} \\ y_n(2-n^2)=f_n \\ y_n = \frac{f_n}{2-n^2}. $$ So it appears that there is a solution: $$ y(x) = \sum_{n=-\infty}^{\infty}\frac{f_n}{2-n^2}e^{inx}, \;\; \mbox{where } f_n =\frac{1}{2\pi}\int_{0}^{2\pi}f(x)e^{-inx}dx. $$