3.8: Integrating Factors
( \newcommand{\kernel}{\mathrm{null}\,}\)
In Section 3.8 we saw that if M, N, My and Nx are continuous and My=Nx on an open rectangle R then
M(x,y)dx+N(x,y)dy=0
is exact on R. Sometimes an equation that isn’t exact can be made exact by multiplying it by an appropriate function. For example,
(3x+2y2)dx+2xydy=0
is not exact, since My(x,y)=4y≠Nx(x,y)=2y in Equation ???. However, multiplying Equation ??? by x yields
(3x2+2xy2)dx+2x2ydy=0,
which is exact, since My(x,y)=Nx(x,y)=4xy in Equation ???. Solving Equation ??? by the procedure given in Section 2.5 yields the implicit solution
x3+x2y2=c.
A function μ=μ(x,y) is an integrating factor for Equation ??? if μ(x,y)M(x,y)dx+μ(x,y)N(x,y)dy=0 is exact. If we know an integrating factor μ for Equation ???, we can solve the exact equation Equation ??? by the method of Section 2.5. It would be nice if we could say that Equation ??? and Equation ??? always have the same solutions, but this isn’t so. For example, a solution y=y(x) of Equation ??? such that μ(x,y(x))=0 on some interval a<x<b could fail to be a solution of ??? (Exercise 3.9.1)
Finding Integrating Factors
By applying Theorem 3.8.2 (with M and N replaced by μM and μN), we see that Equation ??? is exact on an open rectangle R if μM, μN, (μM)y, and (μN)x are continuous and ∂∂y(μM)=∂∂x(μN)or, equivalently,μyM+μMy=μxN+μNx on R. It’s better to rewrite the last equation as μ(My−Nx)=μxN−μyM, which reduces to the known result for exact equations; that is, if My=Nx then Equation ??? holds with μ=1, so Equation ??? is exact.
You may think Equation ??? is of little value, since it involves partial derivatives of the unknown integrating factor μ, and we haven’t studied methods for solving such equations. However, we’ll now show that Equation ??? is useful if we restrict our search to integrating factors that are products of a function of x and a function of y; that is, μ(x,y)=P(x)Q(y). We’re not saying that every equation Mdx+Ndy=0 has an integrating factor of this form; rather, we are saying that some equations have such integrating factors.We’llnow develop a way to determine whether a given equation has such an integrating factor, and a method for finding the integrating factor in this case.
If μ(x,y)=P(x)Q(y), then μx(x,y)=P′(x)Q(y) and μy(x,y)=P(x)Q′(y), so Equation ??? becomes
P(x)Q(y)(My−Nx)=P′(x)Q(y)N−P(x)Q′(y)M, or, after dividing through by P(x)Q(y),
My−Nx=P′(x)P(x)N−Q′(y)Q(y)M. Now let p(x)=P′(x)P(x)andq(y)=Q′(y)Q(y), so Equation ??? becomes
My−Nx=p(x)N−q(y)M.
We obtained Equation ??? by assuming that Mdx+Ndy=0 has an integrating factor μ(x,y)=P(x)Q(y). However, we can now view Equation ??? differently: If there are functions p=p(x) and q=q(y) that satisfy Equation ??? and we define
P(x)=±e∫p(x)dxandQ(y)=±e∫q(y)dy,
then reversing the steps that led from Equation ??? to Equation ??? shows that μ(x,y)=P(x)Q(y) is an integrating factor for Mdx+Ndy=0. In using this result, we take the constants of integration in Equation ??? to be zero and choose the signs conveniently so the integrating factor has the simplest form.
There’s no simple general method for ascertaining whether functions p=p(x) and q=q(y) satisfying Equation ??? exist. However, the next theorem gives simple sufficient conditions for the given equation to have an integrating factor that depends on only one of the independent variables x and y, and for finding an integrating factor in this case.
Theorem 3.8.1
Let M, N, My, and Nx be continuous on an open rectangle R. Then:
(a) If (My−Nx)/N is independent of y on R and we define p(x)=My−NxN then μ(x)=±e∫p(x)dx is an integrating factor for M(x,y)dx+N(x,y)dy=0 on R.
(b) If (Nx−My)/M is independent of x on R and we define q(y)=Nx−MyM, then μ(y)=±e∫q(y)dy is an integrating factor for Equation ??? on R.
- Proof
-
(a) If (My−Nx)/N is independent of y, then Equation ??? holds with p=(My−Nx)/N and q≡0. Therefore P(x)=±e∫p(x)dx andQ(y)=±e∫q(y)dy=±e0=±1, so Equation ??? is an integrating factor for Equation ??? on R.
(b) If (Nx−My)/M is independent of x then eqrefeq:3.9.8 holds with p≡0 and q=(Nx−My)/M, and a similar argument shows that Equation ??? is an integrating factor for Equation ??? on R.
The next two examples show how to apply Theorem 3.8.1.
Example 3.8.1
Find an integrating factor for the equation (2xy3−2x3y3−4xy2+2x)dx+(3x2y2+4y)dy=0 and solve the equation.
Solution
In Equation ??? M=2xy3−2x3y3−4xy2+2x, N=3x2y2+4y, and My−Nx=(6xy2−6x3y2−8xy)−6xy2=−6x3y2−8xy, so Equation ??? isn’t exact. However, My−NxN=−6x3y2+8xy3x2y2+4y=−2x is independent of y, so Theorem 3.8.1 (a) applies with p(x)=−2x. Since ∫p(x)dx=−∫2xdx=−x2, μ(x)=e−x2 is an integrating factor. Multiplying Equation ??? by μ yields the exact equation e−x2(2xy3−2x3y3−4xy2+2x)dx+e−x2(3x2y2+4y)dy=0.
To solve this equation, we must find a function F such that Fx(x,y)=e−x2(2xy3−2x3y3−4xy2+2x) and Fy(x,y)=e−x2(3x2y2+4y). Integrating Equation ??? with respect to y yields F(x,y)=e−x2(x2y3+2y2)+ψ(x). Differentiating this with respect to x yields Fx(x,y)=e−x2(2xy3−2x3y3−4xy2)+ψ′(x). Comparing this with Equation ??? shows that ψ′(x)=2xe−x2; therefore, we can let ψ(x)=−e−x2 in Equation ??? and conclude that e−x2(y2(x2y+2)−1)=c is an implicit solution of Equation ???. It is also an implicit solution of Equation ???.
Figure 3.8.1 shows a direction field and some integral curves for Equation ???

