Unit 2, lesson 9

Exact Differential Equations

How to recognize M dx + N dy as an exact differential, how the test for exactness leads to a potential function for an exact equation, and why local exactness becomes global on a simply connected domain.

  • Video 9
  • Exact Equations and Integrating Factors

Let xx be the independent variable and write y′=dy/dxy' = dy/dx. The solutions of y′=−x/yy' = -x/y lie on the circles x2+y2=Cx^2 + y^2 = C, so the quantity x2+y2x^2 + y^2 stays constant along every solution. Many first-order equations hide a conserved quantity of this kind, a function of both variables whose differential is the equation itself. This lesson shows how to recognize such an exact equation, how to build that function one variable at a time, and why a hole in the domain can prevent one function from working on the whole region.

Key terms

Exact differential

Definition Let F(x,y)F(x, y) have continuous first partial derivatives on an open set DD in the plane. The partial derivative Fx=∂F/∂xF_x = \partial F/\partial x is the derivative in xx with yy held fixed, and Fy=∂F/∂yF_y = \partial F/\partial y is the derivative in yy with xx held fixed. The total differential of FF is

dF=Fx dx+Fy dy.dF = F_x\,dx + F_y\,dy.

An expression M dx+N dyM\,dx + N\,dy is an exact differential on DD if it equals dFdF for such a function FF, which means Fx=MF_x = M and Fy=NF_y = N at every point of DD. Along a differentiable graph y=y(x)y = y(x) inside DD, with y′=dy/dxy' = dy/dx, the chain rule gives

ddxF(x,y(x))=Fx+Fy y′,\begin{aligned} &\frac{d}{dx}F\bigl(x, y(x)\bigr) \\[0.4em] &= F_x + F_y\,y', \end{aligned}

with both partial derivatives evaluated at (x,y(x))\bigl(x, y(x)\bigr).

In plain words An exact differential records how one function FF changes when xx and yy both change a little. Its two coefficients are the rates of change of FF in the two coordinate directions.

Example For F(x,y)=xy2+sin⁡xF(x, y) = xy^2 + \sin x, holding yy fixed gives Fx=y2+cos⁡xF_x = y^2 + \cos x, and holding xx fixed gives Fy=2xyF_y = 2xy. So

(y2+cos⁡x) dx+2xy dy(y^2 + \cos x)\,dx + 2xy\,dy

is an exact differential on the whole plane, namely dFdF.

Exact equation

Definition Let MM and NN be continuous functions of (x,y)(x, y) on an open set DD. The equation

M dx+N dy=0M\,dx + N\,dy = 0

is exact on DD if M dx+N dyM\,dx + N\,dy is an exact differential there. With xx as the independent variable and y′=dy/dxy' = dy/dx, a solution is a differentiable function yy on an open interval whose graph lies in DD and which satisfies M(x,y(x))+N(x,y(x)) y′(x)=0M\bigl(x, y(x)\bigr) + N\bigl(x, y(x)\bigr)\,y'(x) = 0. For an exact equation with dF=M dx+N dydF = M\,dx + N\,dy, the chain rule shows that yy is a solution exactly when F(x,y(x))F\bigl(x, y(x)\bigr) is constant on the interval. So every solution lies on a level curve F(x,y)=CF(x, y) = C. Conversely, if (x0,y0)(x_0, y_0) is a point of DD with N(x0,y0)≠0N(x_0, y_0) \ne 0, the implicit function theorem shows that the part of the level curve near (x0,y0)(x_0, y_0) is the graph of a differentiable solution with y(x0)=y0y(x_0) = y_0, and its slope is y′=−M/Ny' = -M/N.

In plain words An exact equation says that the change of some function FF along the solution is zero. So FF stays constant along every solution, and the solutions follow its level curves.

