DIFFERENTIAL EQUATIONS • FIRST-ORDER DIFFERENTIAL EQUATIONS

Solving Exact DEs — Solving Exact Differential Equations

Learn how certain differential equations can be solved by recognizing hidden total differentials.

Historical Context & Motivation

📋 Prerequisites & Audience Note
This lesson introduces exact differential equations, a standard topic in an introductory Differential Equations course. It requires comfort with partial derivatives — a tool from multivariable calculus. If you haven't yet taken a multivariable calculus course, or if it has been a while, the next section provides a focused refresher on partial derivatives so you have the tools you need to follow every step.

Differential equations have been a cornerstone of mathematics and science for over three centuries. Scientists and mathematicians needed tools to describe how things change — the motion of planets, the flow of heat, and the growth of populations. Exact differential equations emerged as one of the earliest and most elegant techniques for solving first-order equations. The idea hinges on a beautiful connection: some equations that look complicated are actually hiding a simpler function underneath, just waiting to be uncovered.

The development of exact equations is closely tied to the development of partial derivatives and multivariable calculus. As mathematicians explored functions of two variables, they realized that certain combinations of partial derivatives have a special symmetry property. This symmetry became the key test for identifying exact equations and, ultimately, solving them.

1675
Leibniz Introduces Differentials
Gottfried Wilhelm Leibniz develops the notation dy/dx and introduces the concept of differentials, laying the groundwork for writing equations involving dx and dy.
1739
Euler's Exactness Condition
Leonhard Euler formalizes the condition for exactness using the equality of mixed partial derivatives, providing a systematic test to determine if an equation is exact.
1760s
Clairaut's Theorem
Alexis Clairaut proves that for sufficiently smooth functions, the order of mixed partial differentiation does not matter. This theorem underpins the entire theory of exact equations.
1800s
Integrating Factors Extend the Method
Mathematicians discover that non-exact equations can sometimes be made exact by multiplying by a special function called an integrating factor, greatly broadening the method's usefulness.

The central question that exact equations answer is this: given an equation of the form M(x, y) dx + N(x, y) dy = 0, is there some hidden function F(x, y) whose total differential equals the left side? If so, the solution is simply F(x, y) = C, where C is a constant. This transforms a differential equation problem into a problem of finding a single function — a powerful simplification.

Prerequisite: Partial Derivatives

Exact differential equations rely on a tool called a partial derivative. This comes from multivariable calculus, so we'll build up the idea from scratch before using it in the main method.

💡 The Core Idea
In single-variable calculus you differentiate a function of one variable, like f(x) = x³ + 5x. With two-variable functions such as F(x, y) = x²y + 3x − y, both x and y can change independently. A partial derivative asks: "How does F change if I vary only one variable and hold the other completely fixed?"

We use the symbol (called "del" or "partial") instead of d to signal that we are differentiating with respect to only one variable while treating all others as constants.

1

∂F/∂x — Partial w.r.t. x

Differentiate F with respect to x, treating every y as if it were a plain number (a constant). Use all your usual single-variable differentiation rules.
2

∂F/∂y — Partial w.r.t. y

Differentiate F with respect to y, treating every x as if it were a plain number (a constant). Again, all single-variable rules apply — just swap which variable is "active."
Partial Derivative Practice: F(x, y) = x²y + 3x − y
1
Example 1 — Finding ∂F/∂xLet F(x, y) = x²y + 3x − y. To find ∂F/∂x, treat y as a constant number throughout.
∂F/∂x = 2xy + 3
2
Why each term worksDifferentiating term by term: the term x²y becomes 2xy (power rule on x², with y acting as a coefficient), the term 3x becomes 3, and the term −y has no x so its derivative is 0.
x²y → 2xy, 3x → 3, −y → 0
3
Example 1 — Finding ∂F/∂yNow find ∂F/∂y. Treat x as a constant. The term x²y becomes x² (power rule on y, with x² acting as a coefficient), the term 3x has no y so its derivative is 0, and −y becomes −1.
∂F/∂y = x² − 1

You can also take a partial derivative of a partial derivative — this is called a mixed second-order partial derivative. For example, ∂²F/∂y∂x means "first differentiate with respect to x, then differentiate the result with respect to y." A remarkable fact — known as Clairaut's Theorem — is that for smooth functions the order does not matter: ∂²F/∂y∂x = ∂²F/∂x∂y. This symmetry is exactly what makes the exactness test work.

