Differential Equations › Section B · First order differential equations › Topic B.3
Exact equations
Some first-order equations are the implicit derivative of a hidden function of two variables, set equal to zero. Find that function and the solutions appear at once as its level curves, even when the equation is neither linear nor separable.
Solutions as level curves
Separable and linear equations cover a great deal, but not everything. The equation \((2xy + 4) + (x^2 - 3y^2)y' = 0\) is neither: the \(y'\) term is tangled with \(x\), and \(y\) appears squared. Yet it has a hidden structure. It is exactly what you get by differentiating the equation \(x^2y + 4x - y^3 = C\) implicitly. So the curves \(x^2y + 4x - y^3 = C\) are its solutions, the level curves of one function \(F(x, y)\). Equations with this structure are called exact, and this topic shows how to recognise them and recover the hidden function.
Where exact equations come from
Suppose \(y\) is defined implicitly by \(F(x, y) = C\). Differentiating with respect to \(x\), using the Calculus topic "The chain rule for several variables", gives
So any equation of the form \(M(x, y) + N(x, y)\,y' = 0\), also written \(M\,dx + N\,dy = 0\), is solved by \(F(x, y) = C\) provided \(F_x = M\) and \(F_y = N\). Such an \(F\) is called a potential function for the equation. The equation is exact when a potential function exists, and the whole task is then to find \(F\).
The test for exactness
If \(F_x = M\) and \(F_y = N\), then \(M_y = F_{xy}\) and \(N_x = F_{yx}\). By Clairaut's theorem from the Calculus topic "Partial derivatives", those mixed partials are equal when continuous, so an exact equation must satisfy
The converse also holds: if \(M\), \(N\), \(M_y\) and \(N_x\) are continuous on a rectangle and \(M_y = N_x\) there, a potential function exists on that rectangle. So the test costs two partial derivatives. For the opening example, \(M_y = 2x\) and \(N_x = 2x\): exact.
Finding the potential function
The method has four steps. 1. Integrate \(M\) with respect to \(x\), treating \(y\) as a constant. The constant of integration may depend on \(y\), so write it as \(h(y)\): \(F = \int M\,dx + h(y)\). 2. Differentiate this \(F\) with respect to \(y\) and set the result equal to \(N\). 3. The \(x\)-terms must cancel, leaving an equation for \(h'(y)\) alone; if any \(x\) survives, recheck the exactness test or your algebra. 4. Integrate to find \(h(y)\), with no constant needed, and write the solution \(F(x, y) = C\). You can equally start by integrating \(N\) with respect to \(y\).
Worked example: an implicit solution
Solve \((2xy + 4) + (x^2 - 3y^2)y' = 0\) with \(y(0) = 1\). 1. Test: \(M_y = 2x = N_x\), so the equation is exact. 2. Integrate \(M\) in \(x\): \(F = x^2y + 4x + h(y)\). 3. Differentiate in \(y\): \(F_y = x^2 + h'(y)\). Setting this equal to \(N = x^2 - 3y^2\) gives \(h'(y) = -3y^2\), so \(h = -y^3\). 4. The general solution is \(x^2y + 4x - y^3 = C\). 5. At \((0, 1)\): \(0 + 0 - 1 = C\), so
Check: \(F_x = 2xy + 4 = M\) and \(F_y = x^2 - 3y^2 = N\).
Worked example: an explicit solution
Solve \((2xy - 1) + (x^2 + 2y)y' = 0\) with \(y(0) = 2\), and find the interval of validity. 1. Test: \(M_y = 2x = N_x\). 2. \(F = x^2y - x + h(y)\), and \(F_y = x^2 + h'(y) = x^2 + 2y\) gives \(h = y^2\). 3. Solutions: \(y^2 + x^2y - x = C\), and the condition gives \(C = 4\). 4. This is quadratic in \(y\):
with the plus sign because \(y(0) = \frac{0 + 4}{2} = 2\). 5. Interval: \(x^4 + 4x + 16\) has minimum value 13, at \(x = -1\), so the root is always real, and \(N = x^2 + 2y\) equals that root, so it never vanishes. Valid for all \(x\).
Separable equations are exact
A separable equation written as \(M(x) + N(y)\,y' = 0\) is always exact, because \(M_y = 0\) and \(N_x = 0\). Its potential function is \(F = \int M(x)\,dx + \int N(y)\,dy\), and \(F = C\) is exactly the separated, integrated answer from the topic "Separable equations". So exactness is a generalisation, not a rival method. The new cases are equations whose \(M\) involves \(y\) and whose \(N\) involves \(x\), with the two partial derivatives in balance, like the two worked examples above.
When the test fails: integrating factors
An equation that is not exact can sometimes be made exact by multiplying by a function \(\mu\). If \(\frac{M_y - N_x}{N}\) depends on \(x\) alone, then \(\mu(x) = e^{\int \frac{M_y - N_x}{N}\,dx}\) works. Take \((2y + 3x) + xy' = 0\) for \(x > 0\). Here \(M_y = 2\) and \(N_x = 1\), so it is not exact, but \(\frac{2 - 1}{x} = \frac{1}{x}\) gives \(\mu = x\). The new equation \((2xy + 3x^2) + x^2y' = 0\) is exact, with \(F = x^2y + x^3\), so \(y = \frac{C}{x^2} - x\). This equation is also linear, and the integrating factor of linear equations is a special case of this idea.
Common mistakes to avoid
First, testing the wrong pair: exactness compares \(M_y\) with \(N_x\), not \(M_x\) with \(N_y\). Second, writing the constant from integrating \(M\) in \(x\) as a plain number instead of \(h(y)\). Third, adding the integrals of \(M\) and \(N\), which counts shared terms such as \(x^2y\) twice. Fourth, stopping at \(F\) and forgetting that the solution is the equation \(F(x, y) = C\). Fifth, mislabelling \(M\) and \(N\) when the equation arrives in another arrangement; move everything to the form \(M + Ny' = 0\) first, signs included.
Key takeaways
An equation \(M + Ny' = 0\) is exact when some \(F(x, y)\) has \(F_x = M\) and \(F_y = N\); its solutions are the level curves \(F(x, y) = C\), since \(\frac{d}{dx}F(x, y(x)) = M + Ny'\). With continuous partial derivatives on a rectangle, it is exact there exactly when \(M_y = N_x\). Find \(F\) by integrating \(M\) in \(x\), adding \(h(y)\), and matching \(F_y\) to \(N\). Solve for \(y\) when the algebra allows, choosing the branch by the initial condition. Separable equations are exact, and an integrating factor can rescue some that are not.
Flashcards
Flashcard
M + Ny′ = 0 with a function F such that F_x = M and F_y = N
Test your understanding
Question 1 of 5
Is (4x³ + 2y) + (2x + 3y²)y′ = 0 exact?
Question 2 of 5
For the exact equation with M = 3x² + 2xy and N = x² + cos y, which is a potential function F?
Question 3 of 5
What is the general solution of (2xy − 5) + (x² + 4)y′ = 0?
Question 4 of 5
For (3y + 2x) + xy′ = 0 with x > 0, which integrating factor μ(x) makes the equation exact?
Question 5 of 5
If F_x = M and F_y = N, why does every solution of M + Ny′ = 0 lie on a curve F(x, y) = C?