Example 3.8.2
Find an integrating factor for
2xy3dx+(3x2y2+x2y3+1)dy=0
and solve the equation.
Solution
In Equation ???,
M=2xy3,N=3x2y2+x2y3+1,
and
My−Nx=6x2−(6xy2+2xy3)=−2xy3,
so Equation ??? isn't exact. Moreover,
My−NxN=−2xy33x2y2+x2y2+1
is not independent of y, so Theorem 3.9.1(a) does not apply. However, Theorem 3.9.1(b) does apply, since
Nx−MyM=2xy32xy3=1
is not independent of x, so we can take q(y)=1. Since
∫q(y)dy=∫dy=y,
μ(y)=ey is an integrating factor. Multiplying Equation ??? by μ yields the exact equation.
2xy3eydx+(3x2y2+x2y3+1)eydy=0.
To solve this equation, we must find a function F such that
Fx(x,y)=2xy3ey
and
Fy(x,y)=(3x2y2+x2y3+1)ey.
Integrating Equation ??? with respect to x yields
F(x,y)=x2y3ey+ϕ(y)
Differentiating this with respect to y yields
Fy=(3x2y2+x2y3)ey+ϕ′(y)
and comparing this with Equation ??? shows that φ 0 (y) = e y . Therefore we set φ(y) = e y in Equation ??? and conclude that
(x2y3+1)ey=c
is an implicit solution of ???. It is also an implicit solution of ???. Figure 3.8.2 shows a direction field and some integral curves for ???.