Mixed Second-Order Partials: F(x, y) = x²y + 3x − y
1
Mixed Partial: differentiate ∂F/∂x with respect to yWe found ∂F/∂x = 2xy + 3. Now differentiate this with respect to y (treat x as constant).
∂²F/∂y∂x = 2x
2
Mixed Partial: differentiate ∂F/∂y with respect to xWe found ∂F/∂y = x² − 1. Now differentiate this with respect to x (treat y as constant).
∂²F/∂x∂y = 2x
3
Clairaut's Theorem confirmedBoth mixed partials equal 2x, confirming Clairaut's Theorem. This symmetry is the mathematical heart of the exactness test you will use throughout this lesson.
∂²F/∂y∂x = ∂²F/∂x∂y = 2x ✓
KEY TAKEAWAY
To compute a partial derivative: (1) decide which variable you are differentiating with respect to, (2) treat every other variable as a fixed constant, and (3) apply all the single-variable differentiation rules you already know (power rule, product rule, chain rule, etc.). That is the only new skill needed — the rest of the method is integration you have seen before.

Core Principles & Definitions

Now that you have the tools of partial differentiation, let's build the exact equation framework on top of them. An exact differential equation has a very specific structure, and recognizing that structure is the first step toward solving it.

1

Total Differential

For a function F(x, y), the total differential is dF = (∂F/∂x) dx + (∂F/∂y) dy. It captures all the ways F changes when both x and y change simultaneously.
2

Standard Form

An exact DE is written as M(x, y) dx + N(x, y) dy = 0, where M and N are functions of x and y. The goal is to find F such that ∂F/∂x = M and ∂F/∂y = N.
3

Exactness Test

The equation is exact if and only if ∂M/∂y = ∂N/∂x. This cross-derivative test comes directly from Clairaut's theorem on the equality of mixed partial derivatives (introduced in the previous section).
4

Implicit Solution

Once you find F(x, y), the general solution is F(x, y) = C, where C is an arbitrary constant. The solution curves are the level curves of F.
KEY TAKEAWAY
Think of an exact differential equation like a jigsaw puzzle. The pieces M dx and N dy look separate, but they actually fit together to form a single picture — the function F(x, y). The exactness test (∂M/∂y = ∂N/∂x) is like checking that the edges of the pieces match. If they do, you can assemble the puzzle and find the hidden function.

Visual Explanation

The diagram below shows the core logic of the exact equation method. On the left, you see the differential equation in its standard form. The exactness test checks whether the cross partial derivatives match. If they do, the equation is exact and you can reconstruct the potential function F(x, y) by integrating. The solution curves are the level curves of F, shown on the right as contour lines on the xy-plane.

This flowchart shows the complete process: start with the standard form M dx + N dy = 0, apply the exactness test, then integrate step by step to find F(x, y). The right panel shows how solution curves are level curves of the potential function F, each corresponding to a different constant C.

Notice the key decision point in the center of the diagram. If ∂M/∂y equals ∂N/∂x, you proceed to integrate. The integration happens in two stages: first integrate M with respect to x (introducing an unknown function g(y)), then use the condition ∂F/∂y = N to determine g(y). Once you have F(x, y), every level curve F(x, y) = C is a solution to the original equation.

Mathematical Framework

Now let's lay out the mathematics precisely. Every exact equation begins in a standard form, and the solution follows a clear sequence of algebraic and calculus steps. Pay attention to the variable definitions — they'll appear repeatedly in the worked examples.

STANDARD FORM
M(x, y) dx + N(x, y) dy = 0
M(x, y) and N(x, y) are functions of both x and y. The equation says that a certain combination of changes in x and y always equals zero along a solution curve.
EXACTNESS CONDITION
∂M/∂y = ∂N/∂x
Take the partial derivative of M with respect to y (hold x fixed) and the partial derivative of N with respect to x (hold y fixed). If these are equal for all (x, y) in the domain, the equation is exact. This condition comes from Clairaut's theorem: if F exists such that ∂F/∂x = M and ∂F/∂y = N, then the two mixed second-order partial derivatives ∂²F/∂y∂x and ∂²F/∂x∂y must be equal — which forces ∂M/∂y = ∂N/∂x.
INTEGRATION STEP 1
F(x, y) = ∫ M(x, y) dx + g(y)
Integrate M with respect to x, treating y as a constant number. The 'constant of integration' here is not just a number — it can be any function of y alone, which we call g(y). This unknown function will be determined in the next step.
INTEGRATION STEP 2 — FINDING g(y)
g′(y) = N(x, y) − ∂/∂y [∫ M dx]
Differentiate F with respect to y (treating x as constant) and set it equal to N. The result gives an expression for g′(y). Because the exactness condition was satisfied, all x terms will cancel and g′(y) will depend only on y. If x terms remain after cancellation, double-check your exactness test and integration. Integrate g′(y) to find g(y).
💡 Why does g(y) depend only on y?
When you integrate M with respect to x, you capture all the x-dependence of F. The leftover piece g(y) accounts for any part of F that has no x in it at all. That's why g′(y) must be a function of y alone — if it contained x, the exactness condition would be violated.

