# First-order nonlinear ordinary differential equation

How to solve this differential equation:

$$x\frac{dy}{dx} = y + x\frac{e^x}{e^y}?$$

I tried to rearrange the equation to the form $f\left(\frac{y}{x}\right)$ but I couldn't thus I couldn't use $v = \frac{y}{x}$ to solve it.

-
This differential equation is not homogeneous (and so you can't rearrange it in the form $f(y/x)$.) – Lukas Geyer Oct 6 '12 at 16:15
what is it then? how can you solve it? – David Hoffman Oct 6 '12 at 19:21
If you assume $y>0$, something like $u=\log y$ may help. I haven't checked, so it may also be a waste of time. – Daryl Oct 6 '12 at 20:18
The clue is that $\dfrac{e^x}{e^y}$ should rewrite to $e^{x-y}$ and thus we get the idea that let $u=x-y$ or let $u=y-x$ will convert the ODE whose the terms are not contain any composite functions. – doraemonpaul Oct 7 '12 at 1:31
The substitution $u = e^y$ leads to $$\frac{du}{dx} = \frac{dy}{dx}e^y = \frac yx e^y + e^x = \frac ux \log u + e^x.$$ May be this could lead somewhere. – Sam Oct 7 '12 at 2:06

Rewrite this equation in the form:

$$M(x,y)dx + N(x,y)dy = (xe^x+ye^y)dx-xe^ydy = 0$$

Both $\frac{\partial M}{\partial y} = e^y(1+y)$ and $\frac{\partial N}{\partial x}=-e^y$ are depend on $y$ only. In this case some multiplier $\mu(x,y)$ can be simply found so that

$$\dfrac{\partial (\mu M)}{\partial y} = 0,\quad \dfrac{\partial (\mu N)}{\partial x}=0$$

and you get exact differential equation in form $du(x,y)=0$.

For $\mu$ depending only on $y$ we have $d\ln\mu=\dfrac{dy}{M}\left(\dfrac{\partial N}{\partial x}-\dfrac{\partial M}{\partial y}\right)$. In our case:

$$\mu(y) = \exp\left(-\int\dfrac{e^y(y+2)}{xe^x+ye^y}dy\right)$$ Solution of our DE is: $$\int \mu M dx + \int \mu N dy = C$$

I do not substitute $\mu$ in the last equation because $\mu$ as I see cannot be expressed in elementary functions and complete solution will be cumbersome.

-

$x\dfrac{dy}{dx}=y+x\dfrac{e^x}{e^y}$

$x\dfrac{dy}{dx}=y+xe^{x-y}$

Let $u=y-x$ ,

Then $y=u+x$

$\dfrac{dy}{dx}=\dfrac{du}{dx}+1$

$\therefore x\left(\dfrac{du}{dx}+1\right)=u+x+xe^{-u}$

$x\dfrac{du}{dx}+x=u+x+xe^{-u}$

$x\dfrac{du}{dx}=xe^{-u}+u$

$(xe^{-u}+u)\dfrac{dx}{du}=x$

Let $v=x+ue^u$ ,

Then $x=v-ue^u$

$\dfrac{dx}{du}=\dfrac{dv}{du}-(u+1)e^u$

$\therefore e^{-u}v\left(\dfrac{dv}{du}-(u+1)e^u\right)=v-ue^u$

$e^{-u}v\dfrac{dv}{du}-(u+1)v=v-ue^u$

$e^{-u}v\dfrac{dv}{du}=(u+2)v-ue^u$

$v\dfrac{dv}{du}=(u+2)e^uv-ue^{2u}$

This belongs to an Abel equation of the second kind.

Let $t=(u+1)e^u$ ,

Then $u=W(et)-1$

$\dfrac{dv}{du}=\dfrac{dv}{dt}\dfrac{dt}{du}=(u+2)e^u\dfrac{dv}{dt}$

$\therefore(u+2)e^uv\dfrac{dv}{dt}=(u+2)e^uv-ue^{2u}$

$v\dfrac{dv}{dt}=v-\dfrac{ue^u}{u+2}$

$v\dfrac{dv}{dt}-v=-\dfrac{t(W(et)-1)}{W(et)(W(et)+1)}$

This belongs to an Abel equation of the second kind in the canonical form.