# Solve $(x+y \log y)y\, \mathrm{d}x=(y+x \log x)x \,\mathrm{d}y$

Solve the differential equation $$(x+y \log y)y \,\mathrm{d}x=(y+x \log x)x \,\mathrm{d}y$$

My try: put $x=e^t$ and $y =e^w$: we get

$$(e^t+w e^w)e^w e^t \,\mathrm{d}t=(e^w+te^t)e^we^t\,\mathrm{d}w\implies (e^t+we^w)\,\mathrm{d}t=(e^w+te^t)\,\mathrm{d}w$$

Any clue here?

• Is $y$ a function of $x$? – YiFan Sep 6 '18 at 8:03
• Yes it's an implicit function – Ekaveera Kumar Sharma Sep 6 '18 at 8:07
• Just an observation: by symmetry $y(x) = x$ works. – Gibbs Sep 6 '18 at 8:49
• Yes but y=x only in first quadrant – Ekaveera Kumar Sharma Sep 6 '18 at 8:56
• Yes sure, because both $y$ and $x$ must be positive. – Gibbs Sep 6 '18 at 8:57

## 1 Answer

We have the following differential equation:

$$(x+y \log y)y \,\mathrm{d}x=(y+x \log x)x \,\mathrm{d}y$$

Rearranging the terms, we get:

$$\implies xy\mathrm{d}x+y^{2}\log(y)\mathrm{d}x=xy\mathrm{d}y+x^{2}\log(x)\mathrm{d}y$$ $$\implies-x^{2}\log(x)\mathrm{d}y+xy\mathrm{d}x=-y^{2}\log(y)\mathrm{d}x+xy\mathrm{d}y$$ $$\implies x(-x\log(x)\mathrm{d}y+y\mathrm{d}x)=y(-y\log(y)\mathrm{d}x+x\mathrm{d}y)$$

Dividing both sides by the term $x^{2}y^{2}$, we get:

$$\implies \frac{(-x\log(x)\mathrm{d}y+y\mathrm{d}x)}{xy^2}=\frac{(-y\log(y)\mathrm{d}x+x\mathrm{d}y)}{x^{2}y}$$ $$\implies \left(-\frac{1}{y^2}\mathrm{d}y\right)\log(x)+\left(\frac{1}{x}\mathrm{d}x\right)\frac{1}{y}=\left(-\frac{1}{x^2}\mathrm{d}x\right)\log(y)+\left(\frac{1}{y}\mathrm{d}y\right)\frac{1}{x}$$ $$\implies \mathrm{d}\left(\frac{1}{y}\right)\log(x)+\mathrm{d}\left(\log(x)\right)\frac{1}{y}=\mathrm{d}\left(\frac{1}{x}\right)\log(y)+\mathrm{d}\left(\log(y)\right)\frac{1}{x}$$ $$\implies \mathrm{d}\left(\frac{1}{y}\log(x)\right)=\mathrm{d}\left(\frac{1}{x}\log(y)\right)$$

Integrating both sides, we get:

$$\implies \int \mathrm{d}\left(\frac{1}{y}\log(x)\right)=\int \mathrm{d}\left(\frac{1}{x}\log(y)\right)$$

We get the solution as: $$\color{darkblue}{\frac{1}{y}\log(x)=\frac{1}{x}\log(y)+C}$$

Where $C$ is the integration constant. This is the implicit solution.

Edit: As shown by @Claude Leibovici, the solution can be converted to an explicit one using Lambert $W$ function. The solution is as follows:

Rearranging the above equation, we get:

$$\implies \frac{x}{y}\log(x)=\log(y)+Cx$$

Taking exponential of both sides, we have:

$$\implies \exp\left({\frac{x}{y}\log(x)}\right)=\exp\left(\log(y)\right)\exp\left(Cx\right)$$

$$\implies \exp\left({\frac{x}{y}\log(x)}\right)=y\exp\left(Cx\right)$$

Multiplying both sides by $\frac{x}{y}\log(x)$, we have:

$$\implies \frac{x}{y}\log(x)\exp\left({\frac{x}{y}\log(x)}\right)=x\exp\left(Cx\right)\log(x)$$

If we consider $\frac{x}{y}\log(x)$ as $u$, the above equation reduces to $ue^u=K$ and can be represented by Lambert $W$ function as $u=W(K)$, so we have:

$$\implies \frac{x}{y}\log(x)=W\left(x\exp\left(Cx\right)\log(x)\right)$$ $$\implies \color{darkgreen}{y=\frac{x \log (x)}{W\left(x e^{Cx} \log (x)\right)}}$$

where $W(.)$ is Lambert function. This is the explicit solution.

• perfect, clean and well formated answer – Matěj Štágl Sep 6 '18 at 12:09
• Nice solution, for sure ! $\to +1$ – Claude Leibovici Sep 6 '18 at 13:19
• @ClaudeLeibovici and Matěj, Thank you :) – paulplusx Sep 6 '18 at 14:55
• May be, you could add to your good answer that the final solution is $$y=\frac{x \log (x)}{W\left(x e^{c x} \log (x)\right)}$$. where $W(.)$ is Lambert function. – Claude Leibovici Sep 7 '18 at 2:24
• Try to learn about Lambert function. It allows to solve explicitly so many problems. Just search of this site Lambert function; 2277 posts ! It heps to solve a huge number of problems in mathematics, physics, chemistry, biochemistry and so on. Just for your curiosity, Euler and Lambert worked together. – Claude Leibovici Sep 7 '18 at 4:06