Using variable spearation to solve a linear ODE of first order Suppose I want to solve the ODE:
$$f'(x) + 2f(x) = 3$$
I want to use variable separation, so I get:
$$ f'(x) = 3 - 2f(x)$$
Now I want to divide by $3-2f(x)$ but I am unsure what I need to assume on $f$ in order to do that. That is, does that expression have to be non zero for all x, or only for a certain x? After that point I know what to do but I don't understand what I am supposed to do here.
thanks
 A: The constant function $f(x)=\frac32$ is one solution. All other solutions must satisfy $f(x) \neq \frac32$ for all $x$ since solution curves can't cross (by the uniqueness theorem), so they are given by $f'(x)/(3-2 f(x))=1$ and so on (the usual procedure).
A: Another approach is to use an integrating factor. That is, we wish to find a $g(x)$ so that 
$$
\begin{align}
(f(x)g(x))'
&=g(x)f'(x)+g'(x)f(x)\\
&=g(x)(f'(x)+2f(x))\\
&=3g(x)
\end{align}
$$
which happens when $g'(x)=2g(x)$. This can be solved with $g(x)=e^{2x}$. Then
$$
\left(e^{2x}f(x)\right)'=3e^{2x}
$$
which is much easier to solve.
A: If you want to solve the ODE, you 've first to solve the homogenueos equation, i.e. $f'(x) + 2f(x) = 0$ and then fing the particular integral. You can easily rearrange the homogeneous equation as:
\begin{equation}
\frac{f'(x)}{f(x)}=-2
\end{equation}
So that 
\begin{equation}
\frac{df}{f}=-2 dx
\end{equation}
When integrating you get $f(x)=c e^{-2 x}$, where c is the integration constant. Your particular integral is a simple constant, since the right hand side of your differential equation is a constant. The solution is $f(x)=c e^{-2 x}+ 3/2$
A: If you want to use the variable separation method, i think you need to solve the homogeneous equation the find a particular solution.
$$E: f'(x)+2f(x)=3 $$
Then, $$ E_h: f_h'(x)+2f_h(x)=0$$
for $f\neq 0$, we have,
 $$\frac{df_h}{f_h}=-2dx $$
by integration we have,
$$ \ln(|f_h(x)|)=-2x+C,\quad C\in \mathbb{R}$$
Which gives,$$ f_h(x)=Ke^{-2x},\quad K=e^C$$
know we can find a particular solution $f_p(x)$ using the variation of the constant method.
and finaly the general solution $f=f_h+f_p$