Step-by-Step Procedure

Here is the complete procedure for solving an exact differential equation, organized as a checklist you can follow every time. The diagram below provides a compact visual reference for the algorithm.

  1. Step 1 — Write in standard form. Rearrange the equation into M(x, y) dx + N(x, y) dy = 0. Identify M and N clearly.
  2. Step 2 — Test for exactness. Compute ∂M/∂y (differentiate M with respect to y, holding x fixed) and ∂N/∂x (differentiate N with respect to x, holding y fixed). If they are equal, the equation is exact. If not, stop — you need a different method (like an integrating factor).
  3. Step 3 — Integrate M with respect to x. Compute ∫ M dx, treating y as a constant number. Add the unknown function g(y).
  4. Step 4 — Differentiate with respect to y. Take ∂F/∂y of the result from Step 3 (treat x as constant, differentiate every term with respect to y). Set it equal to N and solve for g′(y).
  5. Step 5 — Integrate g′(y) to find g(y). Compute ∫ g′(y) dy. You don't need another arbitrary constant here because the final answer already includes C.
  6. Step 6 — Write the solution. Combine everything into F(x, y) = C. This is the implicit general solution.
The complete six-step algorithm. Start at the top, test for exactness, then follow the chain of integrations down to the final solution F(x, y) = C. If the equation is not exact, you need an alternative approach such as an integrating factor.

Worked Example

Let's work through a complete example from start to finish. We'll solve the differential equation (2xy + 3) dx + (x² − 1) dy = 0. Follow along carefully and note how each step connects to the framework we built above.

Solving (2xy + 3) dx + (x² − 1) dy = 0
1
Step 1 — Identify M and NComparing with the standard form M dx + N dy = 0, we identify M(x, y) = 2xy + 3 and N(x, y) = x² − 1.
M = 2xy + 3, N = x² − 1
2
Step 2 — Test for ExactnessCompute the partial derivatives. To find ∂M/∂y, differentiate M = 2xy + 3 with respect to y, treating x as a constant: the term 2xy becomes 2x, and the constant 3 becomes 0. So ∂M/∂y = 2x. To find ∂N/∂x, differentiate N = x² − 1 with respect to x, treating y as a constant: x² becomes 2x, and −1 becomes 0. So ∂N/∂x = 2x. Since ∂M/∂y = ∂N/∂x = 2x, the equation is exact.
∂M/∂y = 2x = ∂N/∂x ✓ — Exact!
3
Step 3 — Integrate M with Respect to xF(x, y) = ∫ (2xy + 3) dx. Treat y as a constant and integrate term by term: ∫ 2xy dx = x²y (power rule on x, with 2y as a constant coefficient) and ∫ 3 dx = 3x. Don't forget to add the unknown function g(y) in place of a constant of integration.
F(x, y) = x²y + 3x + g(y)
4
Step 4 — Differentiate F with Respect to y and Solve for g′(y)Take ∂F/∂y: differentiate F = x²y + 3x + g(y) with respect to y, treating x as a constant. The term x²y becomes x², the term 3x has no y so it becomes 0, and g(y) becomes g′(y). So ∂F/∂y = x² + g′(y). Set this equal to N: x² + g′(y) = x² − 1. Subtract x² from both sides: g′(y) = −1.
g′(y) = −1
5
Step 5 — Integrate g′(y)Integrate: g(y) = ∫ (−1) dy = −y. We don't add another constant of integration here because the general constant C appears in the final answer.
g(y) = −y
6
Step 6 — Write the General SolutionSubstitute g(y) back into F: F(x, y) = x²y + 3x − y. The general solution is F(x, y) = C.
x²y + 3x − y = C
✔️ Verification Tip
You can verify your answer by checking that ∂F/∂x = M and ∂F/∂y = N. Here, ∂F/∂x = 2xy + 3 = M ✓ and ∂F/∂y = x² − 1 = N ✓. This double-check catches errors in integration or algebra.

Strengths, Limitations & Comparisons

Exact equations are just one of several techniques for solving first-order DEs. Understanding when this method works — and when it doesn't — helps you choose the right tool for each problem. The table below compares exact equations with two other common methods.

