Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

1.8 Exact Equations

Another type of equation that comes up quite often in physics and engineering is an exact equation. Suppose F(x,y)F(x,y) is a function of two variables, which we call the potential function. The naming should suggest potential energy, or electric potential. Exact equations and potential functions appear when there is a conservation law at play, such as conservation of energy. Let us make up a simple example. Let

F(x,y)=x2+y2.F(x,y) = x^2+y^2. \nonumber

We are interested in the lines of constant energy, that is lines where the energy is conserved; we want curves where F(x,y)=CF(x,y) = C, for some constant CC. In our example, the curves x2+y2=Cx^2+y^2=C are circles. See Figure 1\PageIndex{1}.

Plot of four concentric blue circles centred on the origin, radii roughly 0.5, 3, 6 and 9, on axes about -13 to 13 by -10 to 10. They nest as closed level curves without touching.
Figure 1\PageIndex{1}: Solutions to F(x,y)=x2+y2=CF(x,y)=x^{2}+y^{2}=C for various CC.

We take the total derivative of FF:

dF=Fxdx+Fydy.dF = \frac{\partial F}{\partial x} dx + \frac{\partial F}{\partial y} dy. \nonumber

For convenience, we will make use of the notation of Fx=FxF_x = \frac{\partial F}{\partial x} and Fy=FyF_y = \frac{\partial F}{\partial y}. In our example,

dF=2xdx+2ydy.dF = 2x \, dx + 2y \, dy. \nonumber

We apply the total derivative to F(x,y)=CF(x,y) = C, to find the differential equation dF=0dF = 0. The differential equation we obtain in such a way has the form

Mdx+Ndy=0,orM+Ndydx=0.M \, dx + N \, dy = 0, \qquad \text{or} \qquad M + N \, \frac{dy}{dx} = 0. \nonumber

An equation of this form is called exact if it was obtained as dF=0dF = 0 for some potential function FF. In our simple example, we obtain the equation

2xdx+2ydy=0,or2x+2ydydx=0.2x \, dx + 2y \, dy = 0, \qquad \text{or} \qquad 2x + 2y \, \frac{dy}{dx} = 0. \nonumber

Since we obtained this equation by differentiating x2+y2=Cx^2+y^2=C, the equation is exact. We often wish to solve for yy in terms of xx. In our example,

y=±C2x2.y = \pm \sqrt{C^2-x^2}. \nonumber

An interpretation of the setup is that at each point v=(M,N)\vec{v} = (M,N) is a vector in the plane, that is, a direction and a magnitude. As MM and NN are functions of (x,y)(x,y), we have a vector field. The particular vector field v\vec{v} that comes from an exact equation is a so-called conservative vector field, that is, a vector field that comes with a potential function F(x,y)F(x,y), such that

v=(Fx,Fy).\vec{v} = \left( \frac{\partial F}{\partial x},\frac{\partial F}{\partial y} \right). \nonumber

Let γ\gamma be a path in the plane starting at (x1,y1)(x_1,y_1) and ending at (x2,y2)(x_2,y_2). If we think of v\vec{v} as force, then the work required to move along γ\gamma is

γv(r)·dr=γMdx+Ndy=F(x2,y2)F(x1,y1).\int_\gamma \vec{v}(\vec{r}) \cdot d\vec{r} = \int_\gamma M \, dx + N \, dy = F(x_2,y_2) - F(x_1,y_1). \nonumber

That is, the work done only depends on endpoints, that is where we start and where we end. For example, suppose FF is gravitational potential. The derivative of FF given by v\vec{v} is the gravitational force. What we are saying is that the work required to move a heavy box from the ground floor to the roof, only depends on the change in potential energy. That is, the work done is the same no matter what path we took; if we took the stairs or the elevator. Although if we took the elevator, the elevator is doing the work for us. The curves F(x,y)=CF(x,y) = C are those where no work need be done, such as the heavy box sliding along without accelerating or breaking on a perfectly flat roof, on a cart with incredibly well oiled wheels.

An exact equation is a conservative vector field, and the implicit solution of this equation is the potential function.

Solving exact equations

Now you, the reader, should ask: Where did we solve a differential equation? Well, in applications we generally know MM and NN, but we do not know FF. That is, we may have just started with 2x+2ydydx=02x + 2y \frac{dy}{dx} = 0, or perhaps even

x+ydydx=0.x + y \frac{dy}{dx} = 0. \nonumber

It is up to us to find some potential FF that works. Many different FF will work; adding a constant to FF does not change the equation. Once we have a potential function FF, the equation F(x,y(x))=CF\bigl(x,y(x)\bigr) = C gives an implicit solution of the ODE.

