 # Exact Differential Equations (Making Inexact Equations Exact)

Given a differential equation of the form:

$$M(x,y)+N(x,y)y'=0$$

Iff:

$$M_y \neq N_x$$

...then the equation is not exact. However, it is possible to make it exact if:

$$\frac{M_y-N_x}{N} \qquad(1)$$

...is a function of x only, then there exists an integrating factor (u) such that:

$$\frac{du}{dx} = \frac{M_y-N_x}{N}u \qquad(2)$$

The integrating factor (u) can be found by solving for (u) in equation 2 (which is both linear and separable). We can also use a similar procedure to determine an integrating factor that depends only on y by changing equation (1) to:

$$\frac{N_x-M_y}{M} \qquad(3)$$

If equation 3 is a function of y only then the integrating factor (u) can be found by solving for u in:

$$\frac{du}{dy} = \frac{N_x-M_y}{M}u \qquad(4)$$

...which is also linear and separable.

# Given:

$$(3x^2y+2xy+y^3)+(x^2+y^2)y'=0$$

$$(3x^2y+2xy+y^3)+(x^2+y^2)\frac{dy}{dx}=0$$

$$(3x^2y+2xy+y^3)dx+(x^2+y^2)dy=0$$

$$M_y=3x^2+2x+3y^2$$

...and:

$$N_x=2x$$

$$...since \quad M_y \neq N_x,$$

$$the \ equation \ is \ not \ exact.$$

$$\frac{M_y-N_x}{N}= \frac{3x^2+3y^2}{x^2+y^2}$$

$$=3 \qquad(5)$$

...recall from above that since equation (5) is not a function of both x and y (it can be considered a function of x only for our demonstration), we can use:

$$\frac{du}{dx} = \frac{M_y-N_x}{N}u$$

...to find an integrating factor by solving for u in the following:.

$$\frac{du}{dx} = 3u$$

$$\frac{1}{3u}du=dx$$

$$\frac{1}{3}\int_{}{}\frac{1}{u}du = \int_{}{}dx$$

$$\frac{1}{3}ln \;u = x$$

$$ln \; u = 3x$$

$$u = e^{3x}=integrating \; factor.$$

Now multiply the original equation by our integrating factor.

$$e^{3x}(3x^2y+2xy+y^3)+e^{3x}(x^2+y^2)=0$$

$$M=e^{3x}(3x^2y+2xy+y^3)$$

$$N=e^{3x}(x^2+y^2)$$

The above equation is now exact since:

$$M_y=N_x=(3x^2e^{3x}+2xe^{3x}+3y^2e^{3x})$$

Feel free to work out the above statement yourself since I didn't work through the derivatives here. Since our new equation is now exact, there exists a function:

$$\Psi(x,y)$$

...where:

$$\psi_x=M=e^{3x}(3x^2y+2xy+y^3) \qquad(6)$$

$$\psi_y=N=e^{3x}(x^2+y^2) \qquad(7)$$

...don't forget that M and N are with respect to our rewritten differential equation that resulted from multiplying the original equation by our integrating factor. From here on out, the process is the same as described in the previous Exact Equations tutorial.

Using equation (7), integrate it with respect to y in order to find the function Psi:

$$\Psi(x,y) = \int_{}{}e^{3x}(x^2+y^2)\;dy$$

$$\Psi(x,y) = e^{3x}x^2y+\frac{1}{3}e^{3x}y^3+z(x)+K \qquad(8)$$

...don't forget the z(x) since the function being integrated is a function of both x and y. In order to find z(x), take the derivative of the above (eqn 8) with respect to x.

$$\frac{\partial \Psi}{\partial x} = 3e^{3x}x^2y+2xye^{3x}+e^{3x}y^3+z'(x)$$

Now set the above equation equal to the value of M that we obtained after multiplying through by our integrating factor.

$$3e^{3x}x^2y+2xye^{3x}+e^{3x}y^3+z'(x)=e^{3x}(3x^2y+2xy+y^3)$$

...and solve for z(x)

$$z'(x) = 0$$

$$z(x) = \int_{}{}0\;dx = 0+A$$

Plugging this value for z(x) into equation (8) gives us:

$$\Psi(x,y) = e^{3x}x^2y+\frac{1}{3}e^{3x}y^3+z(x)+K+A$$

...and solutions to our differential equation are given implicitly by:

$$e^{3x}x^2y+\frac{1}{3}e^{3x}y^3=C$$