The differential equation M(x,y)dx+N(x,y)dy=0 is exact, if there exists a function f such that df=M(x,y)dx+N(x,y)dy.
In this case, the equation can be rewritten as df=0, which gives the solution f=C.
Test for exactness: if M(x,y) and N(x,y) are continuous functions and have continuous first partial derivatives on some rectangle of the xy-plane, the differential equation is exact, if and only if ∂y∂M(x,y)=∂x∂N(x,y).
To solve this equation, we use the facts that ∂x∂f(x,y)=M(x,y) and ∂y∂f(x,y)=N(x,y). We integrate the first equation with respect to x to obtain f(x,y) through x and an unknown function g(y). We then differentiate the result with respect to y and use the second equation. After this, we find g(y) and thus f(x,y). The solution, as already stated above, is given as f(x,y)=C.
Example 1. Solve (x+sin(y))dx+(xcos(y)−2y)dy=0.
Here, M(x,y)=x+sin(y), N(x,y)=xcos(y)−2y. Since ∂y∂M=cos(y) and ∂x∂N=cos(y), we have that ∂y∂M=∂x∂N and the differential equation is exact.
Thus, there exists a function f such that ∂x∂f=M(x,y)=x+sin(y) and ∂y∂f=N(x,y)=xcos(y)−2y.
Integrate the first equation with respect to x to obtain that f=∫(x+sin(y))dx=21x2+xsin(y)+g(y).
Note that here, the constant of integration can depend on y (because we integrate with respect to x).
Now, differentiate the resulting equation with respect to y:
∂y∂f=0+xcos(y)+g′(y).
On the other hand, ∂y∂f=N(x,y)=xcos(y)−2y.
So, xcos(y)+g′(y)=xcos(y)−2y, or g′(y)=−2y. Integrating it, we obtain that g(y)=−y2+c1.
Thus,
f=21x2+xsin(y)−y2+c1. The solution is given as 21x2+xsin(y)−y2+c1=C,
Or 21x2+xsin(y)−y2=c2, where c2=C−c1.
We obtain an implicit solution, and there is no way to find an explicit solution.
Let's work another example.
Example 2. Solve y′=2y−xexy2+yexy.
First, rewrite it into the differential form: dxdy=2y−xexy2+yexy, or (2+yexy)dx+(xexy−2y)dy=0.
Here, M(x,y)=2+yexy, and N(x,y)=xexy−2y.
Since ∂y∂M=exy+xyexy and ∂x∂N=exy+xyexy, we have that∂y∂M=∂x∂N and the differential equation is exact.
So, there exists a function f such that ∂x∂f=M(x,y)=2+yexy and ∂y∂f=N(x,y)=xexy−2y. In the previous example, we took the first equation and integrated it with respect to x. Actually, we could take the second equation and integrate it with respect to y. The final answer is the same. In this example, we will take the second equation and integrate it with respect to y:
f=∫(xexy−2y)dy=exy−y2+g(x). Note that the constant of integration depends on x, since we integrate with respect to y.
Now, differentiate the resulting equation with respect to x:
∂x∂f=yexy+g′(x).
On the other hand, ∂x∂f=2+yexy; so, yexy+g′(x)=2+yexy, or g′(x)=2.
Integrating with respect to x gives g(x)=2x+c1.
So, f=exy−y2+g(x)=exy−y2+2x+c1.
And the solution is exy−y2+2x+c1=C or exy−y2+2x=c2, where c2=C−c1.
Sometimes, an equation can be not exact, but it can be transformed into an exact one by multiplying the equation by the integrating factor.
So, I(x,y) is the integrating factor for the differential equation, if I(x,y)(M(x,y)dx+N(x,y)dy)=0 is exact.
There are 2 conditions that allow to find the integrating factor easily:
If N1(∂y∂M−∂x∂N)=g(x), a function of x alone, then I(x,y)=e∫g(x)dx.
If M1(∂y∂M−∂x∂N)=h(y), a function of y alone, then I(x,y)=e−∫h(y)dy.
Now, let's do some more work with another example
Example 3. Solve (y+1)dx−xdy=0.
Here, M(x,y)=y+1, and N(x,y)=−x. Since ∂y∂M=1 and ∂x∂N=−1, we have that ∂y∂M=∂x∂N and the equation is not exact. However, note that N1(∂y∂M−∂x∂N)=−x1(1−(−1))=−x2=g(x).
So, I(x,y)=e∫−x2dx=e−2ln(x)=x21.
Multiplying the differential equation by the integrating factor gives: x2y+1dx−x1dy=0.
This equation is exact; so, there exists a function f such that df=x2y+1dx−x1dy. Using the fact that ∂x∂f=x2y+1, we find that f=∫x2y+1dx=−xy+1+g(y). Now, differentiating with respect to y gives: ∂y∂f=−x1+g′(y). On the other hand, ∂y∂f=−x1; so, −x1+g′(y)=−x1, or g′(y)=0.
Solving it, we obtain that g(y)=C1.
So, f(x,y)=−xy+1+g(y)=−xy+1+C1.
Therefore, the solution is −xy+1+C1=C, or y=c2x−1, where c2=C1−C.
Let's solve another equation.
Example 4. Solve 2xydx+y2dy=0.
Here, M(x,y)=2xy, and N(x,y)=y2. Since ∂y∂M=2x and ∂x∂N=0, we have that ∂y∂M=∂x∂N and the differential equation is not exact.
However, note that M1(∂y∂M=∂x∂N)=2xy1(2x−0)=y1=h(y).
So, the integrating factor is I(x,y)=e−∫y1dy=e−ln(y)=y1.
Multiplying the differential equation by the integrating factor yields y1(2xydx+y2dy)=0, or 2xdx+ydy=0.
This equation is exact. Using the fact that ∂x∂f=2x, we have that f=∫(2x)dx=x2+h(y). Differentiating the last eqaution with respect to y gives: ∂y∂f=h′(y).
On the other hand, ∂y∂f=y; so, h′(y)=y, or h(y)=∫ydy=21y2+c1.
Hence, f=x2+h(y)=x2+21y2+c1, and the solution is x2+21y2+c1=C, or x2+21y2=c2, where c2=C−c1.
Another case when the integrating factor can be found easily is when M=yf(xy) and N=xg(xy). In this case, I(x,y)=xM−yN1.
Example 5. Solve y(1−xy)dx+xdy=0.
The equation is not exact; however, note that M(x,y) is in the form y(1−xy) and N(x,y)=x⋅1; so, the integrating factor is I(x,y)=xy(1−xy)−xy1=−(xy)21. Multiplying by I(x,y) yields:
x2yxy−1dx−xy21dy=0. This equation is exact.
Using the fact that ∂x∂f=x2yxy−1, we have that f=∫(x2yxy−1)dx=ln(∣x∣)+xy1+g(y).
Differentiating with respect to y gives: ∂y∂f=−xy21+g′(y). On the other hand, ∂y∂f=−xy21.
So, g′(y)=0, or g(y)=c1.
Thus, f(x,y)=ln(∣x∣)+xy1+c1.
Finally, the solution is ln(∣x∣)+xy1+c1=C, or ln(∣x∣)+xy1=c2, where c2=C−c1.
Below is the list of common integrating factors:
Group of terms | I(x,y) | Exact differential dg(x,y) |
ydx−xdy | −x21 | −x2ydx−xdy=d(xy) |
ydx−xdy | y21 | y2ydx−xdy=d(yx) |
ydx−xdy | −xy1 | −xyydx−xdy=d(ln(xy)) |
ydx−xdy | −x2+y21 | −x2+y2ydx−xdy=d(arctan(xy)) |
ydy+xdx | xy1 | xyydy+xdx=d(ln(xy)) |
ydy+xdx | (xy)n1,n>1 | (xy)nydy+xdx=−d((n−1)(xy)n−11) |
ydy+xdx | x2+y21 | x2+y2ydy+xdx=d(21ln(x2+y2)) |
ydy+xdx | (x2+y2)n1,n>1 | (x2+y2)nydy+xdx=−d(2(n−1)(x2+y2)n−11) |
aydx+bxdy (a and b are constants) | xa−1yb−1 | xa−1yb−1(aydx+bxdy)=d(xayb) |
In general, integrating factors are difficult to uncover. If a differential equation doesn't have one of the forms given above, searching for the integrating factor will likely be unsuccessful, and one should resort to other solution methods.