Solving first order non linear diferrential equation I am trying to solve:
$$y dx+(xy+2x-ye^y) dy=0$$
I tried to use the substitution $u =yx$ but it didn't work.
Also can you tell me what methods to use classically in this case please.
 A: Hint :
Let $R(x,y) = y$ and $S(x,y) = 2x - e^y + xy$. The given equation is not exact, because : $R_y \neq S_x$.
This means that you need to find an integrating factor $μ(y)$ :
$$\frac{\partial}{\partial y}\big[μ(y)R(x,y)\big] =\frac{\partial}{\partial x}\big[μ(y)S(x,y)\big]$$
$$\Rightarrow$$
$$y\frac{dμ(y)}{dy} + μ(y) = (y+2)μ(y)$$
Then, after you've found such $μ$, you'll multiply both sides of your ODE and it will be an exact differential equation, which you can proceed to solving with the standard method for exact equations.

Elaboration of the hint :
Working on the last named equation, you get :
$$\frac{\frac{\partial μ(y)}{\partial y}}{μ(y)} = \frac{1}{y} + 1 \Rightarrow \ln(μ(y)) = y + \ln(y) \Leftrightarrow μ(y) = ye^y$$
Now, if you multiply both sides by this $μ(y)$, your equation will be exact (you need to double check it, so repeat the elaboration in the begining of the hint, but now with new functions).
Define $f(x,y)$ such that : $\frac{\partial}{\partial x} P(x,y)$ and $\frac{\partial}{\partial y} Q(x,y)$ where $P,Q$ are the corresponding functions used to show the exactness of the equation as above.
The solution then will be given by $f(x,y) = c_1$, where $c_1$ is an arbitrary constant.
Integrate the following expression to find $f(x,y)$ with respect to $x$ : 
$$\frac{\partial}{\partial x}f(x,y) = P(x,y)$$
and then, the $f(x,y)$ that you will find will have a "constant" function $g(y)$ with respect to $y$. Differentiation $f(x,y)$ with respect to $y$ and substitution in the expression : 
$$\frac{\partial}{\partial y}f(x,y) = Q(x,y)$$
will allow you then to integrate the function $g(y)$ and find the complete expression of $f(x,y)$, which you have to solve with respect to $y$ in order to find the exact function that is the solution to the differential equation we started from.
A: $$y +(xy+2x-ye^y) \frac{dy}{dx}=0$$
$$y \frac{dx}{dy}+(xy+2x-ye^y) =0$$
$$y \frac{dx}{dy}+(y+2)x =ye^y$$
This a simple first order linear ODE considering the function $x(y)$
To make it more obvious, let $x=Y$ and $y=X$ :
$$X \frac{dY}{dX}+(X+2)Y =Xe^X$$
I suppose that you know how to solve it, leading to :
$$Y=\frac{c}{e^X X^2}+\bigg(\frac12-\frac{1}{2X}+\frac{1}{4X^2}\bigg)e^X$$
Coming back to the original notation, the solution is expressed on implicit form, that is the function $x(y)$ :
$$x=\frac{c}{e^y y^2}+\bigg(\frac12-\frac{1}{2y}+\frac{1}{4y^2}\bigg)e^y$$
As far as I know, there is no closed form (made of a finite number of standard functions) for the inverse function $y(x)$.
A: Consider the equation to be $$y x'+(xy+2x-ye^y) =0$$ To get rid of the unpleasnt term in brackets, let
$$xy+2x-ye^y=z \implies x=\frac{z+ye^y }{y+2}\implies x'=\frac{z'+ye^y +e^y}{y+2}-\frac{z+ye^y }{(y+2)^2}$$ Replace in the initial equation
$$y (y+2) z'+(y^2+3y+4) z=- y (y^2+2y+2)e^y$$
The homogeneous part is quite simple; then continue with the variation of parameters.
A: $$y dx+(xy+2x-ye^y) dy=0$$
divide by $y\ne0$
$$ dx+(x+2\frac xy-e^y) dy=0$$
x is now the function
$$ x'=-(x+2\frac xy-e^y) $$
$$ x'+x(1+\frac 2y)=e^y $$
Which is simple to solve
