# Integrating Factor – Definition, Method, and Examples

The integrating factor method allows us to work on ordinary differential equations that are more complex than exact equations. Since there is no guarantee that the first-order differential equation that we’re dealing with is an exact equation, it’s important that we learn supplementary methods such as utilizing integrating factors.

The integrating factor represents the factor that we multiply on both sides of the differential equation to make a non-exact DE into an exact equation. Once we have the integrating factor, we can use previous methods to solve the new exact equation.

This article covers the fundamentals of integrating factors including its definition, conditions, and formula. We’ll also show you how to find integrating factors from differential equations and how to use utilize this method when solving non-exact differential equations.

This discussion will require an understanding of the exact equation, so make sure you have your notes handy or are familiar with the process of solving exact equations. For now, we’ll begin slowly – doing a quick recap on an equation’s exactness then diving into the definition of integrating factor and the method itself.

## What Is an Integrating Factor?

An integrating factor is a function that we use to solve differential equations that are not exact equations. Suppose that we have $P(x, y)$ and $Q(x, y)$ forming the differential equation written in the form shown below.

\begin{aligned}P(x, y) \phantom{x}dx + Q(x, y) \phantom{x}dy = 0 \end{aligned}

We’ve learned how separable equations like the ones shown above can be solved by separating terms based on their variables. In the past, we’ve established how to identify differential equations based on their “exactness”.

 Exact \begin{aligned}\dfrac{\partial P}{\partial y} = \dfrac{\partial Q}{\partial x}  \end{aligned} Not Exact \begin{aligned}\dfrac{\partial P}{\partial y} \neq \dfrac{\partial Q}{\partial x}  \end{aligned}

We’ve learned about solving differential equations that are in their exact forms, so it’s time that we know how to deal with differential equations that are not exact. One of the most commonly used approaches is the use of integrating factors. This method uses a factor that is multiplied on both sides of the differential equation to make the differential equation exact.

\begin{aligned}\mu (x, y)P(x, y) \phantom{x}dx +\mu (x, y) Q(x, y) \phantom{x}dy = 0 \end{aligned}

The factor, $\mu (x, y)$, is what we call the integrating factor of the differential equation. Once we’ve rewritten the equation into an exact equation, we can then apply the appropriate steps to solve the resulting differential equation.

### Integrating factor formula

Let’s now establish the integrating factor’s general expression given a differential equation, $P(x, y) \phantom{x}dx + Q(x, y) \phantom{x}dy = 0$. The goal of this method is to rewrite the equation so that it has an exact form.

\begin{aligned}\mu (x, y)P(x, y) \phantom{x}dx +\mu (x, y) Q(x, y) \phantom{x}dy = 0 \end{aligned}

If we want this to be an exact equation, the partial derivatives of the expression must also satisfy the condition we’ve established for exact equations.

\begin{aligned}\dfrac{\partial}{\partial y} [\mu (x, y)P(x, y)] = \dfrac{\partial}{\partial x}[ \mu (x, y) Q(x, y)]\end{aligned}

Apply the product rule for derivatives and rearrange the equation as shown below.

\begin{aligned}P\dfrac{\partial \mu}{\partial y} + \mu\dfrac{\partial P}{\partial y} &= Q\dfrac{\partial \mu}{\partial x} + \mu\dfrac{\partial Q}{\partial x}\\P\dfrac{\partial \mu}{\partial y} -Q\dfrac{\partial \mu}{\partial y}&= \mu \left(\dfrac{\partial Q}{\partial x} – \dfrac{\partial P}{\partial y}\right ) \end{aligned}

