01 / 20

Solving Exact
Differential Equations

Learn to identify and solve DEs of the form \( M\,dx + N\,dy = 0 \) by finding potential functions through the exactness condition.

Differential Equations

What Is an Exact Differential Equation?

A first-order ODE written as \( M(x,y)\,dx + N(x,y)\,dy = 0 \) is called exact if there exists a function \( F(x,y) \) such that:

In other words, the left side of the equation is the total differential \( dF \) of some unknown function \( F \). Finding \( F \) solves the equation.

The Total Differential Connection

\( F(x, y) \)
\( \frac{\partial F}{\partial x} = M(x, y) \)
\( \frac{\partial F}{\partial y} = N(x, y) \)
\( dF = M dx + N dy = 0 \)
\( \rightarrow F(x, y) = C \)

Why Exact DEs Matter

Conservation Laws
Many physics equations (energy, thermodynamics) naturally take exact form: a conserved quantity \( F \) exists.
Implicit Solutions
Exact DEs yield solutions as level curves \( F(x,y) = C \), even when you can't solve explicitly for \( y \).
Foundation Skill
Understanding exactness leads to integrating factors, which can make non-exact DEs solvable too.

The Exactness Condition

This comes from the equality of mixed partials: if \( F_{xy} = F_{yx} \), then \( M_y = F_{xy} = F_{yx} = N_x \). This single check tells you whether the equation is exact.

\( \frac{\partial M}{\partial y} \)
\( = F_{xy} \)
=
\( \frac{\partial N}{\partial x} \)
\( = F_{yx} \)

Geometric Meaning

x y
\( F = C_1 \)
\( F = C_2 \)
\( F = C_3 \)
\( \nabla F \)
\( \nabla F \)

Exact vs. Non-Exact

Exact Non-Exact
Condition \( M_y = N_x \) \( M_y \neq N_x \)
Potential \( F \) Exists directly Does not exist as-is
Solution Method Integrate to find \( F \) Need integrating factor first
Example \( 2xy\,dx + x^2\,dy = 0 \) \( y\,dx - x\,dy = 0 \)
Vector Field Conservative (gradient) Non-conservative

Step-by-Step Method

1
Identify \( M \) and \( N \). Write the DE as \( M\,dx + N\,dy = 0 \).
2
Test exactness: Compute \( \frac{\partial M}{\partial y} \) and \( \frac{\partial N}{\partial x} \). They must be equal.
3
Integrate \( M \) w.r.t. \( x \): \( F = \int M\,dx + g(y) \), where \( g(y) \) is an unknown function of \( y \) alone.
4
Determine \( g(y) \): Differentiate \( F \) w.r.t. \( y \), set it equal to \( N \), and solve for \( g'(y) \).
5
Write the solution: \( F(x,y) = C \).

Example 1: Basic

1
Identify: \( M = 2xy + 3 \), \( N = x^2 - 1 \).
2
Check: \( M_y = 2x \), \( N_x = 2x \). ✓ Exact!
3
Integrate \( M \): \( F = \int (2xy+3)\,dx = x^2 y + 3x + g(y) \).
4
Find \( g(y) \): \( F_y = x^2 + g'(y) = N = x^2 - 1 \), so \( g'(y) = -1 \), thus \( g(y) = -y \).
5
Solution: \( x^2 y + 3x - y = C \).

Example 1: Solution Curves

x y -1 1

Example 2: Intermediate

1
Identify: \( M = e^y + 2xy \), \( N = xe^y + x^2 \).
2
Check: \( M_y = e^y + 2x \), \( N_x = e^y + 2x \). ✓ Exact!
3
Integrate \( M \): \( F = \int (e^y + 2xy)\,dx = xe^y + x^2 y + g(y) \).
4
Find \( g(y) \): \( F_y = xe^y + x^2 + g'(y) = xe^y + x^2 \), so \( g'(y) = 0 \), thus \( g(y) = 0 \).
5
Solution: \( xe^y + x^2 y = C \).

Example 3: Trig & IVP

1
Check: \( M_y = -\sin y - \sin x \), \( N_x = -\sin y - \sin x \). ✓ Exact!
2
Integrate \( M \): \( F = \int (\cos y - y\sin x)\,dx = x\cos y + y\cos x + g(y) \).
3
Find \( g(y) \): \( F_y = -x\sin y + \cos x + g'(y) = -x\sin y + \cos x \), so \( g'(y) = 0 \).
4
General solution: \( x\cos y + y\cos x = C \).
5
Apply IC: Substitute \( x=0, y=\pi \) into the general solution: \( 0 \cdot \cos\pi + \pi \cdot \cos 0 = C \). This gives \( 0 + \pi(1) = C \), so \( C = \pi \). The particular solution is \( x\cos y + y\cos x = \pi \).

Alternative: Integrate \( N \) First

You can also start by integrating \( N \) with respect to \( y \) instead. This is useful when integrating \( M \) w.r.t. \( x \) looks harder than integrating \( N \) w.r.t. \( y \).

1
Integrate \( N \) w.r.t. \( y \): \( F = \int N\,dy + h(x) \), where \( h(x) \) is unknown.
2
Differentiate w.r.t. \( x \): Set \( F_x = M \) and solve for \( h'(x) \).
3
Integrate \( h'(x) \) and write \( F(x,y) = C \).

Common Mistakes

✕ Forgetting \( g(y) \)
When integrating \( M \) w.r.t. \( x \), the "constant" of integration is a function of \( y \), not a number. Writing \( +C \) instead of \( +g(y) \) loses information.
✕ Wrong Partial Derivative
Computing \( M_x \) or \( N_y \) instead of \( M_y \) and \( N_x \). Remember: you cross-differentiate with respect to the other variable.
✕ Assuming All DEs Are Exact
Skipping the exactness check and jumping into integration. If \( M_y \neq N_x \), the method fails and you need an integrating factor.

Summary Checklist

Step Action Result
1 Write as \( M\,dx + N\,dy = 0 \) Standard form
2 Verify \( M_y = N_x \) Confirms exactness
3 Integrate \( M \) w.r.t. \( x \) \( F = \cdots + g(y) \)
4 Set \( F_y = N \), solve for \( g'(y) \) Determines \( g(y) \)
5 Write \( F(x,y) = C \) General solution
6 Apply initial condition (if given) Particular solution

Question 1 of 5

Which condition must hold for \( M\,dx + N\,dy = 0 \) to be exact?

Question 2 of 5

Is the equation \( (3x^2 + y)\,dx + (x - 2y)\,dy = 0 \) exact?

Question 3 of 5

Given the exact equation \( 2xy\,dx + x^2\,dy = 0 \), after integrating \( M = 2xy \) w.r.t. \( x \), what is \( F \)?

Question 4 of 5

After finding \( F = x^2 y + 3x + g(y) \) from \( M = 2xy + 3 \), you set \( F_y = N = x^2 - 1 \). What is \( g(y) \)?

Question 5 of 5

What is the general solution of the exact DE \( e^x \sin y\,dx + e^x \cos y\,dy = 0 \)?