How to solve the differential equation $(2xy^2-y){dx}+(y^2+x+y){dy}=0$? I'm weak at solving equations like this: $$(2xy^2-y){dx}+(y^2+x+y){dy}=0$$
Please show how to complete equation, so that it becomes exact.
Thank you for help in advance.
 A: Call $P = 2xy^2-y$ and $Q = y^2+x+y$. Unfortunately, $$\frac{\partial P}{\partial y} \neq \frac{\partial Q}{\partial x},$$ so the equation is not exact. I'll show you how can we find an integrating factor. Suppose that we have a function $\mu$ such that $$\mu P \ {\rm d}x + \mu Q \ {\rm d}y = 0$$ is an exact equation. So we must have: $$\frac{\partial}{\partial y}(\mu P) = \frac{\partial}{\partial x}(\mu Q) \implies \mu \frac{\partial P}{\partial y}+ P \frac{\partial \mu}{\partial y} = \mu \frac{\partial Q}{\partial x}+Q\frac{\partial \mu}{\partial x}.$$
A priori, we have $\mu = \mu(x,y)$. We look for easier cases.
Suppose that $\mu$ is only a function of $x$. The last expression becomes:$$\mu \frac{\partial P}{\partial y} = \mu \frac{\partial Q}{\partial x}+Q\mu' \implies \frac{\mu'}{\mu} = \frac{\frac{\partial P}{\partial y} - \frac{\partial Q}{\partial x}}{Q}$$
If you compute the expression on the right-hand side for our problem at hand and $y$ disapperars, you can solve this ODE for $\mu$ and go on.
On the other hand, if you suppose that $\mu$ is only a function of $y$, the expression becomes: $$\mu \frac{\partial P}{\partial y}+ P \mu' = \mu \frac{\partial Q}{\partial x} \implies \frac{\mu'}{\mu} = \frac{\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}}{P}.$$
If when computing the right-hand side $x$ dissapears, you can solve the ODE for $\mu$. Then your initial problem, after multiplying by $\mu$, becomes an exact equation, which you probably can solve. 
If none of the above works, then the integrating factor becomes quite complicated. Then I would go for another approach.
A: What is expected of you here is to compare the lefthand side to a total differential $d\Phi$ of some potential function $\Phi(x,y)$; it is known that we can express $d\Phi=\frac{\partial\Phi}{\partial x}dx+\frac{\partial\Phi}{\partial y}dy$ and similarly $d\Phi=0\implies\Phi(x,y)=C,C\in\mathbb{R}$ i.e. a total differential of zero suggests our function is constant. It just remains to determine, then, what $\Phi$ corresponds to our given equation.
Note this problem is known as an exact differential equation, since we'd like our lefthand side to be an exact differential $\frac{\partial\Phi}{\partial x}dx+\frac{\partial\Phi}{\partial y}dy$ that corresponds to the total differential of some function $\Phi$.

The first step is to determine whether our given equation includes an exact differential at all. Recall that you can reconstruct $\Phi$ up to functions in $x,y$ using $\Phi=\int\frac{\partial\Phi}{\partial x}dx+g(y)=\int\frac{\partial\Phi}{\partial y}dy+f(x)$. It follows that the integrals of the partials of $\Phi$ match up to additively separable functions of $x, y$ and equivalently by the symmetry of second derivatives that $$\frac{\partial\Phi}{\partial y\partial x}=\frac{\partial\Phi}{\partial x\partial y}$$
If the differential is not exact as it is, then it follows we should determine some integration factor $\mu(x,y)$ to turn our differential into an exact one.

If $Mdx+Ndy$ is an inexact differential, we seek some $\mu$ such that $\mu Mdx+\mu Ndy=d\Phi$ is exact. Exactness, as I stated above, suggests that:$$\mu M=\frac{\partial\Phi}{\partial x}\\\mu N=\frac{\partial\Phi}{\partial y}$$It follows from symmetry of second partials that $$\frac{\partial\Phi}{\partial y\partial x}=\frac{\partial}{\partial y}[\mu M]=\frac{\partial\mu}{\partial y}M+\mu\frac{\partial M}{\partial y}\\\frac{\partial\Phi}{\partial x\partial y}=\frac{\partial}{\partial z}[\mu N]=\frac{\partial\mu}{\partial x}N+\mu\frac{\partial N}{\partial x}$$So it follows that $$\frac{\partial\mu}{\partial y}M+\mu\frac{\partial M}{\partial y}=\frac{\partial\mu}{\partial x}N+\mu\frac{\partial N}{\partial x}$$... which gives$$N\frac{\partial\mu}{\partial x}-M\frac{\partial\mu}{\partial y}+\left(\frac{\partial N}{\partial x}-\frac{\partial M}{\partial y}\right)\mu=0$$... a linear partial differential equation in $\mu$.
In practice, such equations are easily solved in cases where $\mu$ is a function of only a single variable, i.e. assuming $\partial\mu/\partial x=0$ or $\partial\mu/\partial y=0$ which reduces the above into a simple ordinary first-order linear differential equation.

For example, assume $\mu(x,y)=\mu(x)$ is a function not of $y$, so that $\partial\mu/\partial x=d\mu/dx$ and $\partial\mu/\partial y=0$. This reduces our differential equation:$$N\frac{d\mu}{dx}+\left(\frac{\partial N}{\partial x}-\frac{\partial M}{\partial y}\right)\mu=0$$
Along with the analogous case in which $\mu$ is a function not of $x$, this can then be solved as a simple linear first-order ODE in $\mu$.
A: Hint
This is not an exact differential equation -- but almost.  You need to find an integrating factor $\mu,$ such that $$\mu(2xy^2-y)dx+\mu(y^2+x+y)dy=0$$is exact
