Unit 6, lesson 43

Exact Differential Equations

How to tell when M dx + N dy = 0 is the differential of a function F, how to build that potential, how to repair a near miss with an integrating factor, and why the domain matters.

  • Theory part 85
  • Practice part 86
  • Exact Equations and Complex Numbers

A point moving around the circle x2+y2=4x^2 + y^2 = 4 keeps the value of F(x,y)=x2+y2F(x, y) = x^2 + y^2 fixed at 44. Differentiate that fact with the chain rule and you get 2x dx+2y dy=02x\,dx + 2y\,dy = 0, a differential equation. Exact equations run this backwards. You are handed the equation, you recognize it as the differential of some function FF, and the solutions are the level curves of FF.

Key terms

The differential form M dx + N dy

Definition Let MM and NN be continuous real functions on an open set DD in the plane. The equation

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

is a first-order differential equation in differential form. A solution is a differentiable function y=φ(x)y = \varphi(x) on an open interval II whose graph lies in DD and which satisfies

M(x,φ(x))+N(x,φ(x)) φ′(x)=0for all x in I.\begin{gathered} M(x, \varphi(x)) + N(x, \varphi(x))\,\varphi'(x) = 0 \\[0.4em] \text{for all } x \text{ in } I. \end{gathered}

Solutions of the form x=ψ(y)x = \psi(y), with M ψ′(y)+N=0M\,\psi'(y) + N = 0, are allowed in the same way, so the form treats xx and yy symmetrically.

In plain words The form is the equation y′=−M/Ny' = -M/N written without dividing, which keeps the points where N=0N = 0 in view instead of throwing them away.

Example The form 2x dx+2y dy=02x\,dx + 2y\,dy = 0 on the whole plane says 2x+2y y′=02x + 2y\,y' = 0. Where y≠0y \ne 0 that is

y′=−xy,y' = -\frac{x}{y},

and the function φ(x)=4−x2\varphi(x) = \sqrt{4 - x^2} on (−2,2)(-2, 2) is a solution, since 2x+24−x2⋅−x4−x2=02x + 2\sqrt{4 - x^2} \cdot \dfrac{-x}{\sqrt{4 - x^2}} = 0.

Potential function

Definition A potential function for the form M dx+N dyM\,dx + N\,dy on an open set DD is a function FF with continuous first partial derivatives on DD such that

∂F∂x=Mand∂F∂y=Non D.\frac{\partial F}{\partial x} = M \quad \text{and} \quad \frac{\partial F}{\partial y} = N \quad \text{on } D.

Then dF=M dx+N dydF = M\,dx + N\,dy, and the vector field ⟨M,N⟩\langle M, N \rangle is the gradient of FF. When DD is connected, any two potentials differ by a constant.

In plain words A potential is a function whose two partial derivatives are exactly the two coefficients. It is the same object as the potential of a conservative vector field in the fundamental theorem for line integrals.

Example For (2xy+3) dx+(x2+4y) dy(2xy + 3)\,dx + (x^2 + 4y)\,dy on the plane, integrate MM in xx while holding yy fixed,

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

where gg is a function of yy alone. Matching FyF_y with NN gives x2+g′(y)=x2+4yx^2 + g'(y) = x^2 + 4y, so g′(y)=4yg'(y) = 4y and g(y)=2y2g(y) = 2y^2. A potential is

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

Check it by differentiating. The partials are 2xy+32xy + 3 and x2+4yx^2 + 4y, as required.

Exactness

Definition The equation M dx+N dy=0M\,dx + N\,dy = 0 is exact on the open set DD if the form has a potential FF on DD. In that case a differentiable function φ\varphi on an interval II, with graph in DD, is a solution exactly when F(x,φ(x))F(x, \varphi(x)) is constant on II, because by the chain rule

ddxF(x,φ(x))=M(x,φ(x))+N(x,φ(x)) φ′(x).\begin{aligned} &\frac{d}{dx} F(x, \varphi(x)) \\[0.4em] &= M(x, \varphi(x)) + N(x, \varphi(x))\,\varphi'(x). \end{aligned}

So the solution curves lie on the level sets F(x,y)=CF(x, y) = C.

In plain words Exact means the left side is already a total differential dFdF. Saying dF=0dF = 0 along a curve says FF does not change along it.

Example With the potential from the previous section, every solution of (2xy+3) dx+(x2+4y) dy=0(2xy + 3)\,dx + (x^2 + 4y)\,dy = 0 satisfies

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

for some constant CC. The point (1,1)(1, 1) gives C=1+3+2=6C = 1 + 3 + 2 = 6, so the solution through (1,1)(1, 1) lies on the curve x2y+3x+2y2=6x^2 y + 3x + 2y^2 = 6.

Continuous partial derivatives and the test

Definition Suppose MM and NN have continuous first partial derivatives on an open set DD. If the equation 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 second partials Fxy=MyF_{xy} = M_y and Fyx=NxF_{yx} = N_x, and Clairaut’s theorem says these mixed partials are equal. This condition is necessary on every open set. Whether it is also sufficient depends on the shape of DD, which is the next section.

