Compute to the dM/dy.

Compute the dM/dy then from this first part by the product flow, you have dM/dy,

-2x²y sin x

+ 4xy cos x.

On the other hand,

the dN/dx is equal to,

from this one, by the product flow,

you have 4xy cos x,

then 2x²y times derivative of cos x,

that is equal to negative sin of x.

In total you get,

-2x²y times the sin x. dM/dy is the same as dN/dx.

What does that mean?

This new differential equation which we obtain

by multiplying the equation (6) by the integrating factor xy,

this is really exact.

In other words, μ(x,y) is equal to x times y,

this is really an integrating factor of the equation (6).

Now, we are ready to solve this exact differential equation.

There must be a function F,

whose y partial derivative is equal to N of xy,

which is 2x²y and cos x.

Then, what is the F?

Through the integration, F is equal to integral of

2x²y cos xdy plus integrating constant,

which is an arbitrary differential function of x that I denoted by g(x).

Now the integration will be 2x² times

the cos x is a constant respect to the dy integration.

You simply have x² and y² cos x.

That's the antiderivative of this.

Our candidate for F will be x² and y² cos x + g(x).

This candidate must satisfied another conditions say,

dF/dx = M. First,

from this the expression here, what is dF/dx?

From this part of product flow,

it's first 2xy² cos x

then plus x² times y² times derivative of cos x is a negative sign of x.

So here you get the negative x²y² sin x.

Finally, derivative of g will be g' of x.

That must be equal to M. M is of this one.

Compare these two.

First, negative x²y² sin x,

it's the same as here.

They canceled out and 2xy² cos x,

they are common in both sides,

so they canceled out again.

We get g'(x) is identically zero.

That means we can take g(x) to be zero.

Finally, we get x²y² cos x and plus zero,

that is equal to arbitrary constant c down there.

This is a general solution of the given nonexact differential equation (6).

Remember that we find the general solution,

by first checking out that the function

x times y is an integrating factor of the differential equation (6).