Very few differential equations are exact. So are exact equations worth discussing at all? Yes, because a non-exact equation can often be made exact by multiplying through by a suitable function , called an integrating factor. This section shows that such a factor always exists in principle, that it is never unique, and gives two practical formulas that find it in the most common cases.
Quick Reference
| Item | Statement |
|---|---|
| Integrating factor | such that is exact |
| Existence | Any equation with a solution has at least one integrating factor |
| Uniqueness | Never unique. If works so does , and so does for any function |
| Defining condition | |
| Factor of alone | If , then |
| Factor of alone | If , then |
| Memory aid | Divide by for a factor in ; divide by for a factor in , and flip the sign |
A Motivating Example
Consider the following differential equation:
x^2 - y^2 + 2xy\,y' = 0 \qquad \text{or} \qquad x^2 - y^2 + 2xy\frac{dy}{dx} = 0 .Multiplying both sides by , we can rewrite it in the form as
Here
so this equation is not exact. Now multiply through by the factor . The equation becomes
We know that this equation is exact, since
The factor is called an integrating factor.
A function is called an integrating factor for the equation if the equation
is exact.
Multiplying by does not change the solution curves, as long as is never zero on the region of interest, because the equation still asserts that the same expression equals zero. What changes is the form, and the new form is one we know how to solve.
Now the question is: when does such an integrating factor exist?
Which Equations Have Integrating Factors?
Suppose is the general solution of . Because and
we have
\frac{\partial f}{\partial x}\,dx + \frac{\partial f}{\partial y}\,dy = 0 \quad \Longrightarrow \quad \frac{dy}{dx} = -\frac{\dfrac{\partial f}{\partial x}}{\dfrac{\partial f}{\partial y}} . \tag{i}
It also follows from the equation that
\frac{dy}{dx} = -\frac{M(x,y)}{N(x,y)} . \tag{ii}
Comparing (i) and (ii),
or, cross-multiplying,
Let us denote this common ratio by :
Therefore
and consequently
Any differential equation that has a solution possesses at least one integrating factor. Moreover, if the solution is known, the integrating factor can be determined from it directly.
Note carefully what this theorem does and does not give you. It guarantees existence, and it converts a known solution into an integrating factor. It does not tell you how to find the factor when the solution is unknown, which is the situation you are usually in. The rest of this section is about the cases where the factor can be found in advance.
The Integrating Factor Is Not Unique
If is an integrating factor for , then so is for any real constant , since multiplying an exact equation by a constant leaves it exact.
More generally, if a solution of the equation is , then is also an integrating factor, where is an arbitrary function. To see why,
\begin{aligned} I(x,y)F(f)\left[M(x,y)\,dx + N(x,y)\,dy\right] &= F(f)\left[\underbrace{IM}_{\partial f/\partial x}\,dx + \underbrace{IN}_{\partial f/\partial y}\,dy\right] \\ &= F(f)\,df \\ &= d\left[\int F(f)\,df\right] = 0 . \end{aligned}The last line is the key step: is itself a total differential, namely of any antiderivative of evaluated at .
If an equation has one integrating factor, then it has infinitely many.
This is good news in practice. You need only find some factor, not the "right" one, and different valid factors lead to solutions that differ only by relabeling the arbitrary constant.
How to Find Integrating Factors
Because is exact, the exactness test applied to the new coefficients gives
Expanding both sides with the product rule,
\begin{aligned} M\frac{\partial I}{\partial y} + I\frac{\partial M}{\partial y} &= N\frac{\partial I}{\partial x} + I\frac{\partial N}{\partial x} \\ \Longrightarrow \quad \frac{1}{I}\left(M\frac{\partial I}{\partial y} - N\frac{\partial I}{\partial x}\right) &= \frac{\partial N}{\partial x} - \frac{\partial M}{\partial y} \end{aligned} \tag{7}
This is a partial differential equation for , which looks more complicated than the original equation we set out to solve. That is the honest situation: finding integrating factors in general is harder than the problem it was meant to simplify. What saves the method is that a few special assumptions collapse (7) into something easy.
When the Integrating Factor Depends on or Alone
Assume is a function of alone. Then and , so (7) reduces to
Because the left-hand side is a function of alone, the right-hand side must be a function of alone as well. This gives a usable test. Let
then
Integrating,
\therefore \quad I(x) = e^{\int A(x)\,dx} \tag{8}
The argument is reversible: if turns out to be a function of alone, then given by (8) really is an integrating factor for .
Similarly, if is a function of alone, then .
The two working formulas.
If depends only on , then
If depends only on , then
In words: form the difference once. Divide it by and check whether the variables cancel; if so, exponentiate the integral. If not, divide the same difference by and check whether the variables cancel; if so, exponentiate minus the integral. The sign difference between the two formulas is the detail most often forgotten.
Worked Examples
Find an integrating factor for .
Solution
Here and , so and . Testing the first formula,
which is a function of only. According to formula (8), an integrating factor is
\begin{aligned} I(x) &= \exp\left(\int -\frac{2}{x}\,dx\right) \\ &= \exp\left(-2\ln|x|\right) \\ &= \exp\left(\ln\frac{1}{x^2}\right) \qquad \text{(recall } y\ln x = \ln x^{y}\text{)} \\ &= \frac{1}{x^2} . \end{aligned}This confirms the factor guessed at the start of the section.
Find an integrating factor for and solve the equation.
Solution
Here
so
Try the -only formula first: dividing by would leave terms behind, so it fails. Try the -only formula:
a constant, which certainly qualifies as a function of alone.
The integrating factor is
Now multiply the equation by :
and since ,
You can verify that this equation is exact. Suppose is the general solution. Then
so
\begin{aligned} f(x,y) &= \int e^{-y}e^{x}(x+1)\,dx + g(y) \\ &= e^{-y}\int \frac{d}{dx}\left(x e^{x}\right)dx + g(y) \\ &= x e^{-y}e^{x} + g(y) \end{aligned}where is the "constant" of integration. The middle step used the observation that , which is exactly the integrand; integration by parts gives the same result.
Now impose :
-x e^{-y}e^{x} + g'(y) = y - x e^{-y}e^{x} \quad \Longrightarrow \quad g'(y) = y \quad \Longrightarrow \quad g(y) = \frac{1}{2}y^2 .Therefore the general solution of this differential equation is
Exercises
Find an integrating factor for and solve.
Solution
With and , we get and , so the equation is not exact.
a function of alone. So .
Multiplying through, . Now , confirming exactness.
Integrating the new in : . Then \partial f/\partial y = 2x^2 y + g'(y), matching gives g'(y) = 0.
The general solution is .
Find an integrating factor for and solve.
Solution
With and , we get and .
which still contains , so no factor of alone. Try the other formula:
Therefore
Multiplying, , which satisfies .
Integrating in : , so \partial f/\partial y = 2xy + g'(y) = 2xy - y^2 e^{y}, giving g'(y) = -y^2 e^{y}. Integrating by parts twice,
so .
The general solution is .
Verify directly that if is an integrating factor, so is . Why does this not give a genuinely different solution?
Solution
If for some , then , which is again a total differential, so is an integrating factor with potential function .
The solution it produces is , that is, . Since is arbitrary, so is , and the family of solution curves is identical. Different integrating factors relabel the constant, not the curves.
Frequently Asked Questions
What is an integrating factor?
It is a function that you multiply an equation by to make it exact. The original equation fails the test ; the new equation passes it, and has the same solution curves.
Does every equation have an integrating factor?
Every equation that has a solution has one, and in fact infinitely many. But the theorem giving this is not constructive: the proof builds the factor out of the solution, which is what you were trying to find. In practice you rely on the two special formulas, on recognizable patterns, or on inspection.
Why does making the equation exact not change the solutions?
Because both equations say that the same quantity equals zero. If then multiplying by any nonzero preserves the equality. The caveat is the word nonzero: on a curve where vanishes, the multiplied equation is satisfied trivially, so spurious solutions can be introduced there and should be checked.
How do I decide which of the two formulas to try?
Compute the difference once, then test both quotients. Divide by : if the result is free of , use . Divide by : if the result is free of , use . If neither quotient simplifies, these two methods do not apply and you need a different form of factor.
Why does the formula have a minus sign in the exponent?
It comes from the position of the terms in the general condition (7). Setting leaves , and dividing by puts the negative of on the right. The asymmetry is real, and reversing the sign is the most common error in these problems.
What if neither formula works?
Try a factor of the form and solve for the exponents that force exactness, which handles many equations built from monomials. Some equations respond to a factor depending on the combination or . And a handful of expressions are worth memorizing on sight: and appear constantly.
Is the linear equation y' + P(x)y = Q(x) related to this?
Directly. In differential form it reads , and the first formula gives , hence . That is exactly the integrating factor derived in the next section. Linear equations are the single most important family for which the -only formula always succeeds.