The integrating factor method is a technique for solving first order ordinary differential equations of the form
\[\frac{\mathrm{d} y}{\mathrm{d} x} + f(x)y = g(x),\]
where $f(x)$ and $g(x)$ are any two arbitrary functions of $x$ only. Equations of this form are not separable, however we can combine the two terms on the left-hand side into a single derivative by using an integrating factor.
The integrating factor IF is given by integrating $f(x)$ and then exponentiating:
\[IF = e^{F(x)},\]
where $F(x)$ is defined by $\displaystyle F(x) = \int f(x) \mathrm{d} x$.
It is important to note that the constant of integration is not included; this method requires that the derivative of $F(x)$ is $f(x)$, i.e. $F'(x)=f(x)$, and the constant of integration is not necessary to meet this condition.
Multiplying the original differential equation by the integrating factor $IF= e^{F(x)}$ gives
\[e^{F(x)}\frac{\mathrm{d} y}{\mathrm{d} x} + f(x) e^{F(x)}y = g(x) e^{F(x)}.\]
Now note that the left hand side is the derivative of the integrating factor multiplied by $y$:
\[\frac{\mathrm{d}}{\mathrm{d} x}\left[ e^{F(x)}y \right] = e^{F(x)}\frac{\mathrm{d} y}{\mathrm{d} x} + f(x) e^{F(x)}y.\]
This result comes from the product rule, with the first term on the right-hand side containing the derivative of $y$ and the second term containing the derivate of $ e^{F(x)}$.
The original equation can now be written in the form
\[\frac{\mathrm{d}}{\mathrm{d} x} \left[ e^{F(x)}y \right] = g(x) e^{F(x)}.\]
This equation can be solved by integrating both sides:
\[\int \frac{\mathrm{d}}{\mathrm{d} x} \left[ e^{F(x)}y \right] \mathrm{d} x = \int g(x) e^{F(x)} \mathrm{d} x,\]
As integration is the opposite of differentiation, the left-hand side can be simplified:
\[\int\frac{\mathrm{d}}{\mathrm{d} x}\left[ e^{F(x)}y\right]\mathrm{d} x = e^{F(x)}y.\]
Hence the equation becomes:
\[e^{F(x)}y = \int g(x) e^{F(x)} \mathrm{d} x.\]
Provided that the integral on the right-hand side is simple enough to compute, this will lead to a solution.
Solve $ \dfrac{\mathrm{d} y}{\mathrm{d} x} + 3y = x. $
The general form of a first order linear ordinary differential equation is:
\[\frac{\mathrm{d} y}{\mathrm{d} x} + f(x)y = g(x).\]
In the given equation, $f(x) = 3$ and $g(x) = x$.
Recall that the integrating factor is given by $IF= e^{F(x)}$, where $\displaystyle F(x)=\int f(x) \mathrm{d} x$. For this equation, the function $F(x)$ is:
\[F(x)=\int3\mathrm{d} x=3x.\]
As mentioned above, it is not necessary to include a constant of integration.
The integrating factor for this equation is therefore given by:
\[IF = e^{3x}.\]
Multiplying both sides of the original equation by the integrating factor gives:
\[e^{3x}\frac{\mathrm{d} y}{\mathrm{d} x} + 3 e^{3x}y = x e^{3x}.\]
Note: At this point it is advisable to check that the left-hand side is indeed the derivative of the integrating factor multiplied by $y$:
\[\frac{\mathrm{d </div>{\mathrm{d} x} \left[ e^{3x}y \right] = e^{3x}\frac{\mathrm{d} y}{\mathrm{d} x} + 3 e^{3x}y.\]
The simplified form of the equation is therefore:
\[\frac{\mathrm{d}}{\mathrm{d} x} \left[ e^{3x}y \right] = x e^{3x}.\]
Integrating both sides gives:
\[e^{3x}y = \int x e^{3x} \mathrm{d} x.\]
To compute the integral on the right-hand side it is necessary to use integration by parts.
Recall the formula for integration by parts:
\[\int uv'dx = uv - \int u'v dx.\]
Choose $u=x$ and $v' = e^{3x}$. Then:
\begin{align} u&=x, & v&=\dfrac{1}{3} e^{3x}, \\ u'&=1, & v'&= e^{3x}, \end{align}
and the integral becomes:
\[\begin{align} \int x e^{3x}\mathrm{d} x &= x \cdot \frac{1}{3} e^{3x} - \int 1 \cdot \frac{1}{3} e^{3x}\mathrm{d} x, \\ &= \frac{x}{3} e^{3x} - \frac{1}{9} e^{3x} + C. \end{align}\]
Note: At this point it is necessary to include the constant of integration.
Substituting this result for the integral back into the equation gives:
\[e^{3x}y = \frac{x}{3} e^{3x} - \frac{1}{9} e^{3x} + C.\]
Multiplying both sides by $ e^{-3x}$ gives the solution for $y(x)$:
\[y = \frac{x}{3} - \frac{1}{9} + C e^{-3x}.\]
}}
Newcastle University Maths-Aid uses the integrating factor method to find the general solution of $\dfrac{\mathrm{d}y}{\mathrm{d}x}+3y=x$.
Solve $ \dfrac{\mathrm{d} y}{\mathrm{d} x} - \dfrac{1}{x}y = x^2.$
The general form of a first order linear ordinary differential equation is:
\[\frac{\mathrm{d} y}{\mathrm{d} x} + f(x)y = g(x).\]
In the given equation, $f(x) = -\dfrac{1}{x}$ and $g(x) = x^2$.
Note: If the function $f(x)$ includes a minus sign it is essential to include this minus sign when computing the integrating factor.
Recall that the integrating factor is given by $IF= e^{F(x)}$, where $\displaystyle F(x)=\int f(x) \mathrm{d} x$. For this equation, the function $F(x)$ is:
\[F(x)=\int-\frac{1}{x}\mathrm{d} x=-\ln (x) = \ln (x^{-1}).\]
As mentioned above, it is not necessary to include a constant of integration.
The integrating factor for this equation is therefore given by:
\[IF = e^{\ln(x^{-1})}.\]
By the laws of logarithms this simplifies to become:
\[IF = \frac{1}{x}.\]
Multiplying both sides of the original equation by the integrating factor gives:
\[\frac{1}{x} \frac{\mathrm{d} y}{\mathrm{d} x} - \frac{1}{x^2}y = x.\]
Note: At this point it is advisable to check that the left-hand side is indeed the derivative of the integrating factor multiplied by $y$:
\[\frac{\mathrm{d </div>{\mathrm{d} x} \left[ \frac{1}{x}y \right] = \frac{1}{x}\frac{\mathrm{d} y}{\mathrm{d} x} - \frac{1}{x^2}y.\]
The simplified from of the equation is therefore:
\[\frac{\mathrm{d}}{\mathrm{d} x} \left[ \frac{1}{x}y \right] = x.\]
Integrating both sides gives:
\[\begin{align} \frac{1}{x}y &= \int x \mathrm{d} x \\ &= \frac{1}{2}x^2+C \end{align}\]
Multiplying both sides by $x$ gives the solution for $y$:
\[y=\frac{1}{2}x^3+Cx.\]
}}
Newcastle University Maths-Aid uses the integrating factor method to find the general solution of $\dfrac{\mathrm{d}y}{\mathrm{d}x}-\dfrac{1}{x}y=x^2$.
Prof. Robin Johnson uses the integrating factor method to find the general solution of $x\dfrac{\mathrm{d}y}{\mathrm{d}x}+2y=x^2$.
This workbook produced by HELM is a good revision aid, containing key points for revision and many worked examples.