I'm stuck on this question:
$$(D^2+1)y=4\cos{x}$$
where $D^2$ denotes the differential operator $\frac{d^2}{dx^2}$
As far as I know for trig functions, I'm supposed to assume $y=A\sin{x}+B\cos{x}$ and substitute to get $A$ and $B$. But however, for such,
$$(D^2+1)y=0$$
for all values of $A$ and $B$. I don't know what other types of $y$ I should assume. I'm basically clueless here, so any hints would be great.
$$(D^2+1)y=4\cos{x}$$ For $\cos(x)$ function use $(D^2+1)$ $$(D^2+1)^2y=0$$ $$(D^4+2D^2+1)y=0$$ The general solution is $$y=\color{blue}{y_h}+\color{green}{y_p}$$ $$y=\color{blue}{c_1\cos(x)+c_2\sin(x)}+\color{green}{c_3x\sin(x)+c_4x\cos(x)}$$ Particular solution is therefore $y_p=c_3x\sin(x)+c_4x\cos(x)$
You need to find now the value of the constants $c_3,c_4$