A question regarding Differential Equation $f'(x) = 1+f(x) \implies \frac{df(x)}{1+f(x)} = dx$
Now on integrating both sides we get $f(x) = e^{x+c} -1$
So $f(x) = e^{x+c}  -1$ for all $x \in \mathbb R$
This is done in my text book.
But I can not understand why they did not care about $1+f(x) $ being $0$.
I would rather prefer to do the following.
Let's supose $1+f(x) \neq 0$ when $x\in A$. So we can say $f(x) = e^{x+c}  -1$ when $x \in A$  by using the previous method.
And $f(x) = -1$ when $x \in \mathbb R -A$
Now as $\mathbb R$ is a connected set and $f(x)$ is continuous , we can say either $A= \mathbb R$ or $B= \mathbb R$.
Can anyone please tell me if I have gone wrong anywhere?
 A: You are correct that you have to assume $1+f(x) \neq 0$ in order to carry out this procedure of separation of variables. You didn't do the rest of it right, though. You actually have
$$\ln(|f(x)+1|)=x+C \\
|f(x)+1|=e^C e^x \\
f(x)=-1 \pm e^C e^x.$$
You can simplify this by identifying $\pm e^C$ as a new constant $C$ that can be any nonzero value, and then writing $f(x)=-1+Ce^x$.
Still, separation of variables can't see that $f(x)=-1$ is a solution; it forces the constant to be nonzero as part of the method.
However, you can readily see that $f(x)=-1$ is a solution, since it will have $f'(x)=0$. So to finish the problem, you can argue that the solutions to IVPs in this equation are unique (using Picard-Lindelof or some variant thereof). So you conclude that if $f(x)=-1$ anywhere then $f(x)=-1$ everywhere. From there you finish the problem with $f(x)=-1+Ce^x$ for any real constant $C$.
This isn't the only way to do it. Since this equation is first order linear you can follow the integrating factor method, or use the "particular + homogeneous" technique that works with linear equations in general. These methods don't have this case work like separation of variables does.
A: $$f'(x) = 1+f(x) $$
$$f'(x)-f(x)=1$$
Multiply by the integrating factor $\mu=e^{-x}$:
$$(f(x)e^{-x})'=e^{-x}$$
$$f(x)e^{-x}=-e^{-x}+C$$
$$\implies f(x)=Ce^x-1$$
The solution $f(x)=-1$ corresponds to $C=0$.
