17Calculus - Exact Differential Equations and Integrating Factors

17Calculus

Exact differential equations are first-order differential equations of the form $$\displaystyle{ M(x,y)~dx + N(x,y)~dy = 0 }$$ where $$M_y = N_x$$. The requirement that $$M_y = N_x$$ means the differential equation is what we call exact.

classification: this technique applies to first-order differential equations

$$M(x,y)~dx + N(x,y)~dy = 0$$ and $$M_y = N_x$$

Here are some equivalent ways of writing this differential equation.

$$\displaystyle{ M(x,y)~dx + N(x,y)~dy = 0 }$$

$$\displaystyle{ M(x,y) + N(x,y)y' = 0 }$$

$$\displaystyle{ M(x,y) + N(x,y)\frac{dy}{dx} = 0 }$$

How To Solve

Let's go through an example, step-by-step to see how to solve these problems.

Example

Find the general solution to the exact differential equation $$2xydx + (x^2-3)dy = 0$$.
Solution - First, let's pull out M and N and make sure this equation is exact.

 M(x,y) is the coefficient of the $$dx$$, so $$M(x,y) = 2xy$$. N(x,y) is the coefficient of the $$dy$$, so $$N(x,y) = x^2-3$$. To check that this is exact, we need to find $$M_y$$ and $$N_x$$ and compare them. $$M_y = 2x$$ and $$N_x = 2x$$. Since they are equal, this equation is exact.

Now we calculate $$\int{M~dx} = \int{2xy~dx} = x^2 y + f(y)$$. Notice that rather than having a constant of integration, we have a constant FUNCTION of integration. This is because when we take the partial derivative of f(y) with respect to x, we get zero.
Now we do a similar integration on N, except with respect to y this time.
$$\int{N~dy} = \int{x^2-3~dy} = x^2 y - 3y + g(x)$$ Again we need a FUNCTION of integration, not just a constant.
Now we combine the results, being careful not to duplicate anything. Let's look at the first result of integration, i.e. $$x^2 y + f(y)$$. We will keep the $$x^2y$$ term. Now we look at the other result. Notice we have another $$x^2y$$ term, so we don't need that since we already have one. But we don't have $$-3y$$ yet, so we keep that to satisfy the $$f(y)$$ requirement in the first result.
So now we have $$x^2y - 3y$$ and, since we assume our solution in the form $$F(x,y)=K$$, we have $$x^2y-3y=K$$ as our final answer.

Here is a great video explaining the technique and showing a couple of examples.

Dr Chris Tisdell - exact equations [1hr-6mins-16secs]

video by Dr Chris Tisdell

In the video above, he does a good job of emphasizing that, before you start actually solving the differential equation, you need to make sure it is exact by calculating $$M_y$$ and $$N_x$$ and checking that they are equal. Otherwise, this technique will take you down a path that leads nowhere. Most instructors will take off points if you don't show work that you did this. So check with your instructor. But even if they don't take off points, it could save you a lot of time on homework and exams if you do this and it takes only a few seconds. So it is a good investment of your time.

The main difference with these types of problems is that you need to remember the constant of integration is actually a function of integration. This occurs because we are taking the partial integral of one variable while holding the other variable constant. This concept is covered in detail on the multi-variable partial integration page.

Here is another video that is very similar to the first one, with a few different examples. But watching this one also, will help you understand this technique better.

Dr Chris Tisdell - more exact equations [23mins-3secs]

video by Dr Chris Tisdell

Integrating Factors

If we have a first-order equation of the form $$M(x,y)~dx + N(x,y)~dy = 0$$ but $$M_y \neq N_x$$, i.e. the equation is not exact (also called inexact), we may be able to convert the equation to exact using integrating factors. You first came across integrating factors when you studied linear, first-order equations. This technique also uses an integrating factor but it is calculated differently.

There are actually two possible integrating factors that convert the differential equation to an exact equation.

 $$\displaystyle{ \mu_1 = \exp \int{ \frac{M_y - N_x}{N} dx } }$$ $$\displaystyle{ \mu_2 = \exp \int{ \frac{M_y - N_x}{-M} dy } }$$

The trick comes in when you are asked to evaluate these integrals. The evaluation is not always possible and can get quite messy. Also, one integral may yield an integrating factor that is quite complicated while the other one may be much easier to use.

Once we have an integrating factor, we multiply it into the entire differential equation. The result should be an exact equation. (Make sure to check that it is before you finish the problem.) You can then use the technique above to get a solution. Here are a couple of videos with an example.

In this first video, he starts an in-depth example where he calculates an integrating factor for a specific inexact equation. He finishes the example in the next video.

Khan Academy - Integrating Factors (1) [10mins-16secs]

Here is the completion of the example he starts in the previous video. He calculated an integrating factor in the above video and he finishes the problem, which is now exact, in this video.

Khan Academy - Integrating Factors (2) [8mins-25secs]

Okay, time for some practice problems.

Practice

Unless otherwise instructed, solve these differential equations. Make sure to check that the equation is exact before attempting to solve. If the equation is not exact, calculate an integrating factor and use it make the equation exact. If an initial condition is given, find the explicit solution also. Give your answers in exact form.

$$2xy~dx + (x^2+3y^2)~dy = 0$$

Problem Statement

$$2xy~dx + (x^2+3y^2)~dy = 0$$

Solution

Dr Chris Tisdell - 585 video solution

video by Dr Chris Tisdell

Log in to rate this practice problem and to see it's current rating.

$$2xy~dx + x^2~dy = 0$$

Problem Statement

$$2xy~dx + x^2~dy = 0$$

Solution

Dr Chris Tisdell - 587 video solution

video by Dr Chris Tisdell

Log in to rate this practice problem and to see it's current rating.

$$2xy~dx + (x^2-1)~dy = 0$$

Problem Statement

$$2xy~dx + (x^2-1)~dy = 0$$

$$x^2y - y = C$$

Problem Statement

$$2xy~dx + (x^2-1)~dy = 0$$

Solution

MIP4U - 597 video solution

video by MIP4U

$$x^2y - y = C$$

Log in to rate this practice problem and to see it's current rating.

$$[\cos(x)\sin(x)-xy^2]~dx + y(1-x^2)~dy = 0$$

Problem Statement

$$[\cos(x)\sin(x)-xy^2]~dx + y(1-x^2)~dy = 0$$

$$(1/2)[y^2(1-x^2) + sin^2(x)] = C$$

Problem Statement

$$[\cos(x)\sin(x)-xy^2]~dx + y(1-x^2)~dy = 0$$

Solution

MIP4U - 598 video solution

video by MIP4U

$$(1/2)[y^2(1-x^2) + sin^2(x)] = C$$

Log in to rate this practice problem and to see it's current rating.

$$(y\cos(x)+2xe^y) + (\sin(x)+x^2e^y-1)y' = 0$$

Problem Statement

$$(y\cos(x)+2xe^y) + (\sin(x)+x^2e^y-1)y' = 0$$

$$y\sin(x) + x^2e^y - y = C$$

Problem Statement

$$(y\cos(x)+2xe^y) + (\sin(x)+x^2e^y-1)y' = 0$$

Solution

PatrickJMT - 593 video solution

video by PatrickJMT

$$y\sin(x) + x^2e^y - y = C$$

Log in to rate this practice problem and to see it's current rating.

$$(2xy+1) + (x^2+3y^2)y' = 0$$

Problem Statement

$$(2xy+1) + (x^2+3y^2)y' = 0$$

Solution

Dr Chris Tisdell - 1845 video solution

video by Dr Chris Tisdell

Log in to rate this practice problem and to see it's current rating.

$$(e^{x+y}-2x)dx + (e^{x+y}+2y)dy = 0$$, $$y(0)=0$$

Problem Statement

$$(e^{x+y}-2x)dx + (e^{x+y}+2y)dy = 0$$, $$y(0)=0$$

$$1 = e^{x+y} - x^2 + y^2$$

Problem Statement

$$(e^{x+y}-2x)dx + (e^{x+y}+2y)dy = 0$$, $$y(0)=0$$

Solution

Krista King Math - 2086 video solution

video by Krista King Math

$$1 = e^{x+y} - x^2 + y^2$$

Log in to rate this practice problem and to see it's current rating.

$$xy^3dx + (x^2y^2+1)dy = 0$$

Problem Statement

Solve $$xy^3dx + (x^2y^2+1)dy = 0$$ using exact integrating factors, if necessary.

$$\displaystyle{ \frac{1}{2}x^2y^2 + \ln|y| = C }$$

Problem Statement

Solve $$xy^3dx + (x^2y^2+1)dy = 0$$ using exact integrating factors, if necessary.

Solution

He makes several mistakes in his solution and answer. First, when calculating the integrating factor, he needs $$dy$$ in the integral. Second, since we can't tell if $$y$$ is always positive, he needs absolute value signs on his natural log term.

Engineer4Free - 2206 video solution

video by Engineer4Free

$$\displaystyle{ \frac{1}{2}x^2y^2 + \ln|y| = C }$$

Log in to rate this practice problem and to see it's current rating.

$$2x + 3 + (2y-2)y' = 0$$

Problem Statement

$$2x + 3 + (2y-2)y' = 0$$

$$x^2 + 3x + y^2 - 2y = C$$

Problem Statement

$$2x + 3 + (2y-2)y' = 0$$

Solution

 $$2x + 3 + (2y-2)y' = 0$$ Rewrite in the form $$M~dx + N~dy = 0$$ $$(2x + 3)~dx + (2y-2)~dy = 0$$ $$M = 2x+3$$ and $$N = 2y-2$$ Now see if the equation is exact. $$M_y = 0$$ and $$N_x = 0$$ Since $$M_y = N_x$$, the equation is exact. Now calculate $$\int{M~dx}$$ and $$\int{N~dy}$$ $$\int{M~dx} = \int{ 2x+3 ~dx } = x^2+3x+f(y)$$ $$\int{N~dy} = \int{ 2y-2 ~dy } = y^2-2y+f(x)$$ Now combine the results. $$x^2+3x+y^2-2y = C$$

$$x^2 + 3x + y^2 - 2y = C$$

Log in to rate this practice problem and to see it's current rating.

$$(3x+y+1)~dx + (3y+x+1)~dy = 0$$

Problem Statement

$$(3x+y+1)~dx + (3y+x+1)~dy = 0$$

Solution

Dr Chris Tisdell - 586 video solution

video by Dr Chris Tisdell

Log in to rate this practice problem and to see it's current rating.

$$(2x+y+1)~dx + (2y+x+1)~dy = 0$$

Problem Statement

$$(2x+y+1)~dx + (2y+x+1)~dy = 0$$

Solution

Dr Chris Tisdell - 588 video solution

video by Dr Chris Tisdell

Log in to rate this practice problem and to see it's current rating.

$$\displaystyle{ (2xy^{-1}+2ye^{2x}-1) + (e^{2x}+y^2-x^2y^{-2})\frac{dy}{dx} = 0 }$$

Problem Statement

$$\displaystyle{ (2xy^{-1}+2ye^{2x}-1) + (e^{2x}+y^2-x^2y^{-2})\frac{dy}{dx} = 0 }$$

Solution

Krista King Math - 1822 video solution

video by Krista King Math

Log in to rate this practice problem and to see it's current rating.

$$(3x^2-2xy+2)~dx + (6y^2-x^2+3)~dy = 0$$

Problem Statement

$$(3x^2-2xy+2)~dx + (6y^2-x^2+3)~dy = 0$$

$$x^3 - x^2y + 2x + 2y^3 +3y = C$$

Problem Statement

$$(3x^2-2xy+2)~dx + (6y^2-x^2+3)~dy = 0$$

Solution

 $$(3x^2-2xy+2)~dx + (6y^2-x^2+3)~dy = 0$$ Check for exactness. $$M = 3x^2-2xy+2$$ and $$N = 6y^2-x^2+3$$ $$M_y = -2x$$ and $$N_x = -2x$$ Since $$M_y = N_x$$, the equation is exact. Now calculate $$\int{M~dx}$$ and $$\int{N~dy}$$ and combine the results. $$\int{M~dx} = \int{ 3x^2-2xy+2 ~dx } = x^3 -x^2y + 2x + f(y)$$ $$\int{N~dy} = \int{ 6y^2-x^2+3 ~dy } = 2y^3 - x^2y + 3y + f(x)$$ Combining results we get the final answer. $$x^3 - x^2y + 2x + 2y^3 +3y = C$$

$$x^3 - x^2y + 2x + 2y^3 +3y = C$$

Log in to rate this practice problem and to see it's current rating.

When using the material on this site, check with your instructor to see what they require. Their requirements come first, so make sure your notation and work follow their specifications.

DISCLAIMER - 17Calculus owners and contributors are not responsible for how the material, videos, practice problems, exams, links or anything on this site are used or how they affect the grades or projects of any individual or organization. We have worked, to the best of our ability, to ensure accurate and correct information on each page and solutions to practice problems and exams. However, we do not guarantee 100% accuracy. It is each individual's responsibility to verify correctness and to determine what different instructors and organizations expect. How each person chooses to use the material on this site is up to that person as well as the responsibility for how it impacts grades, projects and understanding of calculus, math or any other subject. In short, use this site wisely by questioning and verifying everything. If you see something that is incorrect, contact us right away so that we can correct it.