Exact Differential Equations

Consider the equation

        f(x,y)  =  C

Taking the gradient we get

        fx(x,y)i + fy(x,y)j  =  0

We can write this equation in differential form as 

        fx(x,y)dx+ fy(x,y)dy  =  0

Now divide by dx (we are not pretending to be rigorous here) to get

        fx(x,y)+ fy(x,y) dy/dx  =  0

Which is a first order differential equation. The goal of this section is to go backward.  That is if a differential equation if of the form above, we seek the original function f(x,y) (called a potential function).  A differential equation with a potential function is called exact.  If you have had vector calculus, this is the same as finding the potential functions and using the fundamental theorem of line integrals.

Example

Solve

        4xy + 1 + (2x2 + cos y)y'  =  0

Solution

We seek a function f(x,y)  with 

        fx(x,y)  =  4xy + 1    and     fy(x,y)  =  2x2 + cos y

Integrate the first equation with respect to x to get

        f(x,y)  =  2x2y + x + C(y)    Notice since y is treated as a constant,. we write C(y).

Now take the partial derivative with respect to y to get

        fy(x,y)  =  2x2 + C'(y)

We have two formulae for fy(x,y) so we can set them equal to eachother.

          2x2 + cos y  =  2x2 + C'(y)

That is 

        C'(y)  =  cos y

or

        C(y)  =  sin y

Hence 

         f(x,y)  =  2x2y + x + sin y

The solution to the differential equation is

        2x2y + x + sin y  =  C


Does this method always work?  The answer is no.  We can tell if the method works by remembering that for a function with continuous partial derivatives, the mixed partials are order independent.  That is 

        fxy  =  fyx

If we have the differential equation

        M(x,y) + N(x,y)y'  =  0

then we say it is an exact differential equation if 

        My(x,y)  =  Nx(x,y)

Theorem:  Solutions to Exact Differential Equations

Let M, N, My, and Nx be continuous with

          My  =  Nx

Then there is a function f with 

          fx  =  M          and          fy  =  N

such that 

          f(x,y)  =  C

is a solution to the differential equation 

          M(x,y)  + N(x,y)y'  =  0

Example

Solve the differential equation 

        y + (2xy - e-2y)y'  =  0

Solution

We have 

        M(x,y)  =  y    and    N(x,y)  =  2xy - e-2y

Now calculate 

        My  =  1    and    Nx  =  2y

Since they are not equal, finding a potential function f is hopeless.  However there is a glimmer of hope if we remember how we solved first order linear differential equations.  We multiplied both sides by an integrating factor m.  We do that here to get

        mM + mNy'  =  0

For this to be exact we must have 

        (mM)y  =   (mN)x  

Using the product rule gives

        myM + mMy  =   mxN + mNx 

We now have a new differential equation that is unfortunately more difficult to solve than the original differential equation.  We simplify the equation by assuming that either m is a function of only x or only y.  If it is a function of only x, then my  =  0 and 

        mMy  =   mxN + mNx         

Solving for mx, we get

                    My - Nx
   
     mx  =                      
                         N

If this is a function of y only, then we will be able to find an integrating factor that involves y only.

If it is a function of only y, then mx  =  0 and 

        myM + mMy  =  mNx         

Solving for my, we get

                    Nx - My
   
     my  =                      m
                         M

If this is a function of y only, then we will be able to find an integrating factor that involves y only.

For our example

                    Nx - My                  2y - 1
   
     my  =                      m  =                       m  =  (2 - 1/y)m   
                         M                          y 

Separating gives

        dm/m  =  (2 - 1/y) dy

Integrating gives

        ln m  =  2y  -  ln y

        m  =  e2y - ln y  =  y -1e2y

Multiplying both sides of the original differential equation by m gives

        y(y -1e2y) + (y -1e2y)(2xy - e-2y)y'  =  0

        e2y + (2xe2y - 1/y)y'  =  0

Now we see that 

        My  =  2e2y  =    Nx  

Which tells us that the differential equation is exact.  We therefore have

        fx (x,y)  =  e2y 

Integrating with respect to x gives

        f(x,y)  =  xe2y + C(y)

Now taking the partial derivative with respect to y gives

        fy(x,y)  =  2xe2y + C'(y)  =  2xe2y - 1/y

So that 

        C'(y)  =  1/y

Integrating gives

        C(y)  =  ln y

The final solution is 

        xe2y + ln y  =  0

        

 


Back to the First Order Differential Equations Home Page

Back to the Differential Equations Home Page

Back to the Math Department Home Page

e-mail Questions and Suggestions