**exact**. How can we determine this? We must check if $$M_y = N_x$$ This is because for some function F, $F_{xy} = F_{yx}$ by Clairaut's Theorem. $M = F_x$, so the above equation holds. However, even if this fails, the differential equation may still have a solution. Imagine the differential equation $ydx + xdy = 0$. The function $F(x,y) = xy$. Now, let's multiply through by x. $xydx + x^2dy = 0$. $M_y = x,$ and $N_x = 2x$. The two aren't equal. So, we need to figure out a way to account for that.

# Integrating Factor

# Find the solution

# Example 1

# Example 2

$$(3x^2 + y)dx + (x^2y - x)dy = 0$$
We immediately calculate $M_y$ and $N_x$.
$$M_y = 1, N_x = 2xy - 1$$
Something useful is to just subtract one from the other. It doesn't matter whether it's $M_y - N_x$ or vice-versa, because you can just negate if you see that you need to divide by M.

$$M_y - N_x = 2 - 2xy$$ We can look at both equations to see if this is a multiple of either M or N. We see that N equals (-x/2) * the expression above. $$\dfrac{2 - 2xy}{x^2y - x} = \dfrac{-2(xy - 1)}{x(xy - 1)} = \dfrac{-2}{x}$$ This is written only in terms of x, so we can write $$\rho = e^{\int \frac{-2}{x}\, \mathrm{d}x} =\dfrac{1}{x^2}$$ $$\rho Mdx + \rho Ndy = 0$$ $$(3 + \dfrac{y}{x^2})dx + (y - \frac{1}{x})dy = 0$$ We know $M_y$ = $N_x$ now, so we can say $$F_x = 3 + \dfrac{y}{x^2} \to F = 3x - \frac{y}{x} + G(y)$$ $$F_y = y - \dfrac{1}{x} \to F = \dfrac{y^2}{2} - \frac{y}{x} + H(x)$$ $$F = 3x - \dfrac{y}{x} + \dfrac{y^2}{2}$$ $$\boxed{3x - \dfrac{y}{x} + \dfrac{y^2}{2} = C}$$

$$M_y - N_x = 2 - 2xy$$ We can look at both equations to see if this is a multiple of either M or N. We see that N equals (-x/2) * the expression above. $$\dfrac{2 - 2xy}{x^2y - x} = \dfrac{-2(xy - 1)}{x(xy - 1)} = \dfrac{-2}{x}$$ This is written only in terms of x, so we can write $$\rho = e^{\int \frac{-2}{x}\, \mathrm{d}x} =\dfrac{1}{x^2}$$ $$\rho Mdx + \rho Ndy = 0$$ $$(3 + \dfrac{y}{x^2})dx + (y - \frac{1}{x})dy = 0$$ We know $M_y$ = $N_x$ now, so we can say $$F_x = 3 + \dfrac{y}{x^2} \to F = 3x - \frac{y}{x} + G(y)$$ $$F_y = y - \dfrac{1}{x} \to F = \dfrac{y^2}{2} - \frac{y}{x} + H(x)$$ $$F = 3x - \dfrac{y}{x} + \dfrac{y^2}{2}$$ $$\boxed{3x - \dfrac{y}{x} + \dfrac{y^2}{2} = C}$$

David Witten