I have found the fundamental solution set of the LHS to be $J_1=cos(x)$, $J_2=sin(x)$, but then I find the solution set of the RHS to be $J_3=xcos(x)$, $J_4=xsin(x)$. If I then apply the operator $A=D^2+1$ to this solution set to find a particular solution I find $A(c_1*J_3+c_2*J_4)=(-2c_1+c_2x)*sin(x)+(-c_1x+2c_2)cos(x)=sin(x)$, which makes it impossible to find a constant value for $c_1$ and $c_2$. I am probably doing something wrong here, but I can't seem to find my error.
Edit: I did find my error, I forgot adding f at the end and only focussed on the f'' part. Thanks for helping me!