Sometimes the expression is the total differential of a single function . When that happens the equation says simply , and the solution is . This section answers two questions: how to test whether an equation is of this type, and how to recover when it is.
Quick Reference
| Item | Statement |
|---|---|
| Total differential | |
| Exact equation | where and for some |
| Test for exactness | , necessary and sufficient |
| General solution | |
| Step 1 | |
| Step 2 | Set and solve for g'(y) |
| Step 3 | Integrate g'(y) and write |
| Alternative route | Start from and integrate in , with an "constant" |
Where Exact Equations Come From
We remember from calculus that if a function has continuous first partial derivatives, its total differential is defined by
dz = df = \frac{\partial f}{\partial x}\,dx + \frac{\partial f}{\partial y}\,dy . \tag{1}
Therefore, if a family of curves is described by , taking the differential of both sides gives
df = \frac{\partial f}{\partial x}\,dx + \frac{\partial f}{\partial y}\,dy = 0 . \tag{2}
Recall that the differential of a constant is zero, which is what makes the right-hand side vanish.
This is the same elimination of arbitrary constants met in Section 1.3, now viewed through differentials. Every one-parameter family produces a first-order differential equation, and equations produced this way are exactly the ones this section solves.
The family of curves satisfies a differential equation. Find it.
Solution
Take the differential of both sides:
or
Dividing both sides by , the equation can be rewritten as
or, simplifying the fraction,
\frac{dy}{dx} = -\frac{3y}{2x} \tag{3}
This is a differential equation, and we have arrived at it knowing its general solution in advance: the solution of (3) is .
Read backwards, this is the whole idea of the section. Had we been handed cold, the task would be to recognize the left-hand side as and read off the answer.

