Exact Equations

When a differential equation is secretly a total derivative

The Hidden Structure

Some differential equations are more structured than they first appear. Consider an equation in the form:

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

At first glance, this looks like any other first-order equation. But sometimes, the left side is secretly the total differential of some function F(x,y)F(x, y). When that happens, the equation is simply saying dF=0dF = 0, which means FF is constant along solutions.

This is the essence of an exact equation: a differential equation that is really just dF=0dF = 0 in disguise.

Total Differentials from Multivariable Calculus

Recall from multivariable calculus that if F(x,y)F(x, y) is a function of two variables, its total differential is:

dF=Fxdx+Fydy=Fxdx+FydydF = \frac{\partial F}{\partial x}\,dx + \frac{\partial F}{\partial y}\,dy = F_x\,dx + F_y\,dy

The total differential captures how FF changes when both xx and yy change by small amounts. If a particle moves along a curve where xx changes by dxdx and yy changes by dydy, then FF changes by approximately dFdF.

Now here is the key insight. If we have an equation Mdx+Ndy=0M\,dx + N\,dy = 0 and there exists a function FF such that:

Fx=MandFy=NF_x = M \quad \text{and} \quad F_y = N

then the equation becomes dF=0dF = 0. This means FF is constant along any solution curve.

Interactive: Total Differential and Level Curves

F(x,y)=x2+y2F(x, y) = x^2 + y^2

The purple curve is the level curve through the current point.
The gradient F\nabla F (blue arrow) is always perpendicular to level curves.

The surface shows F(x,y)F(x, y). The level curves are where FF is constant. When we set dF=0dF = 0, we are asking: which curves in the xyxy-plane keep FF unchanged? The answer is precisely the level curves of FF.

The Exactness Test

How do we know if an equation Mdx+Ndy=0M\,dx + N\,dy = 0 is exact? We need to check whether there exists a function FF with Fx=MF_x = M and Fy=NF_y = N.

Here is where a beautiful fact from calculus comes to the rescue. If FF has continuous second partial derivatives, then the mixed partials are equal:

Fxy=FyxF_{xy} = F_{yx}

This means y(Fx)=x(Fy)\frac{\partial}{\partial y}(F_x) = \frac{\partial}{\partial x}(F_y), or equivalently:

My=Nx\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}

This is the exactness test. If the equation is exact, these partial derivatives must be equal. Conversely, in a simply connected region, if these partials are equal, the equation is exact.

Interactive: Test for Exactness

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

M(x, y)

2xy+32xy + 3

N(x, y)

x2+4yx² + 4y

Exactness Test:

My=2x\frac{\partial M}{\partial y} = 2x
Nx=2x\frac{\partial N}{\partial x} = 2x

Exact

My=Nx\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}

The classic example from the text

Enter any functions MM and NN. The checker computes the partial derivatives and tells you whether the equation is exact. When M/y=N/x\partial M/\partial y = \partial N/\partial x, a potential function FF exists.

Why Does This Test Work?

The logic is elegant. If FF exists with Fx=MF_x = M and Fy=NF_y = N, then:

My=2Fyx=2Fxy=Nx\frac{\partial M}{\partial y} = \frac{\partial^2 F}{\partial y \partial x} = \frac{\partial^2 F}{\partial x \partial y} = \frac{\partial N}{\partial x}

The equality of mixed partials guarantees that the exactness test passes. Going the other direction (proving existence when the test passes) requires a theorem about conservative vector fields, but the practical upshot is simple: check if the cross-partials match.

Finding the Potential Function

Once we know an equation is exact, we need to find the function F(x,y)F(x, y) such that Fx=MF_x = M and Fy=NF_y = N. The method has two steps.

Step 1: Integrate with respect to one variable.

Start with Fx=MF_x = M and integrate with respect to xx:

F(x,y)=M(x,y)dx+g(y)F(x, y) = \int M(x, y)\,dx + g(y)

The "constant" of integration is actually a function g(y)g(y) because when we differentiate FF with respect to xx, any function of yy alone would vanish.

Step 2: Determine the unknown function.

Now use the condition Fy=NF_y = N. Differentiate our expression for FF with respect to yy:

Fy=y[Mdx]+g(y)=NF_y = \frac{\partial}{\partial y}\left[\int M\,dx\right] + g'(y) = N

This lets us solve for g(y)g'(y), and then integrate to find g(y)g(y).

Interactive: Step-by-Step Potential Finding

Step 1 of 8Given equation
(2xy+3)dx+(x2+4y)dy=0(2xy + 3)\,dx + (x^2 + 4y)\,dy = 0