The expression for the integrating factor will depend on whether $\mu$ depends on $x$ or $y$. When $\mu$ is defined by $x$, we’ll be isolating $\dfrac{\partial \mu}{\partial x}$ and when $\mu$ is dependent on $y$, we isolate $\dfrac{\partial \mu}{\partial y}$ instead. Here are the two possible outcomes on how the differential equation reduces to- accounting for both $\mu(x)$ and $\mu(y)$:

 \begin{aligned}\boldsymbol{\dfrac{\partial \mu}{\partial x}}\end{aligned} \begin{aligned}\boldsymbol{\dfrac{\partial \mu}{\partial y}}\end{aligned} \begin{aligned}-Q\dfrac{\partial \mu}{\partial x}&= \mu \left(\dfrac{\partial Q}{\partial x} – \dfrac{\partial P}{\partial y}\right )\\\dfrac{\partial \mu}{\partial x}&= \dfrac{\mu \left(\dfrac{\partial Q}{\partial x} – \dfrac{\partial P}{\partial y}\right )}{-Q}\\\dfrac{\partial \mu}{\partial x}&= \dfrac{\mu \left(\dfrac{\partial P}{\partial y} -\dfrac{\partial Q}{\partial x}\right )}{Q} \end{aligned} \begin{aligned}P\dfrac{\partial \mu}{\partial y} &= \mu \left(\dfrac{\partial Q}{\partial x} – \dfrac{\partial P}{\partial y}\right ) \\\dfrac{\partial \mu}{\partial y} &= \dfrac{\mu \left(\dfrac{\partial Q}{\partial x} – \dfrac{\partial P}{\partial y}\right )}{P} \end{aligned}

