01 / 21

Integrating Factors
Non-Exact Equations

Learn how to transform non-exact differential equations into exact ones using a powerful multiplicative technique called the integrating factor.

AP Calculus

What is an Exact 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:

$$ \frac{\partial F}{\partial x} = M \quad \text{and} \quad \frac{\partial F}{\partial y} = N $$

When the Test Fails

Consider \( (2xy + 3)\,dx + (x^2 + 4y)\,dy = 0 \). Here \( M = 2xy + 3 \) and \( N = x^2 + 4y \). Compute the partials:

\( \frac{\partial M}{\partial y} \)
\( = 2x \)
\( \frac{\partial N}{\partial x} \)
\( = 2x \)
Verdict
Equal: Exact ✓

The Big Idea: Multiply to Fix It

If \( M\,dx + N\,dy = 0 \) is not exact, we look for a function \( \mu \) (called the integrating factor) such that multiplying through makes it exact:

$$ \mu M\,dx + \mu N\,dy = 0 \quad \text{is exact} $$

Exact vs Non-Exact: A Visual

Non-Exact \( M\,dx + N\,dy = 0 \) Condition fails: \( M_y \neq N_x \) Need integrating factor \( \mu \) to make it exact multiply by \( \mu \) Exact \( \mu M\,dx + \mu N\,dy = 0 \) Condition holds: \( (\mu M)_y = (\mu N)_x \) Solve directly via \( F(x,y) = C \)

The arrow shows the strategy: multiply the non-exact equation by \( \mu \) to transform it into an exact equation you can solve.

The Integrating Factor Formula

For \( M\,dx + N\,dy = 0 \), the exactness condition after multiplying by \( \mu \) yields a PDE. In two special cases, \( \mu \) depends on only one variable:

1
If \( \frac{M_y - N_x}{N} \) depends only on \( x \): then \( \mu = \mu(x) \) and $$\mu(x) = e^{\int \frac{M_y - N_x}{N}\,dx}$$
2
If \( \frac{N_x - M_y}{M} \) depends only on \( y \): then \( \mu = \mu(y) \) and $$\mu(y) = e^{\int \frac{N_x - M_y}{M}\,dy}$$

Why Does This Work?

If we multiply by \( \mu(x) \), exactness requires \( (\mu M)_y = (\mu N)_x \). Since \( \mu \) depends only on \( x \):

$$ \mu \, M_y = \mu' N + \mu \, N_x $$

