4. Exact Equations and Substitutions

Exact Equations

Exact Equations

students, imagine trying to solve a maze by following a map instead of guessing every turn 🧭. That is what exact equations do in differential equations: they give us a built-in path to the answer. In this lesson, you will learn what makes a differential equation exact, how to test whether it is exact, and how to solve it using a potential function. These ideas are important because they connect directly to the larger topic of Exact Equations and Substitutions, including methods like homogeneous substitutions and the broader idea of checking whether a solution is guaranteed to exist and be unique.

What an exact equation means

Many first-order differential equations can be written in the form

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

Here, $M$ and $N$ are functions of $x$ and $y$. The equation is called exact if there is some function $F(x,y)$ such that

$$\frac{\partial F}{\partial x}=M(x,y) \quad \text{and} \quad \frac{\partial F}{\partial y}=N(x,y).$$

If such a function exists, then the differential equation is really the same as

$$dF=0,$$

which means the solution satisfies

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

where $C$ is a constant.

Why is this useful? Because instead of solving for $y$ directly, we can find a function $F(x,y)$ whose level curves describe the solutions. Think of it like elevation lines on a map ⛰️. Each solution is a contour line, and the constant $C$ tells you which contour you are on.

A key idea is that exact equations come from a function already hiding inside the equation. Your job is to uncover it.

How to test whether an equation is exact

Suppose you are given

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

A quick test for exactness is to compute the partial derivatives

$$\frac{\partial M}{\partial y} \quad \text{and} \quad \frac{\partial N}{\partial x}.$$

If these are equal on a suitable region, then the equation is exact:

$$\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}.$$

This works because if $M=\frac{\partial F}{\partial x}$ and $N=\frac{\partial F}{\partial y}$, then mixed partial derivatives agree under the usual smoothness conditions:

$$\frac{\partial^2 F}{\partial y\partial x}=\frac{\partial^2 F}{\partial x\partial y}.$$

That equality is the mathematical reason behind the exactness test.

Example 1: A simple exact equation

Consider

$$\left(2xy+y^2\right)dx+\left(x^2+2xy\right)dy=0.$$

Here,

$$M(x,y)=2xy+y^2, \quad N(x,y)=x^2+2xy.$$

Now check exactness:

$$\frac{\partial M}{\partial y}=2x+2y, \quad \frac{\partial N}{\partial x}=2x+2y.$$

Since these are equal, the equation is exact βœ….

How to solve an exact equation

Once you know an equation is exact, the goal is to find the function $F(x,y)$ such that

$$dF=M\,dx+N\,dy.$$

Then the solution is simply

$$F(x,y)=C.$$

There are two common ways to build $F$.

Method 1: Integrate $M$ with respect to $x$

Start by integrating $M(x,y)$ with respect to $x$, treating $y$ as a constant:

$$F(x,y)=\int M(x,y)\,dx+g(y),$$

where $g(y)$ is an unknown function of $y$. Why do we add $g(y)$? Because when you differentiate $F$ with respect to $x$, anything depending only on $y$ disappears.

Then differentiate this $F$ with respect to $y$ and match it to $N(x,y)$ to find $g(y)$.

Solve Example 1

We have

$$M(x,y)=2xy+y^2.$$

Integrate with respect to $x$:

$$F(x,y)=\int \left(2xy+y^2\right)dx=x^2y+xy^2+g(y).$$

Now differentiate with respect to $y$:

$$\frac{\partial F}{\partial y}=x^2+2xy+g'(y).$$

Set this equal to $N(x,y)$:

$$x^2+2xy+g'(y)=x^2+2xy.$$

So

$$g'(y)=0,$$

which means $g(y)$ is a constant. Therefore the implicit solution is

$$x^2y+xy^2=C.$$

That is the general solution 🌟.

Method 2: Integrate $N$ with respect to $y$

You can also start with

$$F(x,y)=\int N(x,y)\,dy+h(x),$$

where $h(x)$ is an unknown function of $x$. Then differentiate with respect to $x$ and match to $M(x,y)$.

Either method works. Choose the one that looks easier.

Why exact equations matter in the bigger topic

Exact equations are not just a standalone trick. They are part of a larger toolkit for first-order differential equations.

Connection to substitutions

Some equations are not exact at first, but become solvable after a substitution. In the topic Exact Equations and Substitutions, a major goal is to recognize structure. For example, a homogeneous substitution like