Definition of an Exact Equation
Now consider a differential equation written in the form
M(x,y)\,dx + N(x,y)\,dy = 0 \tag{4}
where and are assumed to have continuous first partial derivatives.
If there exists a function such that
then the differential form is called an exact differential, and Equation (4) is called an exact differential equation.
In that case (4) can be rewritten as
and the general solution of Equation (4) is
The solution is an implicit solution, in contrast with an explicit solution .
The function is sometimes called a potential function, by analogy with physics, where a conservative force field is the gradient of a potential and the level curves of that potential are the curves of constant energy.
Two questions now need answering: when is a differential equation exact, and if it is exact, how do we find its solution?
Test for Exactness
The equations (5) lead to
From calculus we know that mixed partial derivatives are equal,
provided these partial derivatives are continuous. This is Clairaut's theorem. Hence
So the condition is necessary for exactness. Conversely, it can be shown that this condition is also sufficient:
Let and have continuous first partial derivatives on a rectangular region of the -plane. Then the equation is exact if and only if
Proof of sufficiency
To prove that is sufficient for exactness, let
the partial integral of with respect to , holding fixed. By construction,
Differentiating both sides with respect to ,
By hypothesis the right side equals , and by equality of mixed partials the left side equals . Therefore
Both and have the same partial derivative with respect to , so they differ by at most a function of alone:
where is an arbitrary function of . This function is our integration "constant", which must be allowed to depend on because was held fixed during the partial integration.
Consequently,
where is any antiderivative of , so that .
We have shown that if , then is the differential of a function, namely . That is precisely the statement that the equation is exact.
The proof is not merely an existence argument. It is a recipe: partially integrate in , then correct by a function of alone. The method of solution below is exactly this proof carried out on a concrete equation.
Method of Solution
Now we find the general solution of when the equation is exact. Let be a function whose differential is .
Step 1. Because ,
f(x,y) = \int M(x,y)\,dx + g(y) \tag{6}
where is the "constant" of integration. Remember that if we differentiate (6) with respect to , both and behave as constants, so the term disappears and the identity is restored regardless of what is.
Step 2. Because , differentiate (6) with respect to and set the result equal to :
Therefore
Step 3. Integrate both sides with respect to :
Putting the pieces together,
and the general solution of the differential equation is , where is an arbitrary constant.
Remark. The two variables play symmetric roles, so you may instead start from and integrate with respect to while holding fixed, introducing a "constant" . Choose whichever of and is easier to integrate.
Built-in check. In Step 2, the expression that remains for g'(y) must be free of . If an survives, either the equation was not exact or an algebra slip occurred. This makes Step 2 a free verification of Step 1.
Worked Examples
Find the general solution of the equation
Solution
Here and . Testing for exactness,
so and the equation is exact.
Let . Because ,
\begin{aligned} f(x,y) &= \int M\,dx + g(y) \\ &= \int \left(x^3 + y^2 + y\right)dx + g(y) \\ &= \frac{x^4}{4} + y^2 x + yx + g(y) . \end{aligned}Here was treated as a constant throughout, so and integrated to and .
Now impose :
\begin{aligned} \frac{\partial}{\partial y}\left[\frac{x^4}{4} + y^2 x + yx + g(y)\right] &= y^3 + 2xy + x \\ 2yx + x + g'(y) &= y^3 + 2xy + x \\ g'(y) &= y^3 \end{aligned}All the terms cancelled, exactly as they must. Integrating,
and we may drop the constant here, since a single arbitrary constant will appear at the end.
Thus
and the general solution is
where is a constant determined from an initial condition. Multiplying by gives the tidier form .
Find the general solution of the equation .
Solution
Here
Because
this equation is exact.
We are looking for such that
\left\{ \begin{aligned} \frac{\partial f}{\partial x} &= M(x,y) = e^{y}, \\[6pt] \frac{\partial f}{\partial y} &= N(x,y) = x e^{y} + 2y \end{aligned} \right.Integrating the first equation with respect to , treating as constant,
Therefore
\frac{\partial f}{\partial y} = x e^{y} + g'(y) .This partial derivative must equal :
x e^{y} + g'(y) = x e^{y} + 2y \quad \Longrightarrow \quad g'(y) = 2y \quad \Longrightarrow \quad g(y) = y^2 + c .Finally
Combining the two constants, the solution is simply
Solve the initial value problem , .
Solution
Here and , with
so the equation is exact.
Integrating with respect to ,
Differentiating with respect to and matching ,
x + g'(y) = x - 6y \quad \Longrightarrow \quad g'(y) = -6y \quad \Longrightarrow \quad g(y) = -3y^2 .So the general solution is
Applying gives , so and the solution is
Exercises
Determine whether is exact, and solve it if it is.
Solution
With and ,
so the equation is exact.
Integrating in : . Then \dfrac{\partial f}{\partial y} = x^3 + g'(y), and matching gives g'(y) = 4y, so .
The general solution is .
Show that is not exact, then verify that dividing by makes it exact and solve.
Solution
With and ,
which differ, so the equation is not exact.
Dividing by gives . Now and , and
so the new equation is exact. Integrating in gives , and \dfrac{\partial f}{\partial y} = -\dfrac{x}{y^2} + g'(y) matches with g'(y) = 0.
The solution is , that is, with .
The factor used here is an integrating factor, the subject of the next section.
Solve .
Solution
With and ,
so the equation is exact.
Integrating in : . Then \dfrac{\partial f}{\partial y} = -x\sin y + g'(y), and matching gives g'(y) = 0.
The general solution is .
Frequently Asked Questions
What does "exact" actually mean?
It means the expression is the total differential of some single function . The equation then reads , whose content is that stays constant along solutions. Finding the solution amounts to identifying , and the answer is the level-curve family .
Why does the test work?
If the equation is exact then and , so and are the two mixed second partials of . Clairaut's theorem says these are equal when continuous, which gives the necessity. Sufficiency requires the constructive argument in the proof above, and it needs the region to be a rectangle or otherwise simply connected.
Why is the constant of integration a function rather than a number?
Because the integration in Step 1 is partial, performed with respect to while is held fixed. Anything not depending on differentiates to zero under , and that includes every function of alone. So the most general "constant" available at that stage is .
What if an is left over when I solve for g'(y)?
Then something is wrong. Either the equation is not exact, so recheck the test, or there is an algebra error in Step 1 or Step 2. Since depends on alone, g'(y) cannot contain , which makes this a reliable self-check.
What do I do when the exactness test fails?
Look for an integrating factor, a function such that multiplying through by it makes the equation exact. That is the subject of Section 2.5, and the second exercise above is a small preview of the idea.
Which variable should I integrate first?
Whichever of and is simpler to integrate. The two routes give the same answer. In the second worked example, integrating with respect to was trivial, whereas starting from would have been more work for the same result.
Should I present the answer explicitly as ?
Usually not. The natural form of the answer is the implicit relation , and solving for is often impossible, as in . Leave it implicit unless the algebra untangles cleanly.