Let's see the equation first: (3x+6/y) + (x

^{2}/y +3y/x)dy/dx = 0.

Set M = 3x+6/y and N = x

^{2}/y +3y/x,

Then differentiate M w.r.t y and differentiate N w.r.t x, and then we derive that:

M

_{y}= -6/(y

^{2}) and N

_{x} = 2x/y - 3y/x

^{2},

since My doesn't equal to Nx, then it is not exact.

Then we need to consider about the non-exact method.

However, note that:

(M

_{y}-N

_{x})/N is not only a function of x, and (M

_{y}-N

_{x})/M is not only a function of y.

Therefore we cannot use the normal method, so we have to use the formula:

(N

_{x} - M

_{y})/(xM - yN) = R, where R = R(xy) depends on the quantity xy only

(if you did not get it, then there must be something wrong, as if it is only function of x or only function of y, we would not need to use this method in the first place), then the differential equation had an integrating factor of the form μ(xy).

R = (N

_{x} - M

_{y})/(xM - yN)

= (2x/y - 3y/x

^{2} + 6/y

^{2}) / (3x

^{2} + 6x/y - x

^{2} - 3y

^{2}/x)

= 1/(xy)

Let t = xy, so R = 1/(xy) = (1/t)

μ(xy) = e

^{(∫1/t dt)} = e

^{(lnt)} = t = xy

Multiply μ(xy) on both sides of (3x+6/y) + (x

^{2}/y +3y/x)dy/dx = 0.

Then we derive that (3x

^{2}y+ 6x) + (x

^{3 }+ 3y

^{2}) dy/dx = 0.

Set M = 3(x

^{2})y+ 6x and N = x

^{3} + 3y

^{2},

Similarly, after differentiation, we can get that:

M

_{y} = 3x

^{2} = N

_{x}, which is exact now!

So we can use the exact method.

There exists φ(x,y) s.t. φ

_{x} = M, φ

_{y} = N

Hence, φ = ∫M dx = ∫3x

^{2}y + 6x dx = yx

^{3} + 3x

^{2} + h(y)

(I write h(y) as it acts like a constant after we integrate w.r.t x only)

Therefore φ

_{y} = x

^{3} + h'(y) = x

^{3} + 3y

^{2}hence h'(y) = 3y

^{2}, h(y) = y

^{3} + c

Therefore, φ = yx

^{3} + 3x

^{2} + y

^{3} = c

Hope it helps