Rearranging for \( \mu'/\mu \):

$$ \frac{\mu'}{\mu} = \frac{M_y - N_x}{N} $$

\( \mu(x) \) vs \( \mu(y) \): Which to Use?

\( \mu(x) \) \( \mu(y) \)
Test expression \( \frac{M_y - N_x}{N} \) \( \frac{N_x - M_y}{M} \)
Must depend only on \( x \) alone \( y \) alone
Formula \( e^{\int (\cdots)\,dx} \) \( e^{\int (\cdots)\,dy} \)
Numerator sign \( M_y - N_x \) \( N_x - M_y \)

Step-by-Step Method

1
Write in standard form: \( M\,dx + N\,dy = 0 \). Identify \( M \) and \( N \).
2
Compute partials: Find \( M_y \) and \( N_x \). Check if \( M_y = N_x \) (if yes, it is already exact).
3
Test for \( \mu(x) \): Compute \( \frac{M_y - N_x}{N} \). If it depends only on \( x \), integrate to find \( \mu \).
4
Otherwise test \( \mu(y) \): Compute \( \frac{N_x - M_y}{M} \). If it depends only on \( y \), integrate.
5
Multiply through by \( \mu \), then solve the resulting exact equation using standard techniques.

Example 1: Finding \( \mu(x) \)

Solve: \( (2y)\,dx + (3x)\,dy = 0 \)

1
Identify: \( M = 2y \), \( N = 3x \)
2
Partials: \( M_y = 2 \), \( N_x = 3 \). Since \( 2 \neq 3 \), not exact.
3
Test \( \mu(x) \): \( \frac{M_y - N_x}{N} = \frac{2-3}{3x} = \frac{-1}{3x} \). This depends only on \( x \). ✓

Example 1: Computing \( \mu \)

From the test: \( \frac{M_y - N_x}{N} = -\frac{1}{3x} \). Integrate:

$$ \mu(x) = e^{\int -\frac{1}{3x}\,dx} = e^{-\frac{1}{3}\ln|x|} = x^{-1/3} $$

Now multiply the original equation by \( x^{-1/3} \):

$$ 2y\,x^{-1/3}\,dx + 3x^{2/3}\,dy = 0 $$

Example 2: Testing Both Cases

Solve: \( (3xy + y^2)\,dx + (x^2 + xy)\,dy = 0 \)

1
Identify: \( M = 3xy + y^2 \), \( N = x^2 + xy \)
2
Partials: \( M_y = 3x + 2y \), \( N_x = 2x + y \). Not equal: \( M_y - N_x = x + y \).
3
Test \( \mu(x) \): \( \frac{x+y}{x^2+xy} = \frac{x+y}{x(x+y)} = \frac{1}{x} \). Depends only on \( x \): ✓

Example 2: Solving After Multiplying

Multiply through by \( \mu = x \):

$$ (3x^2y + xy^2)\,dx + (x^3 + x^2y)\,dy = 0 $$

Verify: \( M^*_y = 3x^2 + 2xy \) and \( N^*_x = 3x^2 + 2xy \). Exact ✓. Now solve: integrate \( M^* \) with respect to \( x \):

$$ F = \int (3x^2y + xy^2)\,dx = x^3y + \tfrac{1}{2}x^2y^2 + g(y) $$

Example 3: A Linear ODE Connection

Consider the linear ODE \( \frac{dy}{dx} + \frac{2}{x}y = x^3 \). Rewrite as:

$$ \left(\frac{2y}{x} - x^3\right)dx + dy = 0 $$

Here \( M = \frac{2y}{x} - x^3 \), \( N = 1 \). Partials: \( M_y = \frac{2}{x} \), \( N_x = 0 \).

$$ \frac{M_y - N_x}{N} = \frac{2/x}{1} = \frac{2}{x} $$

Common Mistakes to Avoid

✕ Wrong Sign in Numerator
For \( \mu(x) \), the numerator is \( M_y - N_x \). For \( \mu(y) \), it flips to \( N_x - M_y \). Mixing these up gives the wrong \( \mu \).
✕ Forgetting to Multiply Both Sides
You must multiply both \( M \) and \( N \) by \( \mu \). Multiplying only one term destroys the equation's structure.
✕ Not Checking Dependency
If \( \frac{M_y - N_x}{N} \) still contains \( y \), you cannot use it for \( \mu(x) \). Always verify it depends on one variable only.
✕ Skipping Verification
After multiplying by \( \mu \), always re-check that the new equation is exact before solving. Catches arithmetic errors early.

Summary Comparison

Exact Non-Exact After \( \mu \)
Condition \( M_y = N_x \) \( M_y \neq N_x \) \( (\mu M)_y = (\mu N)_x \)
Strategy Solve directly Find \( \mu \) Solve as exact
Difficulty Moderate N/A Moderate
Key step Integrate \( M \) or \( N \) Compute test ratio Multiply then integrate

Question 1 of 5

Given \( M\,dx + N\,dy = 0 \), the equation is exact if and only if:

Question 2 of 5

For the equation \( (y)\,dx + (2x)\,dy = 0 \), what is \( \frac{M_y - N_x}{N} \)?

Question 3 of 5

If \( \frac{M_y - N_x}{N} = \frac{3}{x} \), what is the integrating factor \( \mu(x) \)?

Question 4 of 5

When testing for \( \mu(y) \), the correct test expression is:

Question 5 of 5

After finding \( \mu \) and multiplying the equation, what should you do before solving?