how to solve a diferential equation of order 1: $(ye^x +y)dx+ye^{(x+y)}dy=0$ I've recently started to learn about differential equations and I am having a hard time solving any of them.
I feel like I'm missing some steps.
Therefore, could I please know how to solve:
$(ye^x +y)dx+ye^{(x+y)}dy=0$
So far, I've looked around the book and some websites that could give the final answer, to at least know what way should I go, but I feel like I'm going nowhere. All I was able to find is that the equation above is something called "an equation with separable variables".
Equation:
here
Thank you very much.
 A: Your equation is $(ye^x + y)\mathop{}\!\mathrm{d} x + ye^{x+y}\mathop{}\!\mathrm{d} y = 0$. Note that $y = 0$ is a solution (it gives $0 = 0$ when substituted into the equation). If $y \neq 0$, you can rearrange the equation as \begin{equation*}\frac{\mathop{}\!\mathrm{d} y}{\mathop{}\!\mathrm{d} x} = -\frac{ye^x+y}{ye^{x+y}} = -\frac{y(e^x+1)}{ye^{x+y}} = -\frac{e^x+1}{e^{x+y}}\end{equation*} Multiplying both sides by $e^y$, this becomes \begin{equation*}e^y \frac{\mathop{}\!\mathrm{d} y}{\mathop{}\!\mathrm{d} x} = -\frac{e^x+1}{e^x}\end{equation*} Integrating both sides with respect to $x$, we get \begin{equation*}\int e^y \frac{\mathop{}\!\mathrm{d} y}{\mathop{}\!\mathrm{d} x} \mathop{}\!\mathrm{d} x = -\int\frac{e^x+1}{e^x}\mathop{}\!\mathrm{d} x = -\int\left(1+e^{-x}\right) \mathop{}\!\mathrm{d} x\end{equation*} where I have split the fraction on the right hand side. Now, the integral on the left hand side is just $\int e^y \mathop{}\!\mathrm{d} y$ (using "integration by substitution"), so is $e^y$. The right hand side is $-(x-e^{-x}+c)$, where $c$ is the constant of integration. Thus, writing $k = -c$, we get \begin{equation*}e^y = -x + e^{-x} + k\end{equation*} as the solution in the $y \neq 0$ case. (If you had e.g. a specific $x$-value and the corresponding $y$-value, you could substitute those in to find the value of $k$.)
A: Like you said, this is a simple case of variable separation:
$$(ye^x+y)\mathrm{d}x+ye^{x+y}\mathrm{d}y=0$$
$$\Rightarrow (e^x+1)\mathrm{d}x+ e^{x+y}\mathrm{d}y=0$$
$$\Rightarrow(e^x+1)\mathrm{d}x=-e^x\cdot e^y \mathrm{d}y$$
$$\Rightarrow \dfrac{e^x+1}{e^x}\mathrm{d}x=-e^y \mathrm{d}y$$
$$\Rightarrow (1+e^{-x})\mathrm{d}x=-e^y \mathrm{d}y$$
From here it should be easy to integrate.

Do take note that on step 2, we cancelled $y$ throughout.We could only do so iff $y(x) \neq 0$. Thus, we must also include $y(x)=0 $ as a trivial solution to the differential equation.
