Is the following differential equation exact? I have the following equation:
$$ydx-(x+y^2)dy=0. $$
It seems to me the equation is not exact ($My=1, Nx=-1$), but then I don't know how to solve it. So is it exact or not? And if not, how can it be solved?
 A: Your equation is invariant to a Lie group, so you can use Lie's integrating factor to turn it into an exact equation.  Start with this stretching group:  $x'=\lambda x$ and $y'=\lambda^\beta y$.  Thus, $dx'=\lambda dx$ and $dy'=\lambda^\beta dy$.  Substitute these values into your equation and you will see that for the sake of invariance, $\beta =\frac{1}{2}$.  Lie's integrating factor for this family of groups is
$$
\mu=\frac{1}{Mx+\beta Ny}
$$Since your $M=y$ and $N=-(x+y^2)$, 
$$
\mu=\frac{2}{xy-y^3}
$$
We are assuming that your solution is a one-parameter collection of solutions curves, call it $\phi(x,y)$.
$$
\phi_x=\mu M=\frac{2}{x-y^2}
$$so
$$
\phi=2ln(x-y^2)+f(y)
$$and
$$
\phi_y=\frac{-4y}{x-y^2}+\frac{df(y)}{dy}
$$Now we look at 
$$
\phi_y =\mu N=\frac{-2(x-y^2)}{xy-y^3}=\frac{-4y}{x-y^2}+\frac{-2}{y}
$$and we can see that 
$$
\frac{df(y)}{dy}=\frac{-2}{y}
$$which means 
$$
f(y)=-2lny+2lnA
$$where the constant of integration is chosen to be $2lnA$ for convenience.  Now we have
$$
\phi=2ln(x-y^2)-2lny+2lnA
$$
$$
\frac{\phi}{2}=ln\frac{A(x-y^2)}{y}
$$Again, for convenience, we play with the constant such that
$$
\frac{e^{\frac{\phi}{2}}}{A}=-B=\frac{x-y^2}{y}
$$
$$
y^2-By-x=0
$$
$$
y=\frac{B\pm \sqrt{B^2+4x}}{2}
$$Let $\frac{B}{2}=C$ and we arrive at the final answer.
$$
y=C\pm \sqrt{C^2+x}
$$The easiest way to check this solution is to express the DEQ as
$$
\frac{y}{\dot{y}}=x+y^2
$$
$$
\frac{y}{\dot{y}}=\pm2\sqrt{C^2+x}(C\pm \sqrt{C^2+x})=\pm 2C\sqrt{C^2+x}+2C^2+2x
$$
$$
x+y^2=x+(C^2\pm2C\sqrt{C^2+x}+C^2+x)=\pm 2C\sqrt{C^2+x}+2C^2+2x
$$...and we are done.  Normally I let readers find the path of calculations for themselves, but very few people are familiar with Lie's integrating factor.  
