A Simple Way of Solving Exact Ordinary Differential Equations

Exact differential equations are interesting and easy to solve. But you wouldn’t know it from the way they’re taught in most textbooks. Many authors stumble through pages of algebra trying to explain the method, leaving students baffled.

Thankfully, there’s an easier way to understand exact differential equations. Years ago, I tried to come up with the simplest possible way of explaining the method. Here’s what I came up with.

The entire method of solving exact differential equations can be boiled down to the diagram below: “Exact ODEs in a Nutshell.”

Recall that exact ODEs are ones that we can write as M(x.y) + N(x,y)*y’ = 0, where M and N are continuous functions, and y’ is dy/dx. Here is how to read the diagram.

Starting with an exact ODE, we’re on the second line labeled “starting point.” We have functions M and N, and our goal is to move upward toward the top line labeled “goal.” That is, given an exact ODE, we want to find a solution F(x,y) = c whose first partial derivatives are Fx (which is just the function M) and Fy (which is the function N).

Before we do anything, we check that our equation is really exact. To do this, we move to the bottom line labeled “test for exactness.” That is, we take the derivative of Fx = M with respect to y (giving us Fxy = My). And we take the derivative of Fy = N with respect to x (which gives us Fyx = Nx). Set these equal to each other. A basic theorem from calculus says that the mixed partial derivatives Fxy and Fyx will be the same for any function F(x,y). If they’re equal, F(x,y) on the top line is guaranteed to exist.

Now we can solve for the function F(x.y). The diagram makes it easy to see how. We know M(x,y) is just the first partial derivative of F with respect to x. So we can move upward toward F(x,y) by integrating M with respect to x. Similarly, we know the function N(x,y) is just the first partial derivative of F(x,y) with respect to y, so we can find another candidate for F by integrating N with respect to y.

In the end, we’ll have two candidates for F(x,y). Sometimes they’re the same, in which case we’re done. Sometimes they’re different, as one will have a term the other won’t have — a term that got dropped to zero as we differentiated from F(x,y) to either Fx or Fy, since it’s a function of only one of x or y. This is easy to solve: just combine all the terms from both candidates for F(x,y), omitting any duplicate terms. This will be our solution F(x,y) = c.

Try using this method on a few examples here. I think you’ll find it’s much simpler — and easier to remember years later — than the round-about method used in most textbooks.