In plain words Before hunting for FF, compare MyM_y with NxN_x. If they differ anywhere in DD, no potential exists there and you can stop.

Example For (ycos⁡x+2xey) dx+(sin⁡x+x2ey−1) dy=0(y \cos x + 2x e^y)\,dx + (\sin x + x^2 e^y - 1)\,dy = 0 both coefficients are smooth on the plane, and

My=cos⁡x+2xey=Nx.M_y = \cos x + 2x e^y = N_x.

The test passes. For (3xy+y2) dx+(x2+xy) dy=0(3xy + y^2)\,dx + (x^2 + xy)\,dy = 0, on the other hand,

My=3x+2y,Nx=2x+y,M_y = 3x + 2y, \qquad N_x = 2x + y,

which differ wherever x+y≠0x + y \ne 0. Every nonempty open set contains points off the line x+y=0x + y = 0, so that equation is not exact on any nonempty open set.

The simply connected domain condition

Definition An open set DD in the plane is simply connected if it is connected and every simple closed curve in DD encloses only points of DD, so DD has no holes. The theorem on exact equations states the following. Let DD be an open, simply connected set, and let MM and NN have continuous first partial derivatives on DD. Then M dx+N dy=0M\,dx + N\,dy = 0 is exact on DD if and only if My=NxM_y = N_x at every point of DD. In the simplest case DD is an open rectangle a<x<ba < x < b, c<y<dc < y < d. Fix a point (x0,y0)(x_0, y_0) in it. Integrating the form from (x0,y0)(x_0, y_0) horizontally to (x,y0)(x, y_0) and then vertically to (x,y)(x, y), two segments that stay inside the rectangle, gives a potential on the whole rectangle,

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}

In plain words Equal cross partials guarantee a potential only on a region without holes. Around a hole the line integral of the form can be nonzero, and then no single valued FF exists.

Example On the punctured plane, D=R2D = \mathbb{R}^2 without the origin, take

M=−yx2+y2,N=xx2+y2.M = \frac{-y}{x^2 + y^2}, \qquad N = \frac{x}{x^2 + y^2}.

Both have continuous partials on DD and My=Nx=y2−x2(x2+y2)2M_y = N_x = \dfrac{y^2 - x^2}{(x^2 + y^2)^2}. Yet the line integral of the form around the unit circle, counterclockwise with x=cos⁡θx = \cos \theta and y=sin⁡θy = \sin \theta, is

∫02π(sin⁡2θ+cos⁡2θ) dθ=2π≠0,\int_0^{2\pi} (\sin^2 \theta + \cos^2 \theta)\,d\theta = 2\pi \ne 0,

while the integral of dFdF around a closed curve would be 00. So the equation is not exact on the punctured plane. On the right half plane x>0x > 0, which is simply connected, it is exact with potential F=arctan⁡(y/x)F = \arctan(y/x), and its solutions there lie on the rays y=kxy = kx.

Integrating factors

Definition A function μ(x,y)\mu(x, y) with continuous first partials and μ≠0\mu \ne 0 on DD is an integrating factor for M dx+N dy=0M\,dx + N\,dy = 0 if μM dx+μN dy=0\mu M\,dx + \mu N\,dy = 0 is exact on DD. Two cases reduce to one variable. Suppose DD is open and simply connected and MM and NN have continuous first partials on DD. In each case below the new coefficients have equal cross partials, so the previous theorem makes the new equation exact.

  • If My−Nx=h(x) NM_y - N_x = h(x)\,N on DD for a function hh continuous on an interval containing every xx coordinate of DD, then μ(x)=e∫h(x) dx\mu(x) = e^{\int h(x)\,dx} is an integrating factor.
  • If Nx−My=k(y) MN_x - M_y = k(y)\,M on DD for a continuous kk in the same sense, then μ(y)=e∫k(y) dy\mu(y) = e^{\int k(y)\,dy} is an integrating factor.

Because μ\mu never vanishes on DD, the old and new equations have the same solutions in DD. Multiplying by a factor that is zero or undefined somewhere can gain or lose solutions there, so those points must be checked by hand.

In plain words When the cross partials disagree by a multiple of NN that depends only on xx, an exponential in xx fixes the mismatch. The same works with yy and MM.

Example For (3xy+y2) dx+(x2+xy) dy=0(3xy + y^2)\,dx + (x^2 + xy)\,dy = 0 the mismatch is

My−Nx=x+y=1x (x2+xy)=1x N.\begin{aligned} M_y - N_x &= x + y \\[0.4em] &= \frac{1}{x}\,(x^2 + xy) = \frac{1}{x}\,N. \end{aligned}

On the half plane x>0x > 0 this gives h(x)=1/xh(x) = 1/x and μ(x)=eln⁡x=x\mu(x) = e^{\ln x} = x, which is positive there. The new equation

(3x2y+xy2) dx+(x3+x2y) dy=0\begin{gathered} (3x^2 y + x y^2)\,dx \\[0.4em] + (x^3 + x^2 y)\,dy = 0 \end{gathered}

