How to find integrating factor for $xdx+(x-y^2)dy=0.$
Here $M=x$ and $N=x-y^2$. This equation is not exact. Clearly not seperable, homogeneous or linear(either in terms of $\frac{dy}{dx}$ or in terms of $\frac{dx}{dy}$). This is not even Bernoulli's equation. Also $\frac{1}{M}\left[\frac{\partial N}{\partial x}-\frac{\partial M}{\partial y}\right]=\frac 1 x,$ a function $x$, but since the rule requires this expression to be a function of $y$, this one is not applicable too.
We need to solve $$\text{ODE [1]:} \quad \boxed{xdx+(x-y^{2})dy=0}$$ Now a very common technique is to swap the variables. Let $x \leftrightarrow y$, so we obtain $$\text{ODE [2]:}\quad \boxed{ydy+(y-x^{2})dx=0}$$Note that $\text{ODE [1]:}\overbrace{\equiv}^{x\leftrightarrow y} \text{ODE [2]}$. Now, we can see in $\color{blue}{[2]}$ that
\begin{eqnarray} ydy+(y-x^{2})dx&=&0\\ &\implies& ydy=(x^{2}-y)dx\\ &\implies& yy'=x^{2}-y\\ &\iff& yy'+y=x^{2}\\ &\iff & y(y'+1)=x^{2} \end{eqnarray} Now, we can see that $x=0 \implies y=0$. Therefore, we have the IPV $$\text{(IPV):} \left\{\begin{aligned} y(y'+1)=x^{2}\\ y(0)=0 \end{aligned} \right.$$ We can solve IPV using power series. Let $$y=\sum_{k=1}^{+\infty}a_{k}x^{k}\implies y'=\sum_{k=2}^{+\infty}a_{k}kx^{k-1}$$So, we have to solve for $a_{k}$, $$\sum_{k=1}^{+\infty}a_{k}x^{k}\left( \sum_{k=2}^{+\infty}a_{k}kx^{k-1}+1 \right)=x^{2}$$I think the reader can do this last step, finally we obtain $$\boxed{y(x)=-x-\frac{x^{2}}{2}+\frac{x^{3}}{6}-\frac{5x^{4}}{48}+\frac{19x^{5}}{240}-\frac{287x^{6}}{4320}+\frac{3583x^{7}}{60480}-\cdots}$$