Integrate each of the equation and we’ll have the two forms of the integrating factors.

 \begin{aligned}\boldsymbol{\mu(x)}\end{aligned} \begin{aligned}\boldsymbol{\mu(y)}\end{aligned} \begin{aligned}\mu&= \text{exp}\left[\int\dfrac{ \left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]\end{aligned} \begin{aligned}\mu&= \text{exp} \left[\int\dfrac{ \left(\partial Q/\partial x – \partial P/\partial y\right )}{P} \phantom{x}dy \right ] \end{aligned}

Hence, we’ve established the general expression for integrating factors. Why don’t we summarize the integrating factor’s formula?

 INTEGRATING FACTOR FORMULAIf we have a first-order differential equation, $P(x, y) \phantom{x}dx + Q(x, y) \phantom{x}dy = 0$, we can make it an exact equation by multiplying both sides by $\mu$. We call this the integrating factor is defined by a single variable (either $x$ or $y$).\begin{aligned}\textbf{Defined by }\boldsymbol{x} &: \mu= \text{exp}\left[\int\dfrac{\left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]\\\textbf{Defined by }\boldsymbol{y} &: \mu= \text{exp} \left[\int\dfrac{\left(\partial Q/\partial x – \partial P/\partial y\right )}{P} \phantom{x}dy \right ]\end{aligned}

There are instances when the integrating factor is defined by more than one variable, but for now, we’ll limit our discussion to $\mu$ defined by one variable. In the next sections, we’ll show you how to find expression for $\mu$ and how to eventually solve differential equations using the method of integrating factors.

## How To Find the Integrating Factor?

Use the formula for integrating factors to find the expression for $\mu$ – we want the integrating factor to be defined by one variable. Here is a guideline to keep in mind when finding the right integrating factor for your differential equation:

• Identify the expressions for $P(x, y)$ and $Q(x, y)$ given our differential equation.
• Take the partial derivative of $P$ with respect to $x$ and the partial derivative of $Q$ with respect to $y$.
• Use either of the two formulas and select the one that reduced the expression in terms of one variable.
 \begin{aligned}\boldsymbol{\mu(x)}\end{aligned} \begin{aligned}\boldsymbol{\mu(y)}\end{aligned} \begin{aligned}\mu&= \text{exp}\left[\int\dfrac{ \left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]\end{aligned} \begin{aligned}\mu&= \text{exp} \left[\int\dfrac{ \left(\partial Q/\partial x – \partial P/\partial y\right )}{P} \phantom{x}dy \right ] \end{aligned}

Use either of the two formulas and select the one that reduces the expression in terms of one variable.

Let’s work on the differential equation, $(2x^2+ y) \phantom{x}dx + (x^2y – x)\phantom{x}dy = 0$, and try to find its integrating factor. From the equation, we have $P(x, y) = 2x^2 + y$ and $Q(x, y) = x^2y – x$. Now, take the partial derivatives of $P$ and $Q$ with respect to $y$ and $x$, respectively.

 \begin{aligned}\boldsymbol{\dfrac{\partial \mu}{\partial y}} &: \dfrac{\partial}{\partial y}(2x^2 + y)\\&= 1\end{aligned} \begin{aligned}\boldsymbol{\dfrac{\partial \mu}{\partial x}} &: \dfrac{\partial}{\partial x}(x^2y – x)\\&= 2xy – 1\end{aligned}

From the partial derivatives alone, we can see that the equation is not exact. This also shows us that the equation is not exact, so the integrating factor will definitely come in handy if we want to solve the differential equation. Let us show you the expressions for $\mu(x)$ and $\mu(y)$ first before choosing the best option for our equation.

 \begin{aligned}\boldsymbol{\mu(x)}\end{aligned} \begin{aligned}\boldsymbol{\mu(y)}\end{aligned} \begin{aligned}\mu (x)&= \text{exp}\left[\int\dfrac{ \left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]\\&= \text{exp}\left[\int\dfrac{ \left(1 -2xy +1\right )}{x^2y -x} \phantom{x}dx\right ]\\&= \text{exp}\left[\int\dfrac{ 2\left(1 -xy\right )}{-x(1 – xy)} \phantom{x}dx\right ]\\&= \text{exp}\left(\int -\dfrac{2}{x} \phantom{x}dx \right ) \end{aligned} \begin{aligned}\mu(y) &= \text{exp} \left[\int\dfrac{ \left(\partial Q/\partial x – \partial P/\partial y\right )}{P} \phantom{x}dy \right ]\\&= \text{exp} \left[\int\dfrac{ \left(2xy – 1 – 1\right )}{2x^2 + y} \phantom{x}dy \right ]\\&= \text{exp} \left[\int\dfrac{ 2\left(xy – 1\right )}{2x^2 + y} \phantom{x}dy \right ] \end{aligned}

Just by inspecting the expression, we can see that the best course of action is to use $\mu(x)$ since the integrand inside the exponential function is in terms of $x$ alone. Let’s now simplify the integrating factor’s expression by evaluating $\int -\dfrac{2}{x} \phantom{x}dx$.

\begin{aligned}\mu (x)&=  \text{exp}\left(\int -\dfrac{2}{x} \phantom{x}dx \right )\\&= \text{exp}\left(-2\ln x \right )\\&= e^{\displaystyle{-2 \ln x}}\\&=e^{\displaystyle{\ln x^{-2}}}\\&= x^{-2} \end{aligned}

This means that the ideal integrating factor for the differential equation, $(2x^2+ y) \phantom{x}dx + (x^2y – x)\phantom{x}dy = 0$, is equal to $\mu(x) = x^{2}$.

## How To Use Integrating Factor?

As we have discussed earlier, we can use the integrating factor to solve non-exact differential equations by multiplying $\mu$ on both sides of the equation. Before working on the integrating factor, check the differential equation for its exactness. When the differential equation is an exact equation, you can use a simpler approach as we have discussed in this article right away.

When the equation is not exact, use the guide below to solve the differential equation with the help of the integrating factor.

• Check the expression for $\mu(x)$ by evaluating the expression, $\mu = \text{exp}\left[\int\dfrac{ \left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]$. If the expression is in terms of $x$, skip the next bullet.
• If $\mu(x)$ is not a function of $x$ alone, evaluate $\mu(y)$. Check if the resulting expression is a function of $y$ alone.
• Evaluate and simplify the integrating factor’s expression.
• Multiply both sides of the equation by $mu$ then see whether this addresses the exactness issue.
• Use the resulting exact equation and apply the techniques we’ve learned to solve exact equations.

In the previous section, we’ve shown that the equation, $(2x^2+ y) \phantom{x}dx + (x^2y – x)\phantom{x}dy = 0$, is not exact and has an integrating factor of $\mu(x) = x^{-2}$. Multiply both sides of the equation by $x^{-2}$ then confirm whether the resulting equation is now exact.

\begin{aligned}{\color{blue}x^{-2}}(2x^2+ y) \phantom{x}dx + {\color{blue}x^{-2}}(x^2y -x)\phantom{x}dy &= {\color{blue}x^{-2}}\cdot 0\\(2+ yx^{-2}) \phantom{x}dx + (y -x^{-1})\phantom{x}dy &= 0 \end{aligned}

Check the resulting equation for exactness and this time, we’ll use $P = 2+ yx^{-2}$ and $Q = y -x^{-1}$.

 \begin{aligned}\boldsymbol{\dfrac{\partial P}{\partial y}}\end{aligned} \begin{aligned}\boldsymbol{\dfrac{\partial Q}{\partial x}}\end{aligned} \begin{aligned}\dfrac{\partial P}{\partial y} &= \dfrac{\partial}{\partial y} (2+ yx^{-2}) \\&= x^{-2}\end{aligned} \begin{aligned}\dfrac{\partial Q}{\partial x} &= \dfrac{\partial}{\partial x} (y -x^{-1}) \\&= x^{-2}\end{aligned}

The partial derivatives are now the same, so we can confirm that the equation is exact. We can now solve the differential equation using our technique for solving exact equations. Let’s begin by integrating $P(x, y) = 2+ yx^{-2}$ with respect to $x$ then accounting for $g(y)$.

\begin{aligned}f(x, y) &= \int P(x, y) \phantom{x}dx + g(y) \\&= \int 2+ yx^{-2} \phantom{x} dx+ g(y)\\&= 2x  – yx^{-1} + g(y)\\\\\dfrac{\partial f}{\partial y}&= -x^{-1} + g^{\prime}(y)\end{aligned}

We’ve established in the past that $\dfrac{\partial}{\partial y} = Q(x, y)$, so equate our two expressions for $\dfrac{\partial}{\partial y}$ to solve for $g(y)$.

\begin{aligned} y -x^{-1} &= -x^{-1} + g^{\prime}(y)\\g^{\prime}(y)&= y\\g(y) &= \int y \phantom{x}dy\\&=\dfrac{1}{2}y^2\end{aligned}

Write the complete expression for the implicit solution of the equation using the general form, $f(x, y) = C$, where $C$ is an arbitrary constant.

\begin{aligned} f(x, y) &= 2x  – yx^{-1} + g(y)\\ &= 2x  – yx^{-1} + \dfrac{1}{2}y^2\\\\\textbf{Solution}&: x  – yx^{-1} + \dfrac{1}{2}y^2 = C\end{aligned}

This means that the implicit solution of the differential equation is equal to $x – yx^{-1} + \dfrac{1}{2}y^2 = C$. Getting the hang of it, now? Don’t worry, we’ve prepared more examples for you! By working on these exercises, not only will you master this topic, you’ll also refresh your knowledge of solving exact equations!

Example 1

Does the differential equation, $(12x^2 + 2xy + 4y^3) \phantom{x}dx + (x^2 + y^2) \phantom{x} dy =0$, need an integrating factor? If so, find the expression for $\mu$.

Solution

If the equation is exact, there is no need for us to work on its integrating factor. However, when $\dfrac{\partial P}{\partial y}$ and $\dfrac{\partial Q}{\partial x}$ are not equal, then the differential equation is not exact and needs an integrating factor.

\begin{aligned}P(x, y) = 12x^2y + 2xy + 4y^3\\ Q(x, y) = x^2 + y^2\end{aligned}

After writing down the expression for $P$ and $Q$, let’s go ahead and evaluate their partial derivatives with respect to $y$ and $x$, respectively.

 \begin{aligned}\boldsymbol{\dfrac{\partial P}{\partial y}}\end{aligned} \begin{aligned}\boldsymbol{\dfrac{\partial Q}{\partial x}}\end{aligned} \begin{aligned}\dfrac{\partial P}{\partial y} &= \dfrac{\partial}{\partial y} (= 12x^2 y + 2xy + 4y^3) \\&=12x^2+  2x + 12y^2\end{aligned} \begin{aligned}\dfrac{\partial Q}{\partial x} &= \dfrac{\partial}{\partial x} (x^2 + y^2) \\&= 2x\end{aligned}

Since the partial derivatives are not equal, the equation is not exact and needs an integrating factor. Observe that the difference between the two partial derivatives: the difference is a multiple of $x^2 + y^2$. This means that it is easier to find $\mu(x)$, in which we are required to divide $\dfrac{\partial P}{\partial y} – \dfrac{\partial Q}{\partial x}$ by $Q(x, y)$.

\begin{aligned}\mu(x) &= \text{exp}\left[\int\dfrac{ \left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]\\ &= \text{exp}\left[\int\dfrac{ 12x^2+  2x + 12y^2 – 2x}{x^2 + y^2} \phantom{x}dx\right ]\\&= \text{exp}\left(\int \dfrac{12(x^2 + y^2)}{x^2 + y^2} \phantom{x}dx\right)\\&=\text{exp}\left(\int 12 \phantom{x}dx \right )\\&= e^{12x}\end{aligned}

This shows that we can use the integrating factor, $\boldsymbol{\mu(x) = e^{12x}}$, to rewrite the equation and make it exact.

Example 2

Solve the differential equation, $\sin y \phantom{x}dy = (x – \cos y) \phantom{x}dx$.

Solution

Let’s first check the exactness of the differential equation. Once we rewrite the equation, we’ll have the following expressions for $P(x, y)$ and $Q(x, y)$.

 \begin{aligned}\sin y \phantom{x}dy &= (x – \cos y) \phantom{x}dx\\-(x – \cos y) \phantom{x}dx + \sin y \phantom{x}dy &= 0\\(\cos y – x) \phantom{x}dx + \sin y \phantom{x}dy &= 0\end{aligned} \begin{aligned}P(x, y) &= \cos y – x\\Q(x, y) &= \sin y\end{aligned}

Find the expressions for $\dfrac{\partial P}{\partial y}$ and $\dfrac{\partial Q}{\partial x}$ to determine whether the equation is exact or not.

 \begin{aligned}\boldsymbol{\dfrac{\partial P}{\partial y}}\end{aligned} \begin{aligned}\boldsymbol{\dfrac{\partial Q}{\partial x}}\end{aligned} \begin{aligned}\dfrac{\partial P}{\partial y} &= \dfrac{\partial}{\partial y} (\cos y – x) \\&= -\sin y\end{aligned} \begin{aligned}\dfrac{\partial Q}{\partial x} &= \dfrac{\partial}{\partial x} (\sin y) \\&= 0\end{aligned}

The two partial derivatives are not equal, so the differential equation is not exact. This means that we’ll need to find the integrating factor that we can multiply on both sides of the equation. To find the integrating factor, let’s take a quick look at the difference of the two partial derivatives.

\begin{aligned} \dfrac{\partial P}{\partial y} – \dfrac{\partial Q}{\partial x} &= \sin y\\\dfrac{\partial Q}{\partial x} – \dfrac{\partial P}{\partial y} &= \sin y\end{aligned}

It will be much easier to divide the difference by $Q(x, y) = \sin y$, so it’s more ideal to find the integrating factor, $\mu(x) = \text{exp}\left[\int\dfrac{ \left(\partial P/\partial y -\partial Q/\partial x \right )}{Q} \phantom{x}dx\right ]$.

\begin{aligned}\mu (x)&= \text{exp}\left[\int\dfrac{ -\sin y}{\sin y} \phantom{x}dx\right ]\\&= \text{exp}\left(\int – 1 \phantom{x}dx\right)\\&= e^{-x}\end{aligned}

Now, let’s multiply both sides of the differential equation by the integrating factor, $\mu (x) = e^{-x}$.

\begin{aligned}{\color{blue} e^{-x}}(\cos y – x) \phantom{x}dx + {\color{blue} e^{-x}}\sin y \phantom{x}dy &= {\color{blue} e^{-x}} \cdot 0\\(e^{-x}\cos y – e^{-x}x) \phantom{x}dx + e^{-x}\sin y \phantom{x}dy&=0 \end{aligned}

This equation is now an exact differential equation – their partial derivatives as shown below can confirm that as well.

 \begin{aligned}\boldsymbol{\dfrac{\partial P}{\partial y}}\end{aligned} \begin{aligned}\boldsymbol{\dfrac{\partial Q}{\partial x}}\end{aligned} \begin{aligned}\dfrac{\partial P}{\partial y} &= \dfrac{\partial}{\partial y} (e^{-x}\cos y – e^{-x}x) \\&= -e^{-x}\sin y\end{aligned} \begin{aligned}\dfrac{\partial Q}{\partial x} &= \dfrac{\partial}{\partial x} (e^{-x}\sin y) \\&= -e^{-x}\sin y\end{aligned}

It’s much easier to integrate $Q(x, y) = -e^{-x}\sin y$ with respect to $y$, so we’ll  use $f(x, y) = \int Q(x, y) \phantom{x}dy + g(x)$ to guide us in finding the implicit solution.

\begin{aligned}f(x, y) &= \int Q(x, y) \phantom{x}dy + g(x) \\&= \int e^{-x}\sin y\phantom{x} dy+ g(x)\\&= -e^{-x}\cos y+ g(x)\\\\\dfrac{\partial f}{\partial x}&= e^{-x}\cos y + g^{\prime}(x)\end{aligned}

Equate the expression for $P(x, y)$ with $e^{-x}\cos y + g^{\prime}(x)$ to find the expression for $g^{\prime}(x)$. Integrate the resulting expression with respect to $x$ to find $g(x)$ using integration by parts.

\begin{aligned}e^{-x}\cos y – e^{-x}x &= e^{-x}\cos y + g^{\prime}(x)\\g^{\prime}(x) &= -e^{-x}x\\\\g(x) &= \int -xe^{-x} \phantom{x}dx\\&= -\int xe^{-x} \phantom{x}dx\\&= -\left(-e^{-x}x- \int -e^{-x}dx \right)\\&= e^{-x}x + e^{-x}\end{aligned}

Complete the expression for $f(x, y)$ to find the implicit form of the differential equation’s solution.

\begin{aligned} f(x, y) &= e^{-x}\cos y + g(x)\\ &= e^{-x}\cos y + e^{-x}x + e^{-x}\\\\\textbf{Solution}&: e^{-x}\cos y + e^{-x}x + e^{-x} = C\end{aligned}

This means that our differential equation, $\sin y \phantom{x}dy = (x – \cos y) \phantom{x}dx$, has a general solution of $e^{-x}\cos y + e^{-x}x + e^{-x} = C$.

### Practice Questions

1. Does the differential equation, $x \phantom{x}dy – y \phantom{x} dx =0$, need an integrating factor? If so, find the expression for $\mu$.
2. Solve the differential equation, $\dfrac{dy}{dx} = \dfrac{y^2 – 3xy}{x^2 + xy}$.
3. Solve the differential equation, $(x \sin y + x) \phantom{x}dy = (y – x\cos y) \phantom{x} dx$.

1. Yes, the equation is not exact, so it needs an integrating factor. It is equal to $\mu(x) = \dfrac{1}{x^2}$.
2. $x^3y + \dfrac{1}{2}x^2y^2= C$
3. $\dfrac{1}{2} e^{2x} + \dfrac{1}{3}y^3 + x\cos xy = C$