Example Where y≠0y \ne 0, the equation y′=−x/yy' = -x/y can be written x dx+y dy=0x\,dx + y\,dy = 0, which is dF=0dF = 0 for F=12(x2+y2)F = \tfrac{1}{2}(x^2 + y^2). Its solutions lie on circles centered at the origin. Through (0,2)(0, 2) the level curve is x2+y2=4x^2 + y^2 = 4, and since N=y=2≠0N = y = 2 \ne 0 there, the solution near that point is the upper half y=4−x2y = \sqrt{4 - x^2}. It continues on (−2,2)(-2, 2) and ends at x=±2x = \pm 2, where N=y=0N = y = 0 and the circle turns vertical.

Potential function

Definition A potential function for M dx+N dyM\,dx + N\,dy on an open set DD is a function FF with continuous first partial derivatives such that Fx=MF_x = M and Fy=NF_y = N on DD. On a connected set any two potentials differ by a constant, so they have the same level curves. When the equation is exact on a rectangle or on the whole plane, a potential is built in three steps.

  1. Integrate MM in xx with yy held fixed, and add an unknown function h(y)h(y) in place of the constant of integration.
  2. Differentiate the result in yy and set it equal to NN. Exactness guarantees that the resulting equation for h′(y)h'(y) involves yy alone.
  3. Integrate h′(y)h'(y), then check both Fx=MF_x = M and Fy=NF_y = N.

In plain words Recover FF from its two partial derivatives one variable at a time. The function h(y)h(y) holds the part of FF that the first integration cannot see, because its derivative in xx is zero.

Example Take M=2xy+3x2M = 2xy + 3x^2 and N=x2+4yN = x^2 + 4y, polynomials on the whole plane. Integrating MM in xx gives

F=x2y+x3+h(y).F = x^2y + x^3 + h(y).

Then Fy=x2+h′(y)F_y = x^2 + h'(y) must equal x2+4yx^2 + 4y, so h′(y)=4yh'(y) = 4y and h(y)=2y2h(y) = 2y^2, up to an additive constant that can be dropped. The potential is

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

and its partial derivatives are 2xy+3x22xy + 3x^2 and x2+4yx^2 + 4y, as required. The solution through (0,1)(0, 1) lies on the level curve where F=2F = 2,

x2y+x3+2y2=2.x^2y + x^3 + 2y^2 = 2.

Since N(0,1)=4≠0N(0, 1) = 4 \ne 0, this relation defines a differentiable solution near x=0x = 0, and its slope y′=−M/Ny' = -M/N is 0/4=00/4 = 0 there, so the tangent at the initial point is horizontal. Solving the relation as a quadratic in yy and keeping the root with y(0)=1y(0) = 1 shows that along this solution N=x4−8x3+16N = \sqrt{x^4 - 8x^3 + 16}. That is positive for x<rx < r, where r≈1.339r \approx 1.339 is the smallest positive root of x4−8x3+16x^4 - 8x^3 + 16, so the solution interval is (−∞,r)(-\infty, r). At x=rx = r we get N=0N = 0, the slope formula fails and the level curve has a vertical tangent.

Test for exactness

Definition Let MM and NN have continuous first partial derivatives on an open set DD. If M dx+N dy=0M\,dx + N\,dy = 0 is exact on DD, then

∂M∂y=∂N∂xon D.\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} \quad \text{on } D.

The reason is that a potential FF then has continuous mixed partial derivatives Fxy=MyF_{xy} = M_y and Fyx=NxF_{yx} = N_x, and continuous mixed partial derivatives are equal. Conversely, if My=NxM_y = N_x everywhere on DD and DD is an open rectangle, an open disk or more generally an open simply connected set, the equation is exact on DD. If My≠NxM_y \ne N_x at even one point of DD, the equation is not exact on DD, and by continuity it is not exact on any open set containing that point.

In plain words Before looking for FF, compare MyM_y with NxN_x. If they differ at some point, no potential exists near that point. If they agree throughout DD, a potential exists at least on every rectangle inside DD.

