It's probably a stupid question, but due to my ignorance I can't solve the ODE $$f''(x)+k^2f(x)=g(x)$$ Could someone please show me how to proceed to find the general solution?
I am able to solve only the associated homogeneous equation:
$$f''(x)+k^2f(x)=0 \implies\\ f(x)=Ae^{jkx}+Be^{-jkx}$$
Thanks.
Based on Kabo's comment (which I would have made if I got here first).
In this case, the variation of parameter formulas come out nicely:
$$ f \left( x \right) = C_1\sin \left( kx \right)+C_2\cos \left( kx \right)+ \frac{1}{k}\left(\int \!\cos \left( kx \right)\; g \left( x \right) \,{\rm d}x\right)\sin \left( kx \right) -\frac{1}{k}\left(\int \!\sin \left( kx \right)\; g \left( x \right) \,{\rm d}x\right)\cos \left( kx \right) $$