I want to solve the following DE using integration factors
$(x + 2y) dx − x dy = 0$.
My attempt:
Letting $M(x,y) = x+2y, N(x,y)=-x$,then $\frac {M_{y}-N_{x}}{N} = \frac {2-(-1)}{-x}=\frac {-3}{x}$ is a function of $x$ say $f(x)$ and so the integrating factor according to my notes should be $e^{\int f(x)}=e^{\int -3/xdx}=e^{ln|1/x^3|}=1/x^3$
When I multiply $M,N$ by this function it does not seem to make an exact equation. Any tips for what I have done wrong much appreciated.
If you multiply by $1/x^3$, it is exact. You get $M = 1/x^2 + 2y/x^3$ and $N = - 1/x^2.$ Then $$M_y = 2/x^3 = N_x.$$ Note that you may need to rewrite $-1/x^2$ as $-x^{-2}$ when you take the derivative, maybe you are making a computation error.