Example For the polynomial example above, My=2xM_y = 2x and Nx=2xN_x = 2x, so the test passes on the whole plane, which agrees with the potential already found. For xy dx+x2 dy=0xy\,dx + x^2\,dy = 0 the test gives My=xM_y = x and Nx=2xN_x = 2x. They agree only on the line x=0x = 0, and every open set contains points off that line, so this equation is not exact on any open set. Not exact does not mean unsolvable. On the half-plane x>0x > 0, dividing by xx gives y dx+x dy=0y\,dx + x\,dy = 0, which is d(xy)=0d(xy) = 0, so the solutions there are y=C/xy = C/x. Multipliers of this kind are the integrating factors of the next lesson.

Local exactness

Definition The equation M dx+N dy=0M\,dx + N\,dy = 0 is locally exact on an open set DD if every point of DD lies in an open rectangle inside DD on which the equation is exact. If MM and NN have continuous first partial derivatives on DD and My=NxM_y = N_x on DD, the equation is locally exact on DD. On an open rectangle RR inside DD that contains (x0,y0)(x_0, y_0), a potential is

F(x,y)=∫x0xM(s,y0) ds+∫y0yN(x,s) ds,\begin{aligned} F(x, y) &= \int_{x_0}^{x} M(s, y_0)\,ds \\[0.4em] &\quad + \int_{y_0}^{y} N(x, s)\,ds, \end{aligned}

the integral of the form along a horizontal segment and then a vertical segment, both inside RR. Local potentials on overlapping rectangles differ by constants, and those constants need not fit together around the whole of DD. So a locally exact equation need not be exact on DD.

In plain words Equal mixed partial derivatives always give a potential on small pieces of the domain. Whether the pieces join into one potential depends on the shape of the domain.

Example On the punctured plane, the plane without the origin, consider the angular form

ω=−y dx+x dyx2+y2.\omega = \frac{-y\,dx + x\,dy}{x^2 + y^2}.

Its coefficients satisfy

My=Nx=y2−x2(x2+y2)2.M_y = N_x = \frac{y^2 - x^2}{(x^2 + y^2)^2}.

On the half-planes x>0x > 0 and x<0x < 0 the function arctan⁡(y/x)\arctan(y/x) is a potential, and on the half-planes y>0y > 0 and y<0y < 0 the function −arctan⁡(x/y)-\arctan(x/y) is one. Every point other than the origin lies in one of these half-planes, so ω=0\omega = 0 is locally exact on the punctured plane. In the first quadrant both potentials apply, and they differ by the constant π/2\pi/2.

Simply connected domain

Definition A connected open set DD in the plane is simply connected if every closed curve in DD can be shrunk continuously to a point without leaving DD. For sets in the plane this means that DD has no holes. Open disks, rectangles, half-planes and the whole plane are simply connected, while the punctured plane and an annulus are not. If DD is open and simply connected, and MM and NN have continuous first partial derivatives with My=NxM_y = N_x throughout DD, then M dx+N dy=0M\,dx + N\,dy = 0 is exact on DD, with one potential defined on all of DD. Without that condition the conclusion can fail. The integral of an exact differential dFdF around any closed curve in DD is 00, because FF returns to its starting value, so a form with a nonzero integral around some closed curve has no potential on DD.

In plain words A loop around a hole can carry a nonzero total change, which no single valued potential allows. In a region without holes every loop shrinks to a point, and this obstruction cannot occur.

Example Go once around the unit circle with x=cos⁡θx = \cos\theta and y=sin⁡θy = \sin\theta, so that dx=−sin⁡θ dθdx = -\sin\theta\,d\theta, dy=cos⁡θ dθdy = \cos\theta\,d\theta and x2+y2=1x^2 + y^2 = 1. The numerator becomes (sin⁡2θ+cos⁡2θ) dθ=dθ(\sin^2\theta + \cos^2\theta)\,d\theta = d\theta, so the angular form becomes dθd\theta and

