The Ultimate Guide to Solving Almost Exact Differential Equations Step by Step

The Ultimate Guide to Solving Almost Exact Differential Equations Step by Step

Differential equations come in many forms, and while exact differential equations can often be solved using a straightforward procedure, not every equation satisfies the exactness condition. This is where solving almost exact differential equations step by step becomes an important skill. Many first-order differential equations can be made exact with the help of an integrating factor.

In this guide, you will learn how to identify almost exact differential equations, understand the role of integrating factors, and apply a step-by-step procedure for solving them. We will begin by reviewing the concept of exact differential equations and examining what makes an equation almost exact. Next, we will discuss integrating factors and the conditions that help determine whether an integrating factor depends on \( x \) or \( y \). Finally, we will work through a couple of examples that demonstrate the complete solution process from start to finish.

By the end of this article, you will have a framework for recognizing and solving almost exact differential equations.

What Are Almost Exact Differential Equations?

Before discussing almost exact differential equations, it is helpful to review the concept of exact differential equations. If you have not already done so, you may want to read the article How to Solve Exact Differential Equations: A Beginner-Friendly Tutorial with Worked Examples, where we introduce the exactness condition and the solution procedure for exact equations. You may also find the article A Step-by-Step Tutorial on Linear Differential Equations with Examples and Solutions useful, because integrating factors are used to transform almost exact equations into exact equations.

Definition

Not every differential equation of the form

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

satisfies the exactness condition. In many cases,

$$M_y \neq N_x.$$

When this happens, the equation is not exact. However, some of these equations can be transformed into exact equations by multiplying both sides by an integrating factor. These equations are commonly referred to as almost exact differential equations.

Integrating Factors for Almost Exact Differential Equations

Once we determine that a differential equation is not exact, the next step is to investigate whether an integrating factor can transform it into an exact equation. Finding an integrating factor requires computing partial derivatives and evaluating an integral. If you would like a refresher on these topics, you may find the articles The Ultimate Beginner’s Guide to Partial Derivatives with Step-by-Step Examples and Basic Integration Problems for Beginners helpful.

Suppose we have a differential equation written in the form

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

If the equation is not exact, we seek a function \( \mu(x,y) \) such that

$$\mu Mdx + \mu Ndy = 0$$

is exact.

The function \( \mu \) is called the integrating factor.

Once the integrating factor has been found, the transformed equation can be solved using the exact procedure used for exact differential equations. In many applications, finding the integrating factor is the most challenging part of the problem. Fortunately, there are several common cases where the integrating factor can be found.

Integrating Factors That Depend Only on \( x \)

One of the simplest situations occurs when the integrating factor depends only on the variable \( x \).

Assume that

$$\mu = \mu(x).$$

If the expression

$$\frac{M_y – N_x}{N},$$

depends only on \( x \), then an integrating factor exists and is given by

$$\mu(x) = e^{\int \frac{M_y – N_x}{N} dx}.$$

After computing \( \mu(x) \), we multiply the entire differential equation by this factor and verify that the resulting equation is exact.

Integrating Factors That Depend Only on \( y \)

Another one of the simplest situations occurs when the integrating factor depends only on the variable \( y \).

Assume that

$$\mu = \mu(y).$$

If the expression

$$\frac{N_x – M_y}{M},$$

depends only on \( y \), then an integrating factor exists and is given by

$$\mu(y) = e^{\int \frac{N_x – M_y}{M} dx}.$$

After computing \( \mu(y) \), we multiply the entire differential equation by this factor and verify that the resulting equation is exact.

Steps to Solve Almost Exact Differential Equations

Now that we understand what almost exact differential equations are and how integrating factors work, we can combine these ideas into a systematic solution process. While individual problems may vary, the overall strategy remains the same: determine whether the equation is exact, find an appropriate integrating factor if necessary, transform the equation into an exact equation, and then solve it using the method for exact equations.

Step 1: Write the Differential Equation in Standard Form

Begin by writing the differential equation in the form

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

Step 2: Test for Exactness

If

$$M_y = N_x,$$

Then the equation is exact and can be solved immediately using the procedure for exact differential equations.

If the derivatives are not equal, continue to the next step.

Step 3: Check for an Integrating Factor Depending on \( x \)

Compute

$$\frac{M_y – N_x}{N}.$$

If this expression simplifies to a function depending only on \( x \), then the integrating factor is

$$\mu(x) = e^{\int \frac{M_y – N_x}{N} dx}.$$

