STEMviz
Mathematics · Differential Equations and Complex Analysis

Exact Equations and the Integrating Factor

Defines exact first-order equations via a potential function, proves the M_y=N_x exactness test, and extends the integrating factor to the two-variable case.

Exact Equations and the Integrating Factor

This chapter completes the toolkit of elementary first-order techniques with the most structurally interesting one: exactness. An exact equation is secretly the statement that a function F(x,y)F(x,y) is constant along solution curves, and the entire solution method amounts to reconstructing FF from its own partial derivatives. When an equation is not exact, an integrating factor — a multiplier chosen to force exactness — often rescues it, generalising the linear-equation integrating factor of Chapter 2 to a genuinely two-variable setting.

Have to hand: partial derivatives and the equality of mixed partials (Clairaut's theorem) from multivariable calculus, and the differential-form notation M dx+N dy=0M\,dx+N\,dy=0 introduced in Chapter 2.

1. Exact Equations

Write a first-order ODE in differential form

M(x,y) dx+N(x,y) dy=0.M(x,y)\,dx + N(x,y)\,dy = 0.

Definition. The equation is exact on a region RR if there exists a function F(x,y)F(x,y) (a potential function) with continuous partial derivatives on RR such that

∂F∂x=M,∂F∂y=N.\frac{\partial F}{\partial x} = M, \qquad \frac{\partial F}{\partial y} = N.

In that case M dx+N dy=dFM\,dx+N\,dy = dF (the total differential of FF), so the ODE reads dF=0dF=0, and every solution satisfies F(x,y)=CF(x,y)=C for a constant CC.

The entire solving method rests on recognising when such an FF exists and constructing it explicitly.

2. The Exactness Test

Theorem. Suppose M,NM,N have continuous partial derivatives on a simply connected region RR. Then M dx+N dy=0M\,dx+N\,dy=0 is exact on RR if and only if

∂M∂y=∂N∂xeverywhere on R.\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} \qquad \text{everywhere on } R.

Proof. (⇒\Rightarrow) If the equation is exact, M=FxM=F_x and N=FyN=F_y for some FF. Since M,NM,N have continuous partials, FF has continuous second partials, so by Clairaut's theorem (equality of mixed partial derivatives), My=Fxy=Fyx=NxM_y = F_{xy} = F_{yx} = N_x.

(⇐\Leftarrow) Suppose My=NxM_y=N_x on the simply connected region RR. Define

F(x,y)=∫x0xM(s,y) ds+h(y)F(x,y) = \int_{x_0}^{x} M(s,y)\,ds + h(y)

for a fixed x0x_0 and an unknown function h(y)h(y) to be determined. By construction Fx=MF_x = M. Differentiating with respect to yy,

Fy=∫x0xMy(s,y) ds+h′(y)=∫x0xNx(s,y) ds+h′(y)=N(x,y)−N(x0,y)+h′(y),F_y = \int_{x_0}^{x} M_y(s,y)\,ds + h'(y) = \int_{x_0}^x N_x(s,y)\,ds + h'(y) = N(x,y)-N(x_0,y) + h'(y),

using My=NxM_y=N_x and the fundamental theorem of calculus. Requiring Fy=NF_y=N forces h′(y)=N(x0,y)h'(y) = N(x_0,y), which determines hh (up to an additive constant) by a single integration in yy alone. The simple connectedness of RR is exactly what is needed to guarantee this FF, built from a path integral from a fixed basepoint, is well defined and single-valued throughout RR. ■\blacksquare

Why simple connectedness matters. On a region with a hole, My=NxM_y=N_x everywhere is not sufficient for a single-valued potential to exist. The classic counterexample is M=−yx2+y2, N=xx2+y2M=\dfrac{-y}{x^2+y^2},\,N=\dfrac{x}{x^2+y^2} on R2∖{(0,0)}\mathbb{R}^2\setminus\{(0,0)\}: direct computation gives My=NxM_y=N_x everywhere on the domain, yet ∮M dx+N dy=2π≠0\oint M\,dx+N\,dy = 2\pi\ne 0 around a loop encircling the origin, so no single-valued FF exists there. This is the exact same obstruction noted for the curl of a vector field in vector calculus, and it foreshadows the far-reaching role simple connectedness plays in complex integration (Chapter 11).

3. Method: Constructing the Potential Function