∮ω=∫02πdθ=2π.\oint \omega = \int_0^{2\pi} d\theta = 2\pi.

So ω=0\omega = 0 is not exact on the punctured plane, even though the test passes at every point there. On the plane with the nonpositive xx-axis removed, which is simply connected, the polar angle θ\theta with −π<θ<π-\pi < \theta < \pi is a potential, and the solution curves there are the open rays from the origin that lie in this region.

Check yourself

  1. Show that (ey+2x) dx+(xey−1) dy=0(e^y + 2x)\,dx + (xe^y - 1)\,dy = 0 is exact on the plane and find its solutions in implicit form.
Show the answer

The coefficients have continuous partial derivatives on the plane, which is simply connected, and My=ey=NxM_y = e^y = N_x, so the equation is exact. Integrating MM in xx gives F=xey+x2+h(y)F = xe^y + x^2 + h(y). Then Fy=xey+h′(y)F_y = xe^y + h'(y) must equal xey−1xe^y - 1, so h′(y)=−1h'(y) = -1 and h(y)=−yh(y) = -y. The solutions satisfy

xey+x2−y=C.xe^y + x^2 - y = C.

As a check, Fx=ey+2xF_x = e^y + 2x and Fy=xey−1F_y = xe^y - 1.

  1. Solve (2x+y) dx+(x+2y) dy=0(2x + y)\,dx + (x + 2y)\,dy = 0 with y(0)=1y(0) = 1, write the solution explicitly and give its solution interval.
Show the answer

Both coefficients are polynomials and My=1=NxM_y = 1 = N_x on the plane, so the equation is exact. Integrating MM in xx gives x2+xy+h(y)x^2 + xy + h(y), and matching Fy=x+h′(y)F_y = x + h'(y) with N=x+2yN = x + 2y gives h′(y)=2yh'(y) = 2y, so F=x2+xy+y2F = x^2 + xy + y^2. The point (0,1)(0, 1) gives F=1F = 1, so the solution lies on the ellipse x2+xy+y2=1x^2 + xy + y^2 = 1. As a quadratic in yy this is y2+xy+(x2−1)=0y^2 + xy + (x^2 - 1) = 0, and the root with y(0)=1y(0) = 1 is

y=−x+4−3x22.y = \frac{-x + \sqrt{4 - 3x^2}}{2}.

Along it N=x+2y=4−3x2N = x + 2y = \sqrt{4 - 3x^2}, which is positive exactly when ∣x∣<2/3\lvert x \rvert < 2/\sqrt{3}. The solution interval is (−2/3,2/3)(-2/\sqrt{3}, 2/\sqrt{3}), about (−1.1547,1.1547)(-1.1547, 1.1547). At the endpoints N=0N = 0 and the ellipse has a vertical tangent, so the graph cannot be continued as a function of xx.

  1. The equations x dx+y dyx2+y2=0\dfrac{x\,dx + y\,dy}{x^2 + y^2} = 0 and −y dx+x dyx2+y2=0\dfrac{-y\,dx + x\,dy}{x^2 + y^2} = 0 both pass the test for exactness on the punctured plane. Which of them is exact there, and what does the answer say about the role of simple connectivity?
Show the answer

The first is exact on the punctured plane, with potential F=12ln⁡(x2+y2)F = \tfrac{1}{2}\ln(x^2 + y^2), whose partial derivatives are x/(x2+y2)x/(x^2 + y^2) and y/(x2+y2)y/(x^2 + y^2). Its solutions lie on the circles x2+y2=Cx^2 + y^2 = C with C>0C > 0. The second is not exact there, because its integral around the unit circle is 2π2\pi, while the integral of dFdF around a closed curve is 00.

The test passes for both, and the punctured plane is not simply connected, so the theorem decides neither case. Simple connectivity is a sufficient condition for the test to give one potential on the whole domain, not a necessary one.

How this lesson connects