Using an Integrating Factor
Solved Problems
Example 3.
Solve the differential equation
\[\left( {x{y^2} - 2{y^3}} \right)dx + \left( {3 - 2x{y^2}} \right)dy = 0.\]
Solution.
The given equation is not exact, because
\[\frac{{\partial Q}}{{\partial x}} = \frac{\partial }{{\partial x}}\left( {3 - 2x{y^2}} \right) = - 2{y^2} \ne \frac{{\partial P}}{{\partial y}} = \frac{\partial }{{\partial y}}\left( {x{y^2} - 2{y^3}} \right) = 2xy - 6{y^2}.\]
We try to find the general solution of the equation using an integrating factor. Calculate the difference
\[\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}} = 2xy - 6{y^2} - \left( { - 2{y^2}} \right) = 2xy - 4{y^2}.\]
Notice that the expression
\[\frac{1}{P}\left( {\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}}} \right) = \frac{{2xy - 4{y^2}}}{{x{y^2} - 2{y^3}}} = \frac{{2\cancel{\left( {xy - 2{y^2}} \right)}}}{{y\cancel{\left( {xy - 2{y^2}} \right)}}} = \frac{2}{y} \]
depends only on \(y.\) Therefore, the integrating factor \(\mu\) is also a function only of the variable \(y.\) We can find it from the equation
\[\frac{1}{\mu }\frac{{d\mu }}{{dy}} = - \frac{1}{P}\left( {\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}}} \right) = - \frac{2}{y}.\]
Integrating, we get:
\[\int {\frac{{d\mu }}{\mu }} = - 2\int {\frac{{dy}}{y}} ,\;\; \Rightarrow \ln \left| \mu \right| = - 2\ln \left| \mu \right|,\;\; \Rightarrow \mu = \pm \frac{1}{{{y^2}}}.\]
By choosing \(\mu = {\frac{1}{{{y^2}}}}\) as the integrating factor and then multiplying the original differential equation by it, we get the exact equation:
\[\left( {x - 2y} \right)dx + \left( {\frac{3}{{{y^2}}} - 2x} \right)dy = 0.\]
Indeed, we see that
\[\frac{{\partial Q}}{{\partial x}} = \frac{\partial }{{\partial x}}\left( {\frac{3}{{{y^2}}} - 2x} \right) = - 2 = \frac{{\partial P}}{{\partial y}} = \frac{\partial }{{\partial y}}\left( {x - 2y} \right) = - 2.\]
Notice that when we multiplied by the integrating factor we lost the solution \(y = 0.\) This can be proved by direct substitution of the solution \(y = 0\) in the original differential equation.
Now we find the function \(u\) from the system of equations:
\[\left\{ \begin{array}{l}
\frac{{\partial u}}{{\partial x}} = x - 2y\\
\frac{{\partial u}}{{\partial y}} = \frac{3}{{{y^2}}} - 2x
\end{array} \right..\]
It follows from the first equation that
\[u\left( {x,y} \right) = \int {\left( {x - 2y} \right)dx} = \frac{{{x^2}}}{2} - 2yx + \varphi \left( y \right).\]
Then we get from the second equation:
\[\frac{{\partial u}}{{\partial y}} = \frac{\partial }{{\partial y}}\left[ {\frac{{{x^2}}}{2} - 2yx + \varphi \left( y \right)} \right] = \frac{3}{{{y^2}}} - 2x,\;\; \Rightarrow - 2x + \varphi'\left( y \right) = \frac{3}{{{y^2}}} - 2x,\;\; \Rightarrow \varphi'\left( y \right) = \frac{3}{{{y^2}}},\;\; \Rightarrow \varphi \left( y \right) = \int {\frac{3}{{{y^2}}}dy} = - \frac{3}{y}.\]
Thus, the original differential equation has the following solutions:
\[\frac{{{x^2}}}{2} - 2yx - \frac{3}{y} = C,\;\; y = 0,\]
where \(C\) is a constant.
Example 4.
Solve the equation \[\left( {xy + 1} \right)dx + {x^2}dy = 0.\]
Solution.
First of all we check this equation for exactness:
\[\frac{{\partial Q}}{{\partial x}} = \frac{\partial }{{\partial x}}\left( {{x^2}} \right) = 2x\; \ne \frac{{\partial P}}{{\partial y}} = \frac{\partial }{{\partial y}}\left( {xy + 1} \right) = x.\]
The partial derivatives are not equal to each other. Therefore, this equation is not exact. Calculate the difference of the derivatives:
\[\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}} = x - 2x = - x.\]
Now we try to use the integrating factor in the form \(z = xy.\) Here we have
\[\frac{{\partial z}}{{\partial x}} = y,\;\; \frac{{\partial z}}{{\partial y}} = x.\]
Then
\[Q\frac{{\partial z}}{{\partial x}} - P\frac{{\partial z}}{{\partial y}} = {x^2} \cdot y - \left( {xy + 1} \right) \cdot x = \cancel{{x^2}y} - \cancel{{x^2}y} - x = - x,\]
and hence we get
\[\frac{1}{\mu }\frac{{d\mu }}{{dz}} = \frac{{\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}}}}{{Q\frac{{\partial z}}{{\partial x}} - P\frac{{\partial z}}{{\partial y}}}} = \frac{{ - x}}{{ - x}} = 1.\]
We see that the integrating factor depends only on \(z:\)
\[\mu \left( {x,y} \right) = \mu \left( z \right) = \mu \left( {xy} \right).\]
We can find it by integrating the last equation:
\[\frac{1}{\mu }\frac{{d\mu }}{{dz}} = 1,\;\; \Rightarrow \int {\frac{{d\mu }}{\mu }} = \int {dz} ,\;\; \Rightarrow \ln \left| \mu \right| = z,\;\; \Rightarrow \mu = {e^{ \pm z}} = {e^{ \pm xy}}.\]
By choosing the function \(\mu = {e^{xy}}\) we can convert the original differential equation into exact:
\[\left( {xy + 1} \right){e^{xy}}dx + {x^2}{e^{xy}}dy = 0.\]
Check this using again the test for exactness:
\[\frac{{\partial Q}}{{\partial x}} = \frac{\partial }{{\partial x}}\left[ {{x^2}{e^{xy}}} \right] = 2x{e^{xy}} + {x^2}y{e^{xy}},\]
\[\frac{{\partial P}}{{\partial y}} = \frac{\partial }{{\partial y}}\left[ {\left( {xy + 1} \right){e^{xy}}} \right] = x{e^{xy}} + \left( {xy + 1} \right)x{e^{xy}} = x{e^{xy}} + {x^2}y{e^{xy}} + x{e^{xy}} = 2x{e^{xy}} + {x^2}y{e^{xy}}.\]
As one can see, now this equation is exact. We find its general solution form the system of equations:
\[\left\{ \begin{array}{l}
\frac{{\partial u}}{{\partial x}} = \left( {xy + 1} \right){e^{xy}}\\
\frac{{\partial u}}{{\partial y}} = {x^2}{e^{xy}}
\end{array} \right..\]
Integrate the second equation with respect to the variable \(y\) (considering \(x\) as a constant):
\[u\left( {x,y} \right) = \int {{x^2}{e^{xy}}dy} = {x^2}\int {{e^{xy}}dy} = {x^2} \cdot \frac{1}{x}{e^{xy}} + \psi \left( x \right) = x{e^{xy}} + \psi \left( x \right).\]
Substitute this in the first equation of the system to get:
\[\frac{{\partial u}}{{\partial x}} = \frac{\partial }{{\partial x}}\left[ {x{e^{xy}} + \psi \left( x \right)} \right] = \left( {xy + 1} \right){e^{xy}},\;\; \Rightarrow 1 \cdot {e^{xy}} + xy{e^{xy}} + \psi'\left( x \right) = \left( {xy + 1} \right){e^{xy}},\;\; \Rightarrow \left( {xy + 1} \right){e^{xy}} + \psi'\left( x \right) = \left( {xy + 1} \right){e^{xy}},\;\; \Rightarrow \psi'\left( x \right) = 0,\;\; \Rightarrow \psi \left( x \right) = C.\]
Hence, the general solution of the given differential equation is written in the form:
\[x{e^{xy}} + C = 0,\]
where \(C\) is any real number.
Example 5.
Solve the equation \[ydx + \left( {{x^2} + {y^2} - x} \right)dy = 0\] using the integrating factor \(\mu \left( {x,y} \right) = {x^2} + {y^2}.\)
Solution.
We can make sure that this equation is not exact:
\[\frac{{\partial Q}}{{\partial x}} = \frac{\partial }{{\partial x}}\left( {{x^2} + {y^2} - x} \right) = 2x - 1 \ne \frac{{\partial P}}{{\partial y}} = \frac{\partial }{{\partial y}}\left( y \right) = 1.\]
The difference of the partial derivatives is
\[\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}} = 1 - \left( {2x - 1} \right) = 2 - 2x.\]
Using the integrating factor \(\mu = z = {x^2} + {y^2},\) we find that
\[\frac{{\partial z}}{{\partial x}} = \frac{\partial }{{\partial x}}\left( {{x^2} + {y^2}} \right) = 2x,\;\;\; \frac{{\partial z}}{{\partial y}} = \frac{\partial }{{\partial y}}\left( {{x^2} + {y^2}} \right) = 2y.\]
Calculate the following expression:
\[Q\frac{{\partial z}}{{\partial x}} - P\frac{{\partial z}}{{\partial y}} = \left( {{x^2} + {y^2} - x} \right) \cdot 2x - y \cdot 2y = 2{x^3} + 2x{y^2} - 2{x^2} - 2{y^2} = 2x\left( {{x^2} + {y^2}} \right) - 2\left( {{x^2} + {y^2}} \right) = \left( {{x^2} + {y^2}} \right)\left( {2x - 2} \right).\]
As a result, we obtain the differential equation for the function \(\mu \left( z \right):\)
\[\frac{1}{\mu }\frac{{d\mu }}{{dz}} = \frac{{\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}}}}{{Q\frac{{\partial z}}{{\partial x}} - P\frac{{\partial z}}{{\partial y}}}} = \frac{{2 - 2x}}{{\left( {{x^2} + {y^2}} \right)\left( {2x - 2} \right)}} = - \frac{\cancel{2x - 2}}{{z \cancel{\left( {2x - 2} \right)}}} = - \frac{1}{z}.\]
By integrating we get the function \(\mu \left( z \right):\)
\[\int {\frac{{d\mu }}{\mu }} = - \int {\frac{{dz}}{z}} ,\;\; \Rightarrow \ln \left| \mu \right| = - \ln \left| z \right|,\;\; \Rightarrow \mu = \pm \frac{1}{z}.\]
We can choose the integrating factor \(\mu = \frac{1}{z} = \frac{1}{{{x^2} + {y^2}}}.\) After multiplication by \(\frac{1}{{{x^2} + {y^2}}}\) the original differential equation is converted into exact:
\[\frac{y}{{{x^2} + {y^2}}}dx + \frac{{{x^2} + {y^2} - x}}{{{x^2} + {y^2}}}dy = 0\;\; \text{or}\;\;\frac{y}{{{x^2} + {y^2}}}dx + \left( {1 - \frac{x}{{{x^2} + {y^2}}}} \right)dy = 0.\]
The general solution \(u\left( {x,y} \right) = C\) is defined by the following system of equations:
\[\left\{ \begin{array}{l}
\frac{{\partial u}}{{\partial x}} = \frac{y}{{{x^2} + {y^2}}}\\
\frac{{\partial u}}{{\partial y}} = 1 - \frac{x}{{{x^2} + {y^2}}}
\end{array} \right..\]
Integrating the first equation with respect to \(x\) produces:
\[u\left( {x,y} \right) = \int {\frac{y}{{{x^2} + {y^2}}}dx} = y\int {\frac{{dx}}{{{x^2} + {y^2}}}} = y \cdot \frac{1}{y}\arctan \frac{x}{y} + \varphi \left( y \right) = \arctan \frac{x}{y} + \varphi \left( y \right).\]
Substituting this in the second equation, we have:
\[\frac{{\partial u}}{{\partial y}} = \frac{\partial }{{\partial y}}\left[ {\arctan \frac{x}{y} + \varphi \left( y \right)} \right] = 1 - \frac{x}{{{x^2} + {y^2}}},\;\; \Rightarrow \frac{1}{{1 + {{\left( {\frac{x}{y}} \right)}^2}}} \cdot \left( { - \frac{x}{{{y^2}}}} \right) + \varphi'\left( y \right) = 1 - \frac{x}{{{x^2} + {y^2}}},\;\; \Rightarrow - \frac{{\cancel{y^2}x}}{{\left( {{x^2} + {y^2}} \right)\cancel{y^2}}} + \varphi'\left( y \right) = 1 - \frac{x}{{{x^2} + {y^2}}},\;\; \Rightarrow \varphi'\left( y \right) = 1,\;\; \Rightarrow \varphi \left( y \right) = y.\]
Thus, the general solution of differential equation in implicit form is defined by the formula:
\[\arctan \frac{x}{y} + y = C,\]
where \(C\) is a constant.