Concept:
Given a differential equation of the form:
$$M(x,y)+N(x,y)y'=0 $$
...where M and N are functions of x and y
...and where
$$\frac{dM}{dy}=M_y,\quad\frac{dN}{dx}=N_x$$
...iff
$$ M_y=N_x$$
...then the equation is EXACT and there exists some function named:
$$\Psi(x,y) $$
...such that:
$$\frac{d\Psi}{dx}=\psi_x=M$$
...and:
$$\frac{d\Psi}{dy}=\psi_y=N$$
Ex (1): Determine whether the following equation is exact, and if so find the general solution
$$(2xy^2+2y)+(2x^2y+2x)y'=0 $$
In order to more clearly see which part of the equation is M and N, I sometimes rewrite the equation as the following:
$$(2xy^2+2y)dx+(2x^2y+2x)dy=0 $$
where:
$$M=(2xy^2+2y), \quad and \quad N=(2x^2y+2x) $$
Now take the derivative of M with respect to y and the derivative of N with respect to x:
$$M_y=4xy+2 $$
$$N_x=4xy+2 $$
Since the derivatives are equal, we know that the equation is exact, and that there exists some function:
$$\Psi(x,y) $$
...such that:
$$\frac{\partial \Psi}{\partial x}=M = 2xy^2+2y$$
$$ \frac{\partial \Psi}{\partial y}=N = 2x^2y+2x$$
In order to find the equation Psi(x), we can either integrate M with respect to x, or integrate N with respect to y. Choosing the first option:
$$\int_{}{}M \; dx = \int_{}{}\frac{\partial \Psi}{\partial x} \: dx = \int_{}{}(2xy^2+2y) \; dx $$
$$ \Psi = x^2y^2+2xy + f(y) \qquad(1)$$
When performing the above integral, don't forget that M is a function of both x and y and that we need to include the f(y) since the integral is performed with respect to x only.
Now we need to determine what our f(y) function is for equation #1. We will do so by take the derivative of Psi (eqn 1) with respect to y, and comparing it to N (which is also the derivative of Psi with respect to y by reason of our exact equation)
$$ \frac{\partial \Psi}{\partial y} = 2x^2y + 2x + f'(y) \qquad(2)$$
...Now set eqn #2 equal to N:
$$ 2x^2y + 2x + f'(y) = 2x^2y+2x$$
$$ f'(y)=0$$
$$ f(y)=\int_{}{}0 \: dy = 0+C$$
In this case f(y)=0. However, if it were some other expression or value, you would include it in place of f(y) in eqn #1.
Therefore:
$$ \Psi(x,y)= x^2y^2+2xy+C$$
...and solutions to our differential equation are given implicitly by:
$$ C= x^2y^2+2xy$$