When it comes to solving differential equations, the method of separable equations is often our go-to approach.
However, there is another class of equations with a unique solution method involving the use of an integrating factor that stands out.
Which class of equations are we referring to?
Exact Ordinary Differential Equations!
What is an Exact ODE?
Okay, so a first order differential equation of the form \(M(x, y)+N(x, y) \frac{d y}{d x}=0\) is said to be an exact equation if there exists a function \(f(x, y)\) whose differential equals the left side:
\begin{equation}
\frac{\partial f}{\partial x} d x+\frac{\partial f}{\partial y} d y=M(x, y) d x+N(x, y) d y
\end{equation}
But what does this really mean?
Exact ODEs, also known as total differential equations, are a category of ordinary differential equations where a continuously differentiable function \(F\), referred to as the potential function, exists. This potential function was previously covered in multivariable calculus (Calculus 3).
If we can determine that the partial derivatives \(M_{y}\) and \(N_{x}\) are equal to each other and our DE is of the form \(M(x, y) d x+N(x, y) d y=0\) than we have an exact equation.
\begin{equation}
\begin{array}{|c|c|}
\hline \text { Exact Differential Equation } & \begin{array}{c}
\text { Not an Exact Differential } \\
\text { Equation }
\end{array} \\
\hline\left(y \cos x+2 x e^y\right)+\left(\sin x+x^2 e^y-1\right) \frac{d y}{d x}=0 & \left(3 x y+y^2\right)+\left(x^2+x y\right) \frac{d y}{d x}=0 \\
\underbrace{\left(y \cos x+2 x e^y\right)}_M d x+\underbrace{\left(\sin x+x^2 e^y-1\right)}_N d y=0 & \underbrace{\left(3 x y+y^2\right)}_M d x+\underbrace{\left(x^2+x y\right)}_N d y=0 \\
M_y=\cos x+2 x e^y \text { and } & M_y=3 x+2 y \quad \text { and } \\
N_x=\cos x+2 x e^y & N_x=2 x+y \\
M_y=N_x & M_y \neq N_x \\
\hline
\end{array}
\end{equation}
So, if we have an exact equation, how do we go about solving it?
Identifying and Solving Exact ODEs
Steps for Solving Exact ODEs
Alright, so there are only three steps for solving Exact ODEs:
- Put the DE in \(M(x, y) d x+N(x, y) d y=0\) form
- Verify \(M_{y}=N_{x}\)
- Integrate \(M(x, y) d x\) and \(N(x, y) d y\) separately to find the potential function, remembering that if they share terms, then we only write those shared terms once.
Let’s look at an example.
Example: Solving an Exact ODE
Solve \(\left(y \cos x+2 x e^{y}\right)+\left(\sin x+x^{2} e^{y}-1\right) \frac{d y}{d x}=0\)
First, we will put our DE into the form \(M(x, y) d x+N(x, y) d y=0\) by multiplying the entire equation by \(\mathrm{dx}\)
\begin{equation}
\left(y \cos x+2 x e^y\right) d x+\left(\sin x+x^2 e^y-1\right) d y=0
\end{equation}
Now, we must verify that \(M_{y}=N_{x}\) by finding the appropriate partial derivatives.
\begin{align*}
\begin{aligned}
& \underbrace{\left(y \cos x+2 x e^{y}\right)}_{M} d x+\underbrace{\left(\sin x+x^{2} e^{y}-1\right)}_{N} d y=0 \\
& M_{y}=\cos x+2 x e^{y} \text { and } N_{x}=\cos x+2 x e^{y} \text { so } M_{y}=N_{x}
\end{aligned}
\end{align*}
Next, we will integrate both \(\mathrm{M}\) and \(\mathrm{N}\) separately
\begin{align*}
\int\left(y \cos x+2 x e^{y}\right) d x=y \sin x+x^{2} e^{y} \quad \text { and } \quad \int\left(\sin x+x^{2} e^{y}-1\right) d y=y \sin x+x^{2} e^{y}-y
\end{align*}
Now, we will write our solution by combining our integral and writing duplicate terms only once
\begin{align*}
\left.\begin{array}{l}
\int\left(y \cos x+2 x e^{y}\right) d x=y \sin x+x^{2} e^{y} \\
\int\left(\sin x+x^{2} e^{y}-1\right) d y=y \sin x+x^{2} e^{y}-y
\end{array}\right\} f(x, y)=y \sin x+x^{2} e^{y}-y+C
\end{align*}
See, nothing to it!
Integrating Factor: Transforming Non-exact Equations into Exact ODEs
When and How to Use an Integrating Factor
But there’s more.
What happens if we aren’t given an exact equation, but it’s so stinkin’ close to being exact that we are itching to make it so? Is there a way to turn a non-exact equation into an exact ODE?
Yes! With the help of an integrating factor!
Recall the procedure we used in solving first-order differential equations? Well, if we can find a suitable integrating factor \(\mu\), we can multiply our equation by \(\mu\) so that the resulting equation \(\mu(M(x, y)) d x+\mu(N(x, y)) d y=0\) is exact. More importantly, \((\mu M)_{y}=(\mu N)_{x}\)
Finding a Suitable Integrating Factor
Okay, but how do we go about choosing a suitable integrating factor?
If \(\frac{M_{y}-N_{x}}{N}\) is a function of \(\mathrm{x}\) alone, then we let \(\mu=e^{\int \frac{M_{y}-N_{x}}{N} d x}\)
If \(\frac{N_{x}-M_{y}}{M}\) is a function of \(y\) alone, then we let \(\mu=e^{\int \frac{N_{x}-M_{y}}{M} d y}\)
Example: Transforming a Non-exact Equation with an Integrating Factor
When and How to Use an Integrating Factor
Let’s look at an example to see this in action.
Solve, \(\left(3 x y+y^{2}\right)+\left(x^{2}+x y\right) \frac{d y}{d x}=0\)
As always, we must first put our differential equation into the proper form and check to see whether or not it is exact by checking partial derivatives
\begin{align*}
\begin{aligned}
& \left(3 x y+y^{2}\right)+\left(x^{2}+x y\right) \frac{d y}{d x}=0 \\
& \underbrace{\left(3 x y+y^{2}\right)}_{M} d x+\underbrace{\left(x^{2}+x y\right)}_{N} d y=0 \\
& M_{y}=3 x+2 y \text { and } N_{x}=2 x+y \\
& M_{y} \neq N_{x}
\end{aligned}
\end{align*}
Well, we don’t have an exact equation, but it’s possible that we can transform it. So, let’s now determine whether it has an integrating factor that depends on \(\mathrm{x}\) only or \(\mathrm{y}\) only.
\begin{equation}
\frac{M_y-N_x}{N}=\frac{(3 x+2 y)-(2 x+y)}{x^2+x y}=\frac{x+y}{x(x+y)}=\frac{1}{x}
\end{equation}
\begin{equation}
\frac{N_x-M_y}{M}=\frac{(2 x+y)-(3 x+2 y)}{3 x y+y^2}=\frac{-x-y}{3 x y+y^2}
\end{equation}
We can clearly see that we do indeed have a factor that depends on \(x\) only, namely \(\frac{M_{y}-N_{x}}{N}=\frac{1}{x}\), so this is will be our choice. But before we can multiply our DE by our choice, we must integrate to find our integrating factor
\begin{equation}
\mu=e^{\int \frac{M_y-N_x}{N} d x}=e^{\int \frac{1}{x} d x}=e^{\ln |x|}=x
\end{equation}
Now, let’s multiply our differential equation by our integrating factor and simplify.
\begin{align*}
\begin{aligned}
& \mu(M(x, y)) d x+\mu(N(x, y)) d y=0 \\
& x\left[\left(3 x y+y^{2}\right)\right] d x+x\left[\left(x^{2}+x y\right) d y\right]=0 \\
& \left(3 x^{2} y+x y^{2}\right) d x+\left(x^{3}+x^{2} y\right) d y=0
\end{aligned}
\end{align*}
Next, we verify that our “new” differential equation has at last become an exact equation
\begin{align*}
\begin{aligned}
& (\mu M)_{y}=(\mu N)_{x} \\
& \underbrace{\left(3 x^{2} y+x y^{2}\right)}_{\mu M} d x+\underbrace{\left(x^{3}+x^{2} y\right)}_{\mu N} d y=0 \\
& (\mu M)_{y}=3 x^{2} y+2 x y=(\mu N)_{x}
\end{aligned}
\end{align*}
And all that is now left is for us to integrate \((\mu M)\) and \((\mu N)\) separately, and write our solution by combining our integral and writing duplicate terms only once
\begin{align*}
\left.\begin{array}{l}
\int\left(3 x^{2} y+x y^{2}\right) d x=x^{3} y+\frac{1}{2} x^{2} y^{2} \\
\int\left(x^{3}+x^{2} y\right) d y=x^{3} y+\frac{1}{2} x^{2} y^{2}
\end{array}\right\} f(x, y)=x^{3} y+\frac{1}{2} x^{2} y^{2}+C
\end{align*}
Cool, right?
Conclusion
Together in this lesson we will learn how to solve identify and solve exact equations and learn how to find an integrating factor to make a first order ODE into an exact equation, except in a trivial case.
It’s going to be great!
Video Tutorial w/ Full Lesson & Detailed Examples
Get access to all the courses and over 450 HD videos with your subscription
Monthly and Yearly Plans Available
Still wondering if CalcWorkshop is right for you?
Take a Tour and find out how a membership can take the struggle out of learning math.