If the expression does not depend only on \( x \), proceed to the next step, otherwise proceed to step 5.

Step 4: Check for an Integrating Factor Depending on \( y \)

Compute

$$\frac{N_x – M_y}{M}.$$

If this expression simplifies to a function depending only on \( y \), then the integrating factor is

$$\mu(y) = e^{\frac{N_x – M_y}{M} dy}.$$

Step 5: Multiply the Entire Equation by the Integrating Factor

Once the integrating factor has been found, multiply every term in the differential equation by it.

Step 6: Solve the Resulting Exact Differential Equation

Since the equation is now exact, potential functions can be used.

Step 7: Apply the Initial Condition (If Given)

If an initial condition is provided, substitute it into the general solution to determine the constant C

Worked Out Examples

The best way to learn how to solve almost exact differential equations is to work through several examples. In each example, we will begin by testing for exactness, determine an appropriate integrating factor, transform the equation into an exact differential equation, and then find the solution.

The examples require the techniques covered in the articles The Ultimate Step by Step Guide to Solving Integrals Using Substitution and .A Step-by-Step Beginner’s Tutorial for Double and Triple Integrals in Calculus.

Example 1: Solve the differential equations:
(a) \( y dx + x(x+1) dy = 0 \)
(b) $$y(x – y) dx + (x^2 – 3xy) dy = 0.$$

Solution: (a) \( y dx + x(x + 1)dy = 0 \).

The equation is already in standard form. We have

$$M(x,y) = y$$

and

$$N(x,y) = x(x + 1).$$

We now show that

$$(y)_y \neq (x(x + 1))_x.$$

Distributing gives

$$(y)_y \neq (x^2 + x)_x.$$

Using the sum rule, we find

$$(y)_y \neq (x^2)_x + (x)_x.$$

Taking the partial derivatives, we get

$$1 \neq 2x + 1.$$

Thus, the differential equation is not exact. We now compute

$$\frac{1 – (2x + 1)}{x(x + 1)}.$$

Subtracting we obtain

$$\frac{-2x}{x(x + 1)}.$$

Dividing then gives

$$-\frac{2}{x + 1}.$$

Thus, the integrating factor is

$$\mu(x) = e^{\int -\frac{2}{x + 1} dx}.$$

Integrating we get

$$\mu(x) = e^{-2\ln|x + 1|}.$$

Using exponential properties, this is

$$\mu(x) = e^{\ln|x + 1|^{-2}}.$$

This simplifies to

$$\mu(x) = |x + 1|^{-2}.$$

Using exponential properties again, we obtain

$$\mu(x) = \frac{1}{|x + 1|^2}.$$

Dropping the absolute value bars, we get

$$\mu(x) = \frac{1}{(x + 1)^2}.$$

Multiplying each term of the equation by the integrating factor, we obtain

$$\frac{y}{(x + 1)^2} dx + \frac{x}{x + 1} dy = 0.$$

We now have

$$M(x,y) = \frac{y}{(x + 1)^2}$$

and

$$N(x,y) = \frac{x}{x + 1}.$$

We now show that

$$(\frac{y}{(x + 1)^2})_y = (\frac{x}{x + 1})_x.$$

Using the quotient rule, we find

$$(\frac{y}{(x + 1)^2})_y = \frac{(x)_x(x + 1) – x(x + 1)_x}{(x + 1)^2}.$$

Taking the partial derivatives, we get

$$\frac{1}{(x + 1)^2} = \frac{(x + 1) – x}{(x + 1)^2}.$$

Subtracting we obtain

$$\frac{1}{(x + 1)^2} = \frac{1}{(x + 1)^2}.$$

Thus, the differential equation is now exact. We now find the potential function. Integrating N with respect to y gives

$$\int N dy = \int \frac{x}{x + 1} dy.$$

Therefore

$$\psi = \frac{xy}{x + 1} + h(x).$$

Differentiating both sides with respect to x, then gives

$$\psi_x = (\frac{xy}{x + 1} + h(x))_x.$$

Using the sum rule, we find

$$\psi_x = (\frac{xy}{x + 1})_x + (h(x))_x.$$

Using the quotient rule gives

$$\psi_x = \frac{(xy)_x(x + 1) – xy(x + 1)_x}{(x + 1)^2} + (h(x))_x.$$

Taking the partial derivatives, we get

$$M = \frac{y(x + 1) – xy}{(x + 1)^2} + h'(x).$$

Distributing this is

$$M = \frac{xy + y – xy}{(x + 1)^2} + h'(x).$$

