2.1 Exact Equations and Integrating Factors
Suppose you walk on a hilly landscape whose height is , and you always stay at the same altitude. Your path is a level curve . Along that path the height does not change, so its differential is zero: . Exact equations are exactly this situation, seen backwards. We are handed in disguise, and our job is to find the landscape .
Two ways to write a first-order equation
Every first-order equation in this chapter can be written in one of two forms. The derivative form is
and the differential form is
Moving between them is just algebra. Take, for instance,
Write and cross-multiply:
So and . Going the other way, the equation becomes
In derivative form the roles are fixed: is the independent variable and the unknown function. In differential form and stand on an equal footing, and we are free to pick either one as the unknown. Our default is as a function of ; whenever we switch, we will say so. This section works mostly with the differential form.
Total differentials and exact equations
Recall from calculus how a small change in and changes a function of two variables.
Let have continuous first partial derivatives in a region of the plane. Its total differential is
For example, if , then and , so
Now reverse the question. Someone gives you an expression . Is it the total differential of some function?
The expression is an exact differential in a region if there is a function with
If is an exact differential, the equation is called an exact equation, and is called a potential function for it.
Why do we care? Because an exact equation says , and that is easy to solve.
Let be a differentiable function. Along its graph, the height is . By the chain rule,
The last line is zero exactly when solves . So:
- every solution keeps constant, that is, it lies on a level curve ;
- every differentiable function defined implicitly by is a solution.
Near any point where , the implicit function theorem guarantees that really does define as a differentiable function of . Hence is a one-parameter family of solutions, written in implicit form.
Two questions remain. How can we tell whether is exact without guessing ? And if it is, how do we find ? One theorem answers both.
The exactness test
Let and be continuous, with continuous partial derivatives and , on an open rectangle . Then is an exact differential in if and only if
The condition is easy to remember: differentiate with respect to the other variable , differentiate with respect to the other variable , and compare. Let us see why it works. There are two directions to prove.
Part 1: exact implies
Assume a potential exists, so and in .
- Differentiate the first relation with respect to : .
- Differentiate the second relation with respect to : .
- By hypothesis and are continuous, so both mixed partial derivatives of are continuous. A standard theorem of calculus (Schwarz's, or Clairaut's, theorem) says that continuous mixed partials are equal: .
- Therefore everywhere in .
Part 2: implies exact
This is the useful direction, because the proof builds . Pick any point in and define
In words: walk from vertically up to , collecting , then horizontally to , collecting . Because is a rectangle, both legs of the walk stay inside . We now check the two conditions of Definition 2.1.2.
- The -derivative. The second integral does not depend on . By the fundamental theorem of calculus,
- The -derivative, first integral. Here sits inside the integrand. Since is continuous on the rectangle, we may differentiate under the integral sign:
- Use the hypothesis. Replace by and integrate with respect to :
- The -derivative, second integral. By the fundamental theorem of calculus,
- Add the pieces.
Both conditions hold, so is exact. ∎
The proof needed every horizontal and vertical walk to stay inside the region. A rectangle (or a disc, or any region "without holes") is fine. On a region with a hole, is not enough. The classic example is
defined everywhere except the origin. A direct computation gives . Yet going once around the unit circle, . If a potential existed on the punctured plane, this loop integral would be . So there is no potential on the whole punctured plane, although on any rectangle that avoids the origin there is one (the polar angle).
Finding the potential function
The proof suggests a practical method. We do not need the definite integrals; indefinite integrals with a careful "constant" are enough.
We want with . Integrating with respect to , while holding fixed, gives up to anything that does not depend on , that is, up to a function of alone:
Next we force the second condition, :
Solve this for . When the equation is exact, all the 's cancel and depends on only. Integrate to get , and you have .
- Identify and and check . If it fails, the equation is not exact (try Section 2.4 or another method).
- Integrate with respect to , treating as a constant: .
- Differentiate this with respect to and set it equal to . Solve for . (Check: it must not contain .)
- Integrate to find . No constant of integration is needed here.
- Write the solution as . For an initial condition , take .
Do not "integrate in , integrate in , and add". Terms that contain both variables would be counted twice. Either use the step, or, if you add, keep each term only once.
Step 3 doubles as a check on your work. If, after simplifying, still contains , something is wrong: either the equation is not exact after all (go back to step 1), or there is an algebra slip in step 2. The proof of Theorem 2.1.1 guarantees that for an exact equation the 's always cancel.
Do not be disappointed if the answer stays implicit. A relation is a perfectly good solution. Solving it for is a bonus that is possible only for some , and even then you must choose the right branch, as Example 2.1.3 below shows.
It does not matter which variable you start with. If looks easier, compute and then use to find .
Worked examples
Solve .
Solution
- Test. and . They agree everywhere, so the equation is exact in the whole plane.
- Integrate in .
- Match . The -terms cancel, leaving .
- Find . .
- Answer. Check: and .
Try the exactness test on your own equations. The solver below accepts polynomial and . It checks , builds step by step when the equation is exact, and, when it is not, looks for an integrating factor that depends on only or on only (we explain those in Section 2.4).
(a) Show that is not exact.
(b) Solve .
Solution
- (a) Test. and . Since , the expression is not exact in any rectangle. No potential function exists, and the method of this section does not apply directly.
- (b) Test. and . Exact in the whole plane.
- Integrate in . Remember that is a constant here:
- Match . so and .
- Answer.
Solve the initial-value problem and find an explicit formula for the solution.
Solution
- Test. and . Exact.
- Potential. . Then so and .
- Use the initial condition. . The implicit solution is
- Solve for . This is a quadratic in : . For ,
- Pick the branch. At the square root equals , so the two branches give and . The initial condition picks the minus sign.
- Tidy up. Multiply top and bottom by . The numerator becomes , and the factor cancels: This form also works at , where it gives (check: ).
- Interval. We need . The left side decreases strictly (its derivative is ), so it has exactly one real zero, . The solution lives on . At we have : the slope becomes infinite, just as the remark on predicted.
Integrating factors
Most equations are not exact. Sometimes, though, multiplying by a well-chosen function makes them exact. Consider . Here but , so it is not exact. Multiply every term by :
Now the new coefficients satisfy . The equation has become exact.
A function , not identically zero, is an integrating factor of if
is exact. With continuous partial derivatives, this means .
Wherever , the new equation has the same solutions as the old one, because we can divide back out. So we solve the exact equation and keep its solutions.
Multiplying by can introduce extra curves where (they solve the new equation trivially but may not solve the old one). Dividing by an expression can remove solutions. After using an integrating factor, check the curves where is zero or undefined against the original equation.
In general, finding means solving a partial differential equation, which is harder than the original problem. But in many useful cases depends on one variable only, and then it can be computed with a formula. That is the topic of Section 2.4. For now, we check a given factor.
Show that is an integrating factor of , and solve the equation.
Solution
- Original equation is not exact. , .
- Multiply by . and . Equal, so is an integrating factor.
- Potential. Then must equal , so .
- Solution. .
- Check the zero of . on the line . Treating as a function of , the constant gives and , so it does solve the original equation. It is already contained in the family (take ). Nothing is lost or gained.
Exercises
In Exercises 1–7, decide whether the equation is exact. If it is, solve it.
-
Answer
Exact; . -
Answer
Exact; . -
Answer
Exact; . -
Answer
Not exact: but . -
Answer
Exact; . -
Answer
Exact; . - , for .
Answer
Exact; . - Solve , .
Answer
. - Solve , .
Answer
. - Find the constant that makes exact, and solve the resulting equation.
Answer
; . - Show that is an integrating factor of and solve the equation.
Answer
After multiplying by : ; solution .