Theorem 3.8.1 does not apply in the next example, but the more general argument that led to Theorem 3.8.1 provides an integrating factor.
Example 3.8.3
Find an integrating factor for
(3xy+6y2)dx+(2x2+9xy)dy=0
and solve the equation.
Solution
In Equation ???
M=3xy+6y2,N=2x2+9xy,
and
My−Nx=(3x+12y)−(4x+9y)=−x+3y.
Therefore
My−NxM=−x+3y3xy+6y2andNx−MyN=x−3y2x2+9xy
so Theorem 3.8.1 does not apply. Following the more general argument that led to Theorem 3.8.1, we look for functions p=p(x) and q=q(y) such that
My−Nx=p(x)N−q(y)M;
that is,
−x+3y=p(x)(2x2+9xy)−q(y)(3xy+6y2).
Since the left side contains only first degree terms in x and y, we rewrite this equation as
xp(x)(2x+9y)−yq(y)(3x+6y)=−x+3y.
This will be an identity if
xp(x)=Aandyq(y)=B,
where A and B are constants such that
−x+3y=A(2x+9y)−B(3x+6y),
or, equivalently,
−x+3y=(2A−3B)x+(9A−6B)y.
Equating the coefficients of x and y on both sides shows that the last equation holds for all (x,y) if
2A−3B=−19A−6B=3
which has the solution A = 1, B = 1. Therefore Equation ??? implies that
p(x)=1xandq(y)=1y.
Since
∫p(x)dx=ln|x|and∫q(y)dy=ln|y|,
we can let P(x)=x and Q(y)=y; hence, µ(x,y)=xy is an integrating factor. Multiplying Equation ??? by µ yields the exact equation
(3x2y2+6xy3)dx+(2x3y+9x2y2)dy=0.

We leave it to you to use the method of Section 2.5 to show that this equation has the implicit solution
x3y2+3x2y3=c.
This is also an implicit solution of Equation ???. Since x ≡ 0 and y ≡ 0 satisfy Equation ???, you should check to see that x ≡ 0 and y ≡ 0 are also solutions of Equation ???. (Why is it necesary to check this?) Figure 3.8.3 shows a direction field and integral curves for Equation ???. See Exercise 3.9.28 for a general discussion of equations like Equation ???.
Example 3.8.4
The separable equation
−ydx+(x+x6)dy=0
can be converted to the exact equation
−dxx+x6+dyy=0
by multiplying through by the integrating factor
μ(x,y)=1y(x+x6).
However, to solve Equation ??? by the method of Section 2.5 we would have to evaluate the nasty integral
∫dxx+x6.
Instead, we solve Equation ??? explicitly for y by finding an integrating factor of the form µ(x,y)=xayb.

Solution
In Equation ???
M=−y, N=x+x6,
and
My−Nx=−1−(1+6x5)=−2−6x5.
We look for functions p=p(x) and q=q(y) such that
My−Nx=p(x)N−q(y)M;
that is,
−2−6x5=p(x)(x+x6)+q(y)y.
The right side will contain the term −6x5 if p(x)=−6/x. Then Equation ??? becomes
−2−6x5=−6−6x5+q(y)y,
so q(y)=4/y. Since
∫p(x)dx=−∫6xdx=−6ln|x|=ln1x6,
and
∫q(y)dy=∫4ydy=4ln|y|=lny4,
we can take P(x)=x−6 and Q(y)=y4, which yields the integrating factor μ(x,y)=x−6y4. Multiplying Equation ??? by μ yields the exact equation
−y5x6dx+(y4x5+y4)dy=0.
We leave it to you to use the method of the Section 2.5 to show that this equation has the implicit solution
(yx)5+y5=k.
Solving for y yields
y=k1/5x(1+x5)−1/5,
which we rewrite as
y=cx(1+x5)−1/5
by renaming the arbitrary constant. This is also a solution of Equation ???.
Figure 3.8.4 shows a direction field and some integral curves for Equation ???.