Find the general solution of:
$$x'(t)=f(t)x(t)+g(t)$$
How do I prove the general solution for this? What are the intuitive steps to solve something like this? What do I mean by that is that for:
$$x'(t)=x(t)f(t)$$
you just divide by x(t) on both sides and you get:
$$\frac{x'(t)}{x(t)}=f(t)$$
and then you integrate both sides and you get the general solution of:
$$x(t)=ke^{\int f(t)dt}$$
Which is enough for me to understand this proof, how about for the nonhomogenous? How about for the second or higher order differential equations?
Write the equation as $x'(t)-f(t)x(t)=g(t)$. Multiply by (the so-called integrating factor) $e^{-h(t)}$ where $h(t)$ is an anti-derivative of $f(t)$. We get $\frac d {dt} (e^{-h(t) x(t)})= e^{-h(t)} (x'(t)-f(t)x(t))=e^{-h(t)}g(t)$. Integrating this you can write down the general solution of the DE as $x(t)=e^{h(t)}(c+\int_0^{t} e^{-h(s)}g(s)\, ds)$ where $c$ is a constant.