Subtracting we obtain

$$M = \frac{y}{(x + 1)^2} + h'(x).$$

Substituting in for M, we find

$$\frac{y}{(x + 1)^2} = \frac{y}{(x + 1)^2} + h'(x).$$

Which implies

$$0 = h'(x).$$

Integrating both sides with respect to x gives

$$\int 0 dx = \int h'(x) dx.$$

Therefore

$$C = h(x).$$

The potential function is then

$$\psi = \frac{xy}{x + 1}.$$

Our solution is then

$$\frac{xy}{x + 1} = C.$$

Multiplying both sides by \( x + 1 \), this is

$$xy = C(x+1).$$

Distributing give

$$xy = Cx + C.$$

Our final solution is then

$$y = C + \frac{C}{x}.$$

(b) $$y(x – y) dx + (x^2 – 3xy) dy = 0.$$

The equation is already in standard form. We have

$$M(x,y) = y(x – y)$$

and

$$N(x,y) = x^2 – 3xy.$$

We now show that

$$(y(x – y))_y \neq (x^2 – 3xy)_x.$$

Distributing gives

$$(xy – y^2)_y \neq (x^2 – 3xy)_x.$$

Using the sum rule, we find

$$(xy)_y – (y^2)_y \neq (x^2)_x – (3xy)_x.$$

Taking the partial derivatives, we get

$$x – 2y \neq 2x – 3y.$$

Thus, the differential equation is not exact. We now compute

$$\frac{2x – 3y – (x – 2y)}{y(x – y)}.$$

Subtracting we obtain

$$\frac{x – y}{y(x – y)}.$$

Dividing then gives

$$\frac{1}{y}.$$

Thus, the integrating factor is

$$\mu(y) = e^{\int \frac{1}{y} dy}.$$

Integrating we get

$$\mu(y) = e^{\ln|y|}.$$

This simplifies to

$$\mu(y) = |y|.$$

Dropping the absolute value bars, we get

$$\mu(y) = y.$$

Multiplying each term of the equation by the integrating factor, we obtain

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

We now have

$$M(x,y) = y^2(x – y)$$

and

$$N(x,y) = y(x^2 – 3xy).$$

We now show that

$$(y^2(x – y))_y = (y(x^2 – 3xy))_x.$$

Distributing, we find

$$(xy^2 – y^3)_y = (x^2y – 3xy^2)_x.$$

Using the sum rule, we find

$$(xy^2)_y – (y^3)_y = (x^2y)_x – (3xy^2)_x.$$

Taking the partial derivatives, we get

$$2xy – 3y^2 = 2xy – 3y^2.$$

Thus, the differential equation is now exact. We now find the potential function. Integrating M with respect to x gives

$$\int M dx = \int y^2(x – y) dx.$$

Distributing this is

$$\int M dx = \int xy^2 – y^3 dx.$$

Therefore

$$\psi = \frac{1}{2}x^2y^2 – xy^3 + g(y).$$

Differentiating both sides with respect to y, then gives

$$\psi_y = (\frac{1}{2}x^2y^2 – xy^3 + g(y))_y.$$

Using the sum rule, we find

$$\psi_y = (\frac{1}{2}x^2y^2)_y – (xy^3)_y + (g(y))_y.$$

Taking the partial derivatives, we get

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

Substituting in for N, we find

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

Distributing this is

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

Which implies

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

Integrating both sides with respect to y gives

$$\int 0 dy = \int h'(y) dy.$$

Therefore

$$C = g(y).$$

The potential function is then

$$\psi = \frac{1}{2}x^2y^2 – xy^3.$$

Our final solution is then

$$\frac{1}{2}x^2y^2 – xy^3 = C.$$

Conclusion

Almost exact differential equations do not immediately satisfy the exactness condition. However, these equations can often be transformed into exact differential equations using integrating factors. Once the transformation has been made, potential functions can be used to find the solution.

Throughout this guide, we reviewed the definition of almost exact differential equations, discussed the role of integrating factors, outlined a step-by-step solution process, and worked through examples illustrating the technique.

Solving almost exact differential equations step by step is an important skill, and with consistent practice and careful attention to each step, you will be able to recognize and solve almost exact differential equations.

Further Reading

A Step-by-Step Tutorial on Linear Differential Equations with Examples and Solutions  â€“ Like almost exact differential equations, linear differential equations are also solved using integrating factors.

Frequently Asked Questions

Yes. However, not every almost exact equation has an integrating factor that is easy to find.