Solve differential equation: $ y' +1 = e^{-y}$ I'm trying to solve it like this, but I have some troubles.
$$ y' = e^{-y} -1 $$
$$ \frac{dy}{dx} = e^{-y} -1 $$
$$ \int{\frac{1}{e^{-y}-1}}dy = \int dx$$
but it doesn't look like the easiest way, so I tried different method:
$$ y' - e^{-y} =-1 $$
$$ y' - e^{-y} =0 $$
$$ \int{\frac{1}{e^{-y}}}dy = \int dx$$
$$ \int e^ydy = \int dx$$
$$  e^y = x+c$$
$$ y = ln(x+c)$$
$$ y = ln(x+c(x))$$
$$ y' = \frac{1}{(x+c(x))}$$
Puting it into first equation:
$$ \frac{1}{(x+c(x))} +1 = e^{-ln(x+c(x))}$$
Both ways seem not to be very goof for this equation. What can I do? (different method?)
 A: You can just use that
$$
\int\frac{dy}{e^{-y}-1}=\int\frac{e^y\,dy}{1-e^y}
$$
which has the form of a logarithmic integral.

Your second approach is rather heuristic, this works only reliably for linear differential equations. However, starting from
$$
y=\ln(x+c(x))
$$
you would get, applying the chain rule correctly
$$
y'=\frac{1+c'(x)}{x+c(x)}\\
=\frac{1}{x+c(x)}-1.
$$
so that the new differential equation for $c$ is
$$
c'(x)=-x-c(x)
$$
which indeed is a simplification as this now is a linear ODE.
A: It was easy way $$\int { \frac { 1 }{ e^{ -y }-1 }  } dy=\int  dx\\ \int { \frac { { e }^{ y } }{ { 1-e }^{ y } } dy } =\int { dx } \\ -\int { \frac { d\left( { 1-e }^{ y } \right)  }{ { 1-e }^{ y } }  } =x+C\\ \ln { \left| { 1-e }^{ y } \right| =-x+C } \\ { 1-e }^{ y }=C{ e }^{ -x }\\ { e }^{ y }=1-C{ e }^{ -x }\\ y=\ln { \left| 1-C{ e }^{ -x } \right|  } $$
A: The first method (separation of variables) is actually good. It is enough to see that
$$\int \frac{1}{e^{-y}-1}dy = \int \frac{e^y}{1-e^y}dy = -\log|1-e^y|+c_1, \quad c_1 \in \mathbb{R}.$$
So $$-\log|1-e^y| +c_1 = x+c_2, \quad c_1,c_2 \in \mathbb{R}$$
hence
$$\log|1-e^y| = -x+c, \quad c \in \mathbb{R} \rightarrow 1-e^y = \pm e^{-x}e^c = Ce^{-x}, C \in \mathbb{R} \setminus \{0\}.$$
This means $e^y = 1-Ce^{-x}$, and applying the logarithm you get the result $$y = \log(1-Ce^{-x}), \quad C \in \mathbb{R} \setminus \{0\}.$$