We identify M = 2xy + 3 and N = x² + 4y

Follow along as the method unfolds step by step. Enter an exact equation and watch the integration process reveal the potential function FF.

Solutions Are Level Curves

Once we have F(x,y)F(x, y), the general solution to Mdx+Ndy=0M\,dx + N\,dy = 0 is:

F(x,y)=CF(x, y) = C

where CC is an arbitrary constant. Each choice of CC gives a different solution curve, and together they form a family of level curves of FF.

This is geometrically beautiful. The solution curves are the contours of the potential function. They never cross (except at singular points), and they tile the plane into nested families.

Interactive: Family of Solution Curves

F(x,y)=x2y+3x+2y2=CF(x,y) = x^2 y + 3x + 2y^2 = C

The purple curve is the solution F(x,y)=5.0F(x,y) = 5.0.
Each level curve is a separate solution to the differential equation.

Explore how different values of CC trace out different solution curves. The gradient F\nabla F is always perpendicular to the level curves, which connects to the fact that the direction field is tangent to solutions.

A Worked Example

Consider the equation:

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

Check exactness: Here M=2xy+3M = 2xy + 3 and N=x2+4yN = x^2 + 4y.

My=2xandNx=2x\frac{\partial M}{\partial y} = 2x \quad \text{and} \quad \frac{\partial N}{\partial x} = 2x

They are equal, so the equation is exact.

Find F: Integrate MM with respect to xx:

F=(2xy+3)dx=x2y+3x+g(y)F = \int (2xy + 3)\,dx = x^2 y + 3x + g(y)

Differentiate with respect to yy:

Fy=x2+g(y)F_y = x^2 + g'(y)

Set this equal to N=x2+4yN = x^2 + 4y:

x2+g(y)=x2+4y    g(y)=4y    g(y)=2y2x^2 + g'(y) = x^2 + 4y \implies g'(y) = 4y \implies g(y) = 2y^2

So the potential function is F(x,y)=x2y+3x+2y2F(x, y) = x^2 y + 3x + 2y^2, and the general solution is:

x2y+3x+2y2=Cx^2 y + 3x + 2y^2 = C

When Equations Are Not Exact: Integrating Factors

What if M/yN/x\partial M/\partial y \neq \partial N/\partial x? All is not lost. Sometimes we can multiply the entire equation by a function μ(x,y)\mu(x, y) called an integrating factor to make it exact.

The modified equation μMdx+μNdy=0\mu M\,dx + \mu N\,dy = 0 is exact if:

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

Finding μ\mu in general is as hard as solving the original equation. But there are special cases:

If μ\mu depends only on xx: The condition becomes

1μdμdx=MyNxN\frac{1}{\mu}\frac{d\mu}{dx} = \frac{M_y - N_x}{N}

If the right side depends only on xx, we can find μ(x)\mu(x) by integration.

If μ\mu depends only on yy: The condition becomes

1μdμdy=NxMyM\frac{1}{\mu}\frac{d\mu}{dy} = \frac{N_x - M_y}{M}

If the right side depends only on yy, we can find μ(y)\mu(y) by integration.

This technique extends the reach of the exact equation method significantly.

Connection to Physics

Exact equations arise naturally in physics and engineering. When Mdx+Ndy=0M\,dx + N\,dy = 0 is exact, the vector field (M,N)(M, N) is conservative. The function FF is the potential energy, and solutions follow paths of constant energy.

In thermodynamics, exact differentials appear as state functions. The internal energy UU of a system satisfies dU=δQδWdU = \delta Q - \delta W, but only certain combinations form exact differentials. Recognizing exactness tells us which quantities are true state functions, independent of the path taken.

In fluid mechanics, stream functions and velocity potentials satisfy exact equations. The level curves of a stream function are streamlines along which fluid particles travel.

Key Takeaways

  • An exact equation Mdx+Ndy=0M\,dx + N\,dy = 0 is secretly the total differential dF=0dF = 0 of some potential function F(x,y)F(x, y)
  • The exactness test: check if M/y=N/x\partial M/\partial y = \partial N/\partial x (equality of mixed partials)
  • To find FF: integrate MM with respect to xx, then use Fy=NF_y = N to determine the unknown function of yy
  • Solutions are level curves F(x,y)=CF(x, y) = C, forming a family of contours of the potential function
  • Non-exact equations can sometimes be made exact by multiplying by an integrating factor μ\mu
  • Exact equations connect to conservative vector fields, potential energy, and state functions in physics