Comparison of three first-order DE solving methods
FeatureExact EquationsSeparable EquationsLinear (1st Order)
Standard FormM dx + N dy = 0f(x) dx = g(y) dydy/dx + P(x)y = Q(x)
Test / Requirement∂M/∂y = ∂N/∂xVariables fully separableMust be linear in y
Solution TechniqueFind potential function F(x, y)Integrate both sides separatelyUse integrating factor e^{∫P dx}
StrengthsHandles mixed x-y terms elegantlySimple and direct when applicableAlways works for linear 1st order DEs
LimitationOnly works if exactness test passesFails when variables can't be separatedFails for nonlinear equations
KEY TAKEAWAY
Think of your DE-solving methods like tools in a toolbox. Separable equations are like a basic screwdriver — simple and effective for certain jobs. Linear first-order equations have their own specialized tool (the integrating factor formula). Exact equations are like a versatile wrench that works on a broader class of problems where variables are tangled together, as long as the exactness condition is satisfied.

Connection to Advanced Theory

The concept of exact equations connects to deeper ideas in mathematics and physics. Once you're comfortable with the basic method, you'll encounter several extensions that build on the same principles.

How exact equations connect to advanced mathematical topics
This LessonAdvanced Extension
Exactness test: ∂M/∂y = ∂N/∂xIntegrating factors: multiply by μ(x) or μ(y) to make a non-exact equation exact
Potential function F(x, y)Conservative vector fields in multivariable calculus: F is the potential, and (M, N) is a gradient field ∇F
Solution curves F(x, y) = CLevel surfaces and gradient flow in 3D, used in physics for equipotential surfaces and field lines
Clairaut's theorem (equal mixed partials)Differential forms and exterior calculus: the condition dω = 0 generalizes exactness to higher dimensions

If you continue into multivariable calculus or physics, you'll see the exact same test reappear under a different name. A vector field F = ⟨M, N⟩ is called conservative when ∂M/∂y = ∂N/∂x, and the potential function F(x, y) plays the role of potential energy. The solution curves correspond to paths of zero net work — a beautiful link between differential equations and physics.

🔭 Looking Ahead
When an equation fails the exactness test, you might still be able to find a function μ called an integrating factor that makes it exact. For example, if (∂M/∂y − ∂N/∂x)/N depends only on x, then μ(x) = e^{∫ [(∂M/∂y − ∂N/∂x)/N] dx} turns the equation into an exact one. This is a natural next step after mastering the material in this lesson.

Practice Problems

Test your understanding with these five problems. They progress from conceptual understanding to more challenging applications. Try each one on paper before reading the answer.

PROBLEM 1CONCEPTUAL
Explain in your own words what it means for a differential equation M dx + N dy = 0 to be "exact." Why is the condition ∂M/∂y = ∂N/∂x necessary?
PROBLEM 2BASIC CALCULATION
Determine whether the equation (3x² + y) dx + (x + 2y) dy = 0 is exact. If it is, find the general solution.
PROBLEM 3INTERMEDIATE
Solve the exact equation (ye^(xy) + 2x) dx + (xe^(xy) − 3) dy = 0.
PROBLEM 4APPLIED
A temperature distribution satisfies the equation (2T cos(x) − sin(x)) dx + (sin(x) + 4T) dT = 0 where T is temperature and x is position. Verify this is exact and find T implicitly as a function of x.
PROBLEM 5CRITICAL THINKING
Suppose M(x, y) dx + N(x, y) dy = 0 is an exact equation with solution F(x, y) = C. Show that if you multiply the entire equation by a nonzero constant k, the new equation kM dx + kN dy = 0 is still exact and has the same solution curves. Then explain: does multiplying by a function h(x) always preserve exactness? Why or why not?

Lesson Summary

This lesson introduced partial derivatives as a prerequisite tool — differentiating a two-variable function with respect to one variable while holding the other fixed — before building up to the main method. An exact differential equation takes the form M(x, y) dx + N(x, y) dy = 0 where the left side is the total differential of a hidden function F(x, y). You confirm exactness by verifying the cross partial derivative condition ∂M/∂y = ∂N/∂x. To solve, you integrate M with respect to x (adding an unknown g(y)), then use ∂F/∂y = N to determine g(y). The general solution is F(x, y) = C, where each value of C gives a different level curve that is a solution to the DE.

This method sits alongside separable equations and linear first-order equations as a fundamental technique for first-order DEs. Its deeper significance lies in the connection to conservative vector fields and potential functions in multivariable calculus — topics developed further in vector calculus and mathematical physics courses. When the exactness test fails, integrating factors can sometimes rescue the method by transforming the equation into an exact one.

Varsity Tutors • Differential Equations • Solving Exact DEs — Solving Exact Differential Equations