# How to find proper integrating factor to solve non-separable differential equation $(2x^2+\frac{x}{y^2})dx+(\frac{x^3}{y}-\frac{x^2}{y^3})dy=0$.

I try to solve the following differential equation:

$$\begin{equation} \left(2x^2 + \frac{x}{y^ 2}\right)dx + \left(\frac{x^3}{y}-\frac{x^2}{y^3}\right)dy = 0 \end{equation}$$

$$\begin{equation} \left(\frac{2x^2y^ 2 + x}{y^ 2}\right)dx + \left(\frac{x^3y^2-x^2}{y^3}\right)dy = 0 \end{equation}$$

I first tried to check if its separable by rearranging and simplifying terms

$$\begin{equation} \left(\frac{y(2xy^2 +1)}{x(xy^2-1)}\right) dx = dy \end{equation}$$

But it did not work so unless I made a mistake its a non-separable differential equation. I learned that to solve these I need to use integrating factors. Could someone please explain me how to know select the proper integrating factor to use? Thanks in advance

With multiplying factor $$x^ay^b$$ in equation and finding $$a$$ and $$b$$ the integrating factor is $$\mu=\color{blue}{\dfrac{y}{x}}$$
Alternative method: Drop a $$x$$ of equation, then $$\left(2x + \frac{1}{y^ 2}\right)dx + \left(\frac{x^2}{y}-\frac{x}{y^3}\right)dy = 0$$ and rearranging gives $$2x\ dx + \frac{x^2}{y}\ dy+ \frac{y dx-x dy}{y^3}=0$$ $$2xy\ dx + x^2\ dy+ y\dfrac{1}{y}d\left(\frac{x}{y}\right)=0$$ $$d(x^2y)+d\left(\frac{x}{y}\right)=0$$ $$x^2y+\left(\frac{x}{y}\right)=C$$
• thanks for help. I think that I understand the alternative method following your steps. But I dont understand how the first method work. I would multiply the both sides of equation by $x^a y^b$ and then solve for a and b? Nov 2 '18 at 12:21
• find parameters $a$ and $b$ such that the terms in parenthesis have equal powers or another way is when the equation be exact. Nov 2 '18 at 12:25
• $(xe^{xy}-1)dy+(2+ye^{xy})dx=0$ is exact, is it separable ? Nov 2 '18 at 12:37
• I meant $Mdx+Ndy=0$ is exact when $M_y=N_x$. Nov 2 '18 at 12:48
• Here $M_y=N_x=e^{xy}(1+xy)$ Nov 2 '18 at 12:50