In practice, the proof above is carried out as an explicit algorithm:

  1. Verify My=NxM_y=N_x.
  2. Integrate MM with respect to xx (holding yy fixed): F(x,y)=∫M dx+h(y)F(x,y) = \int M\,dx + h(y), where the "constant" of integration may depend on yy.
  3. Differentiate this FF with respect to yy, set it equal to NN, and solve for h′(y)h'(y) — the xx-dependence must cancel out of this equation; if it does not, My≠NxM_y\ne N_x and a computational error has been made.
  4. Integrate h′(y)h'(y) to find h(y)h(y) (no new arbitrary function is needed here, only a constant, which is absorbed into the final answer).
  5. State the implicit solution F(x,y)=CF(x,y) = C.

Worked example. Solve (2xy+3) dx+(x2−1) dy=0(2xy+3)\,dx + (x^2-1)\,dy = 0.

Here M=2xy+3, N=x2−1M=2xy+3,\ N=x^2-1. Check exactness: My=2xM_y = 2x and Nx=2xN_x=2x, so My=NxM_y=N_x and the equation is exact.

Integrate MM with respect to xx: F=∫(2xy+3) dx=x2y+3x+h(y)F = \displaystyle\int (2xy+3)\,dx = x^2y+3x+h(y).

Differentiate with respect to yy and match to NN: Fy=x2+h′(y)=x2−1F_y = x^2+h'(y) = x^2-1, so h′(y)=−1h'(y)=-1, giving h(y)=−yh(y)=-y (dropping the redundant constant).

Hence F(x,y)=x2y+3x−yF(x,y) = x^2y+3x-y, and the general solution is

x2y+3x−y=C.x^2y + 3x - y = C.

As a check, implicit differentiation of x2y+3x−y=Cx^2y+3x-y=C gives 2xy dx+x2 dy+3 dx−dy=02xy\,dx+x^2\,dy+3\,dx-dy=0, i.e. (2xy+3)dx+(x2−1)dy=0(2xy+3)dx+(x^2-1)dy=0 — exactly the original equation.

4. Integrating Factors for Non-Exact Equations

If M dx+N dy=0M\,dx+N\,dy=0 is not exact, it may become exact after multiplying through by a suitable function μ(x,y)\mu(x,y), called an integrating factor: μM dx+μN dy=0\mu M\,dx + \mu N\,dy=0 is exact precisely when

∂(μM)∂y=∂(μN)∂x.\frac{\partial (\mu M)}{\partial y} = \frac{\partial (\mu N)}{\partial x}.

In general this is itself a (harder) partial differential equation for μ\mu, but two special cases reduce to an ordinary differential equation and are the standard syllabus cases.

Case 1: μ\mu a function of xx alone. Expanding the exactness condition for μ=μ(x)\mu=\mu(x):

μMy=μ′N+μNx⟹μ′μ=My−NxN.\mu M_y = \mu' N + \mu N_x \quad\Longrightarrow\quad \frac{\mu'}{\mu} = \frac{M_y-N_x}{N}.

This has a solution μ(x)\mu(x) (via separation) if and only if the right side My−NxN\dfrac{M_y-N_x}{N} is a function of xx alone; when it is, call it g(x)g(x), and then

μ(x)=e∫g(x) dx.\mu(x) = e^{\int g(x)\,dx}.

Case 2: μ\mu a function of yy alone. By the symmetric computation,