has My=3x2+2xy=NxM_y = 3x^2 + 2xy = N_x and potential F=x3y+12x2y2F = x^3 y + \tfrac{1}{2} x^2 y^2. The solutions with x>0x > 0 lie on the curves x3y+12x2y2=Cx^3 y + \tfrac{1}{2} x^2 y^2 = C. The line x=0x = 0, where μ\mu vanishes, needs its own check. Along it dx=0dx = 0 and N(0,y)=0N(0, y) = 0, so it is a solution of the original equation that the half plane computation never sees.

Implicit solutions

Definition An equation F(x,y)=CF(x, y) = C is an implicit solution of M dx+N dy=0M\,dx + N\,dy = 0 on an interval II if some differentiable φ\varphi on II has F(x,φ(x))=CF(x, \varphi(x)) = C there and solves the differential equation. For an exact equation with potential FF on DD and a point (x0,y0)(x_0, y_0) of DD with N(x0,y0)≠0N(x_0, y_0) \ne 0, the implicit function theorem gives an open interval around x0x_0 on which the level set F(x,y)=F(x0,y0)F(x, y) = F(x_0, y_0) is, near (x0,y0)(x_0, y_0), the graph of a unique differentiable φ\varphi with φ(x0)=y0\varphi(x_0) = y_0. That φ\varphi is the solution of the initial value problem. It extends as long as its graph stays in DD and N≠0N \ne 0 along it.

In plain words A level set is not automatically a graph. The solution through a given point is the single branch of the level curve through it, and it ends where the branch turns vertical or leaves the domain.

Example For 2x dx+2y dy=02x\,dx + 2y\,dy = 0 the potential is F=x2+y2F = x^2 + y^2, and the level sets x2+y2=Cx^2 + y^2 = C behave in three ways.

Value of CCLevel set
C>0C > 0circle of radius C\sqrt{C}
C=0C = 0only the origin, which carries no solution curve
C<0C < 0empty

With y(0)=2y(0) = 2 the value is C=4C = 4. Here N=2y≠0N = 2y \ne 0 at (0,2)(0, 2), and the solution is the upper half

φ(x)=4−x2,−2<x<2.\varphi(x) = \sqrt{4 - x^2}, \qquad -2 < x < 2.

It stops at x=±2x = \pm 2, where N=0N = 0 and the circle turns vertical. The whole circle is the level set, but it is not the graph of one solution.

Check yourself

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

The coefficients are smooth on the plane, which is simply connected, and My=cos⁡x+2xey=NxM_y = \cos x + 2x e^y = N_x, so the equation is exact. Integrating MM in xx gives ysin⁡x+x2ey+g(y)y \sin x + x^2 e^y + g(y), and matching the yy partial with NN forces g′(y)=−1g'(y) = -1. The solutions satisfy

ysin⁡x+x2ey−y=C.y \sin x + x^2 e^y - y = C.
  1. Solve the initial value problem (3x2+2y) dx+(2x+2y) dy=0(3x^2 + 2y)\,dx + (2x + 2y)\,dy = 0 with y(0)=1y(0) = 1, give the solution explicitly, and find the largest interval on which it exists.
Show the answer

Since My=2=NxM_y = 2 = N_x on the plane, a potential is F=x3+2xy+y2F = x^3 + 2xy + y^2, and y(0)=1y(0) = 1 gives C=1C = 1. Solving y2+2xy+x3−1=0y^2 + 2xy + x^3 - 1 = 0 for yy and choosing the root with y(0)=1y(0) = 1 gives

y=−x+x2−x3+1.y = -x + \sqrt{x^2 - x^3 + 1}.

Along this branch N=2x+2y=2x2−x3+1N = 2x + 2y = 2\sqrt{x^2 - x^3 + 1}, which is nonzero exactly where the square root is positive. The cubic x3−x2−1x^3 - x^2 - 1 has one real root r≈1.4656r \approx 1.4656, so the solution exists on (−∞,r)(-\infty, r) and ends at x=rx = r, where its slope becomes infinite.

  1. Find an integrating factor for y dx+(2x−yey) dy=0y\,dx + (2x - y e^y)\,dy = 0 on the half plane y>0y > 0 and solve the equation there.
Show the answer

Here Nx−My=2−1=1=1y MN_x - M_y = 2 - 1 = 1 = \frac{1}{y}\,M, so k(y)=1/yk(y) = 1/y and μ=eln⁡y=y\mu = e^{\ln y} = y, which is positive for y>0y > 0. The equation y2 dx+(2xy−y2ey) dy=0y^2\,dx + (2xy - y^2 e^y)\,dy = 0 is exact, and its solutions satisfy

xy2−(y2−2y+2) ey=C.x y^2 - (y^2 - 2y + 2)\,e^y = C.

How this lesson connects

It also uses Partial derivatives and the chain rule, Antiderivatives and elementary first-order differential equations and Parametrized curves and line integrals.