# Find the general solution Linear First Order DE

Find the general solution to:

$$(e^x+1)y'=y-ye^x$$

I worked through the problem and got stuck. I know that it isn't a separable equation and for me all I can think of to solve it is using the method of integrating factors, but I got stuck trying to figure out the integrating factor. Could someone help me answer it and give me some instruction on what's the correct way to go about solving this? Thanks!

• Is it not separable? Can't you divide by $y$ and by $e^x+1$ to get $$\frac{y'}{y} = \frac{1-e^x}{1+e^x}?$$ – User8128 Mar 13 '16 at 23:05
• Of course, there's always the case $y\equiv 0$ to take into account. – user228113 Mar 13 '16 at 23:06

$$\frac{dy}{y} = \frac{1 - e^x}{1 + e^x}dx$$ $$t:= e^x \Rightarrow dt = e^xdx \Rightarrow dt = tdx \Rightarrow \frac{dt}{t} = dx.$$ Then, $$\frac{dy}{y} = \frac{1-t}{t+t^2}dt = [\frac{1}{t + t^2} - \frac{1}{1 + t^2}]dt.$$
Starting as Leonardo Francisco Cavenaghi,$$\frac{dy}{y} = \frac{1 - e^x}{1 + e^x}dx=\frac{e^{-\frac x 2} - e^{\frac x 2}}{e^{-\frac x 2} + e^{\frac x 2}}dx=-\frac{e^{\frac x 2} - e^{-\frac x 2}}{e^{\frac x 2} + e^{-\frac x 2}}dx=-\frac{\sinh(\frac x 2)}{\cosh(\frac x 2)}dx=-2\frac{\sinh(\frac x 2)}{\cosh(\frac x 2)}d(\frac x 2)$$ Integrate $$\log(y)=-2 \log(\cosh(\frac x 2))+c$$ Exponentiate $$y=\frac c {\cosh^2(\frac x 2)}$$ Back to $\cosh(\frac x 2)=\frac{e^{\frac x 2} + e^{-\frac x 2}}2$, you could simplify to $$y=\frac{c\,e^x}{\left(e^x+1\right)^2}$$