The procedure, once we know that the equation is exact, is:

  1. Integrate Fx=MF_x = M in xx resulting in F(x,y)=something+A(y)F(x,y) = \text{something} + A(y).
  2. Differentiate this FF in yy, and set that equal to NN, so that we may find A(y)A(y) by integration.

The procedure can also be done by first integrating in yy and then differentiating in xx. Pretty easy huh? Let’s try this again.

Is there an easier way to check for the existence of FF, other than failing in trying to find it? Turns out there is. Suppose M=FxM = F_x and N=FyN = F_y. Then as long as the second derivatives are continuous,

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}. \nonumber

Let us state it as a theorem. Usually this is called the Poincaré Lemma.1

The theorem doesn’t give us a global FF defined everywhere. In general, we can only find the potential locally, near some initial point. By this time, we have come to expect this from differential equations.

Let us return to Example 2\PageIndex{2} where M=2x+yM = 2x + y and N=xyN = xy. Notice My=1M_y = 1 and Nx=yN_x = y, which are clearly not equal. The equation is not exact.

Integrating factors

Sometimes an equation Mdx+Ndy=0M\, dx + N \, dy = 0 is not exact, but it can be made exact by multiplying with a function u(x,y)u(x,y). That is, perhaps for some nonzero function u(x,y)u(x,y),

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

is exact. Any solution to this new equation is also a solution to Mdx+Ndy=0M\, dx + N \, dy = 0.

In fact, a linear equation

dydx+p(x)y=f(x),or(p(x)yf(x))dx+dy=0\frac{dy}{dx} + p(x) y = f(x), \qquad \text{or} \qquad \bigl( p(x) y - f(x) \bigr)\, dx + dy = 0 \nonumber

is always such an equation. Let r(x)=ep(x)dxr(x) = e^{\int p(x)\,dx} be the integrating factor for a linear equation. Multiply the equation by r(x)r(x) and write it in the form of M+Ndydx=0M + N \frac{dy}{dx} = 0.

r(x)p(x)yr(x)f(x)+r(x)dydx=0.r(x) p(x) y - r(x) f(x) + r(x) \frac{dy}{dx} = 0. \nonumber

Then M=r(x)p(x)yr(x)f(x)M = r(x) p(x) y - r(x) f(x), so My=r(x)p(x)M_y = r(x) p(x), while N=r(x)N = r(x), so Nx=r(x)=r(x)p(x)N_x = r'(x) = r(x) p(x). In other words, we have an exact equation. Integrating factors for linear functions are just a special case of integrating factors for exact equations.

But how do we find the integrating factor uu? Well, given an equation

Mdx+Ndy=0,M \, dx + N \, dy = 0, \nonumber

uu should be a function such that

y[uM]=uyM+uMy=x[uN]=uxN+uNx.\frac{\partial}{\partial y} \bigl[ u M \bigr] = u_y M + u M_y = \frac{\partial}{\partial x} \bigl[ u N \bigr] = u_x N + u N_x. \nonumber

Therefore,

(MyNx)u=uxNuyM.(M_y-N_x)u = u_x N - u_y M. \nonumber

At first it may seem we replaced one differential equation by another. True, but all hope is not lost.

A strategy that often works is to look for a uu that is a function of xx alone, or a function of yy alone. If uu is a function of xx alone, that is u(x)u(x), then we write u(x)u'(x) instead of uxu_x, and uyu_y is just zero. Then

MyNxNu=u.\frac{M_y-N_x}{N}u = u'. \nonumber

In particular, MyNxN\frac{M_y-N_x}{N} ought to be a function of xx alone (not depend on yy). If so, then we have a linear equation

uMyNxNu=0.u' - \frac{M_y-N_x}{N} u = 0. \nonumber

Letting P(x)=MyNxNP(x) = \frac{M_y-N_x}{N}, we solve using the standard integrating factor method, to find u(x)=CeP(x)dxu(x) = C e^{\int P(x) \, dx}. The constant in the solution is not relevant, we need any nonzero solution, so we take C=1C=1. Then u(x)=eP(x)dxu(x) = e^{\int P(x) \, dx} is the integrating factor.

Similarly we could try a function of the form u(y)u(y). Then

MyNxMu=u.\frac{M_y-N_x}{M} u = - u'. \nonumber

In particular, MyNxM\frac{M_y-N_x}{M} ought to be a function of yy alone. If so, then we have a linear equation

u+MyNxMu=0.u' + \frac{M_y-N_x}{M} u = 0. \nonumber

Letting Q(y)=MyNxMQ(y) = \frac{M_y-N_x}{M}, we find u(y)=CeQ(y)dyu(y) = C e^{-\int Q(y) \, dy}. We take C=1C=1. So u(y)=eQ(y)dyu(y) = e^{-\int Q(y) \, dy} is the integrating factor.

Footnotes

[1] Named for the French polymath Jules Henri Poincaré (1854–1912).

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.