$$y=vx$$

or

$$x=vy$$

can turn an equation into one that is easier to solve. Although that is a different method, it shares the same big idea: look for a pattern that makes the equation simpler.

Connection to existence and uniqueness

The exactness test does not by itself tell you whether a solution exists or is unique in the broader theoretical sense. However, when the functions $M$ and $N$ have continuous partial derivatives in a region, exactness is well-behaved and the potential function $F$ can be built locally. In differential equations more generally, existence and uniqueness theorems help explain when an initial value problem has one and only one solution passing through a point. That gives confidence that the solution curve you find is not just one of many random possibilities.

So exact equations fit into the larger course theme by showing how structure, smoothness, and substitution can turn a hard equation into a manageable one.

A second example with a full solution

Let’s solve

$$\left(y\cos x+2x\right)dx+\left(\sin x+2y\right)dy=0.$$

First identify

$$M(x,y)=y\cos x+2x, \quad N(x,y)=\sin x+2y.$$

Check exactness:

$$\frac{\partial M}{\partial y}=\cos x, \quad \frac{\partial N}{\partial x}=\cos x.$$

So the equation is exact.

Now integrate $M$ with respect to $x$:

$$F(x,y)=\int \left(y\cos x+2x\right)dx=y\sin x+x^2+g(y).$$

Differentiate with respect to $y$:

$$\frac{\partial F}{\partial y}=\sin x+g'(y).$$

Match this to $N(x,y)$:

$$\sin x+g'(y)=\sin x+2y.$$

Therefore

$$g'(y)=2y,$$

so

$$g(y)=y^2.$$

Thus the implicit solution is

$$y\sin x+x^2+y^2=C.$$

This final equation describes a family of solution curves. If you were given an initial condition, such as a point $(x_0,y_0)$, you could plug it in to find the specific constant $C$.

Common mistakes to avoid

Exact equations are straightforward once the idea clicks, but students often make a few predictable mistakes πŸ˜….

Mistake 1: Forgetting the test

Not every equation of the form $M\,dx+N\,dy=0$ is exact. Always check

$$\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}.$$

Mistake 2: Losing the extra function

When integrating $M$ with respect to $x$, remember the extra function $g(y)$:

$$F(x,y)=\int M(x,y)\,dx+g(y).$$

When integrating $N$ with respect to $y$, remember the extra function $h(x)$:

$$F(x,y)=\int N(x,y)\,dy+h(x).$$

Mistake 3: Mixing up partial derivatives

When differentiating with respect to $x$, treat $y$ as constant. When differentiating with respect to $y$, treat $x$ as constant. This is essential for matching terms correctly.

Mistake 4: Stopping before the final constant form

The final answer should usually be an implicit solution like

$$F(x,y)=C.$$

That constant form is the correct way to write the family of solutions.

Conclusion

Exact equations give a powerful way to solve first-order differential equations by recognizing when the left-hand side is the differential of a hidden function. The central test is simple:

$$\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}.$$

If the equation is exact, you can build a potential function $F(x,y)$ and write the solution as

$$F(x,y)=C.$$

students, this method matters because it connects algebra, derivatives, and geometry in one clean idea. It also fits naturally into the broader topic of Exact Equations and Substitutions, where the goal is to reshape a difficult equation into one that can be solved systematically. With practice, exact equations become a reliable tool instead of a puzzle.

Study Notes

  • An equation of the form $M(x,y)\,dx+N(x,y)\,dy=0$ is exact if there exists a function $F(x,y)$ such that $\frac{\partial F}{\partial x}=M$ and $\frac{\partial F}{\partial y}=N$.
  • The exactness test is

$$\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}.$$

  • If the equation is exact, solve it by finding a potential function $F(x,y)$.
  • One method is

$$F(x,y)=\int M(x,y)\,dx+g(y).$$

  • Another method is

$$F(x,y)=\int N(x,y)\,dy+h(x).$$

  • The final solution is usually written as

$$F(x,y)=C.$$

  • Exact equations are part of the larger topic Exact Equations and Substitutions.
  • Homogeneous substitutions and exact equations are different methods, but both look for structure that simplifies a differential equation.
  • Continuous partial derivatives help ensure the exactness test works properly in standard cases.
  • Always treat the other variable as constant when taking a partial derivative or doing a partial integration step.

Practice Quiz

5 questions to test your understanding

Exact Equations β€” Differential Equations | A-Warded