μ′μ=Nx−MyM,\frac{\mu'}{\mu} = \frac{N_x-M_y}{M},

which is solvable for μ(y)\mu(y) if and only if Nx−MyM\dfrac{N_x-M_y}{M} is a function of yy alone, say k(y)k(y), giving μ(y)=e∫k(y) dy\mu(y)=e^{\int k(y)\,dy}.

Relation to Chapter 2. For a linear equation y′+p(x)y=q(x)y'+p(x)y=q(x), written in differential form as (p(x)y−q(x))dx+dy=0\bigl(p(x)y-q(x)\bigr)dx + dy = 0, one finds My=p(x)M_y=p(x), Nx=0N_x=0, so (My−Nx)/N=p(x)(M_y-N_x)/N = p(x), a function of xx alone — recovering exactly Chapter 2's integrating factor μ(x)=e∫p dx\mu(x)=e^{\int p\,dx} as the special Case 1 of this more general theory.

Worked example. Solve (3xy+y2) dx+(x2+xy) dy=0(3xy+y^2)\,dx + (x^2+xy)\,dy=0.

Here M=3xy+y2, N=x2+xyM=3xy+y^2,\,N=x^2+xy. Check exactness: My=3x+2yM_y=3x+2y, Nx=2x+yN_x=2x+y; these are unequal, so the equation is not exact.

Try Case 1: My−NxN=(3x+2y)−(2x+y)x2+xy=x+yx(x+y)=1x\dfrac{M_y-N_x}{N} = \dfrac{(3x+2y)-(2x+y)}{x^2+xy} = \dfrac{x+y}{x(x+y)} = \dfrac{1}{x}, a function of xx alone. So μ(x)=e∫(1/x) dx=x\mu(x) = e^{\int (1/x)\,dx} = x (for x>0x>0).

Multiplying through by μ=x\mu=x: (3x2y+xy2) dx+(x3+x2y) dy=0(3x^2y+xy^2)\,dx + (x^3+x^2y)\,dy=0. Checking: new My=3x2+2xyM_y = 3x^2+2xy, new Nx=3x2+2xyN_x=3x^2+2xy — equal, confirming exactness. Integrating the new MM with respect to xx: F=x3y+x2y22+h(y)F = x^3y + \dfrac{x^2y^2}{2} + h(y); differentiating in yy and matching to the new N=x3+x2yN=x^3+x^2y gives h′(y)=0h'(y)=0. The general solution is

x3y+x2y22=C.x^3y + \frac{x^2y^2}{2} = C.

5. Common Exam Pitfalls

  • Checking exactness on the original equation but forgetting to recheck it after multiplying by an integrating factor. The whole point of μ\mu is to restore exactness; always verify (μM)y=(μN)x(\mu M)_y=(\mu N)_x on the new equation before proceeding to construct FF.
  • Conflating this chapter's integrating factor with Chapter 2's. Chapter 2's μ(x)=e∫p dx\mu(x)=e^{\int p\,dx} is the special case of Case 1 applied to a linear equation written in differential form; the general (My−Nx)/N(M_y-N_x)/N test must still be checked for other equations — it is not automatically p(x)p(x).
  • Forgetting that h(y)h(y) (or h(x)h(x)) is found by differentiating the partial potential function, not by guessing. The xx-terms must cancel identically when FyF_y is set equal to NN; if they do not cancel, exactness has failed (or an algebra error was made) — it is not something to force by hand.
  • Assuming an integrating factor of the simple μ(x)\mu(x) or μ(y)\mu(y) form always exists. The ratio (My−Nx)/N(M_y-N_x)/N (or (Nx−My)/M(N_x-M_y)/M) must genuinely simplify to a function of one variable alone; if neither does, a more general μ(x,y)\mu(x,y) (beyond this chapter's scope) or an entirely different method is required.
  • Dropping the requirement of simple connectedness. My=NxM_y=N_x guarantees a local potential function; on a region with a hole (as in the Section 2 counterexample), the global solution curves F=CF=C may not close up into a genuine single-valued function.
  • Sign errors when converting y′=f(x,y)y'=f(x,y) to M dx+N dy=0M\,dx+N\,dy=0. Writing y′=−M/Ny'=-M/N means a given y′=f(x,y)y'=f(x,y) corresponds to M=f(x,y)M=f(x,y), N=−1N=-1 (one valid choice among infinitely many equivalent scalings), and mixing up this sign convention corrupts the exactness test.

Summary

  • Exact equation: M dx+N dy=0M\,dx+N\,dy=0 with M=Fx, N=FyM=F_x,\,N=F_y for some potential FF; solutions are the level curves F(x,y)=CF(x,y)=C.
  • Exactness test: My=NxM_y=N_x on a simply connected region is necessary and sufficient, proved via Clairaut's theorem (necessity) and an explicit path-integral construction of FF (sufficiency).
  • Method: integrate MM in xx to get FF up to h(y)h(y); differentiate in yy, match to NN, solve for h′(y)h'(y), integrate, assemble F(x,y)=CF(x,y)=C.
  • Integrating factors: if (My−Nx)/N(M_y-N_x)/N depends only on xx, use μ(x)=e∫(My−Nx)/N dx\mu(x)=e^{\int (M_y-N_x)/N\,dx}; if (Nx−My)/M(N_x-M_y)/M depends only on yy, use μ(y)=e∫(Nx−My)/M dy\mu(y)=e^{\int (N_x-M_y)/M\,dy}; Chapter 2's linear integrating factor is the special case of the first applied to (py−q)dx+dy=0(py-q)dx+dy=0.
  • Simple connectedness of the domain is essential for a global potential function to exist, even when My=NxM_y=N_x holds pointwise everywhere it is defined.