Differential Equations · Undergraduate

Exact Differential Equations and Integrating Factors

Quick answer

An equation M(x, y) dx + N(x, y) dy = 0 is exact when it is the total differential of some function F(x, y), that is, when F_x = M and F_y = N. Then the solutions are the level curves F(x, y) = C. The test is ∂M/∂y = ∂N/∂x, which follows from the equality of mixed partial derivatives. To find F, integrate M with respect to x, add an unknown g(y), and fix g by matching N. Some non-exact equations become exact after multiplying by an integrating factor.

What you'll learn

  • Test an equation M dx + N dy = 0 for exactness
  • Find the potential function F and write the solution F = C
  • Solve an initial value problem for an exact equation
  • Make an equation exact with an integrating factor that depends on x

Equations that are a total differential

Write a first-order equation in the form

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

If some function F(x,y)F(x, y) has Fx=MF_x = M and Fy=NF_y = N, the left side is the total differential dFdF. The equation then says dF=0dF = 0, so FF is constant along every solution:

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

Such an equation is called exact, and FF is its potential function.

Why the test is ∂M/∂y = ∂N/∂x

If FF exists, then My=FxyM_y = F_{xy} and Nx=FyxN_x = F_{yx}. For functions with continuous second partial derivatives the two mixed partials are equal, so an exact equation must have My=NxM_y = N_x. The converse holds on any region with no holes: when My=NxM_y = N_x, the steps below always produce an FF. Exactness is a single comparison of two partial derivatives.

Finding F. Integrate MM with respect to xx, holding yy fixed, and add an unknown g(y)g(y) in place of the constant. Differentiate with respect to yy, set the result equal to NN, and solve for g′(y)g'(y).

Worked examples

Common mistakes

Practice problems

  1. Solve (2x+y) dx+(x+2y) dy=0(2x + y)\,dx + (x + 2y)\,dy = 0.

    Answer

    x2+xy+y2=Cx^2 + xy + y^2 = C

    Full solution

    My=1=NxM_y = 1 = N_x. F=x2+xy+g(y)F = x^2 + xy + g(y), and Fy=x+g′=x+2yF_y = x + g' = x + 2y gives g=y2g = y^2.

  2. Is y2 dx+xy dy=0y^2\,dx + xy\,dy = 0 exact?

    Answer

    No

    Full solution

    My=2yM_y = 2y but Nx=yN_x = y.

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

    Answer

    x3+xy+y3=Cx^3 + xy + y^3 = C

    Full solution

    My=1=NxM_y = 1 = N_x. F=x3+xy+g(y)F = x^3 + xy + g(y), and g′=3y2g' = 3y^2.

  4. Solve 2xy2 dx+2x2y dy=02xy^2\,dx + 2x^2y\,dy = 0 with y(1)=2y(1) = 2.

    Answer

    x2y2=4x^2y^2 = 4

    Full solution

    My=4xy=NxM_y = 4xy = N_x, and F=x2y2F = x^2y^2. At (1,2)(1, 2), F=4F = 4.

  5. Find kk so that (kxy+1) dx+(x2+y) dy=0(kxy + 1)\,dx + (x^2 + y)\,dy = 0 is exact.

    Answer

    k=2k = 2

    Full solution

    My=kxM_y = kx must equal Nx=2xN_x = 2x.

  6. Solve ey dx+(xey+2y) dy=0e^y\,dx + (xe^y + 2y)\,dy = 0.

    Answer

    xey+y2=Cxe^y + y^2 = C

    Full solution

    My=ey=NxM_y = e^y = N_x. F=xey+g(y)F = xe^y + g(y), and g′=2yg' = 2y.

  7. Solve (cos⁡x+y) dx+(x−sin⁡y) dy=0(\cos x + y)\,dx + (x - \sin y)\,dy = 0.

    Answer

    sin⁡x+xy+cos⁡y=C\sin x + xy + \cos y = C

    Full solution

    My=1=NxM_y = 1 = N_x. F=sin⁡x+xy+g(y)F = \sin x + xy + g(y), and g′=−sin⁡yg' = -\sin y gives g=cos⁡yg = \cos y.

  8. For Example 1, a student writes the answer x2y+3x=Cx^2y + 3x = C. What is missing?

    Answer

    The term 2y22y^2 from g(y)g(y)

    Full solution

    Check: ∂∂y(x2y+3x)=x2\tfrac{\partial}{\partial y}(x^2y + 3x) = x^2, not N=x2+4yN = x^2 + 4y. The missing 4y4y integrates to 2y22y^2.

Frequently asked questions

What is an exact differential equation?

An equation M dx + N dy = 0 for which there is a function F(x, y) with ∂F/∂x = M and ∂F/∂y = N. Its solutions are the curves F(x, y) = C.

How do you test for exactness?

Check whether ∂M/∂y = ∂N/∂x. If they agree (on a region with no holes), the equation is exact.

How do you find F?

Integrate M with respect to x, adding an unknown function g(y). Differentiate the result with respect to y, set it equal to N, and solve for g′(y).

What if the equation is not exact?

If (M_y − N_x)/N depends only on x, multiplying by μ(x) = e^∫(M_y − N_x)/N dx makes the equation exact.

Why is the solution written implicitly?

The level curve F(x, y) = C often cannot be solved for y. The implicit equation is the complete answer.

What to learn next