# Integrating factor

In mathematics, an integrating factor is a function that is chosen to facilitate the solving of a given equation involving differentials. It is commonly used to solve ordinary differential equations, but is also used within multivariable calculus when multiplying through by an integrating factor allows an inexact differential to be made into an exact differential (which can then be integrated to give a scalar field). This is especially useful in thermodynamics where temperature becomes the integrating factor that makes entropy an exact differential.

## Use

An integrating factor is any expression that a differential equation is multiplied by to facilitate integration. For example, the nonlinear second order equation

${\displaystyle {\frac {d^{2}y}{dt^{2}}}=Ay^{2/3}}$

admits ${\displaystyle {\tfrac {dy}{dt}}}$ as an integrating factor:

${\displaystyle {\frac {d^{2}y}{dt^{2}}}{\frac {dy}{dt}}=Ay^{2/3}{\frac {dy}{dt}}.}$

To integrate, note that both sides of the equation may be expressed as derivatives by going backwards with the chain rule:

${\displaystyle {\frac {d}{dt}}\left({\frac {1}{2}}\left({\frac {dy}{dt}}\right)^{2}\right)={\frac {d}{dt}}\left(A{\frac {3}{5}}y^{5/3}\right).}$

Therefore

${\displaystyle \left({\frac {dy}{dt}}\right)^{2}={\frac {6A}{5}}y^{5/3}+C_{0}.}$

where ${\displaystyle C_{0}}$ is a constant.

This form may be more useful, depending on application. Performing a separation of variables will give

${\displaystyle \int _{y(0)}^{y(t)}{\frac {dy}{\sqrt {{\frac {6A}{5}}y^{5/3}+C_{0}}}}=t}$

This is an implicit solution which involves a nonelementary integral. This same method is used to solve the period of a simple pendulum.

### Solving first order linear ordinary differential equations

Integrating factors are useful for solving ordinary differential equations that can be expressed in the form

${\displaystyle y'+P(x)y=Q(x)}$

The basic idea is to find some function ${\displaystyle M(x)}$, called the "integrating factor," which we can multiply through our differential equation in order to bring the left-hand side under a common derivative. For the canonical first-order, linear differential equation shown above, our integrating factor is chosen to be

${\displaystyle M(x)=e^{\int P(x)dx}}$

In order to derive this, let ${\displaystyle M(x)}$ be the integrating factor of a first order, linear differential equation such that multiplication by ${\displaystyle M(x)}$ transforms a partial derivative into a total derivative, then:

{\displaystyle {\begin{aligned}(1)\qquad {}&M(x){\underset {\text{partial derivative}}{(\underbrace {y'+P(x)y} )}}\\(2)\qquad {}&M(x)y'+M(x)P(x)y\\(3)\qquad {}&{\underset {\text{total derivative}}{\underbrace {M(x)y'+M'(x)y} }}\end{aligned}}}

Going from step 2 to step 3 requires that ${\displaystyle M(x)P(x)=M'(x)}$, which is a separable differential equation, whose solution yields ${\displaystyle M(x)}$ in terms of ${\displaystyle P(x)}$:

{\displaystyle {\begin{aligned}(4)\qquad &M(x)P(x)=M'(x)\\(5)\qquad &P(x)={\frac {M'(x)}{M(x)}}\\(6)\qquad &\int P(x)dx=\ln M(x)\\(7)\qquad &e^{\int P(x)dx}=M(x)\end{aligned}}}

To verify, multiplying by ${\displaystyle M(x)}$ gives

${\displaystyle y'M(x)+P(x)yM(x)=Q(x)M(x)}$

By applying the product rule in reverse, we see that the left-hand side can be expressed as a single derivative in ${\displaystyle x}$

${\displaystyle y'M(x)+P(x)yM(x)=y'M(x)+yM'(x)={\frac {d}{dx}}(yM(x))}$

We use this fact to simplify our expression to

${\displaystyle {\frac {d}{dx}}\left(yM(x)\right)=Q(x)M(x)}$

Integrating both sides with respect to ${\displaystyle x}$

${\displaystyle ye^{\int P(x)dx}=\int Q(x)e^{\int P(x)dx}dx+C}$

where ${\displaystyle C}$ is a constant.

Moving the exponential to the right-hand side the general solution to Ordinary Differential Equation is:

${\displaystyle y=e^{-\int P(x)dx}\int Q(x)e^{\int P(x)dx}dx+Ce^{-\int P(x)dx}}$

In the case of a homogeneous differential equation, ${\displaystyle Q(x)=0}$ and general solution to Ordinary Differential Equation is:

${\displaystyle y=Ce^{-\int P(x)dx}}$.

for example, consider the differential equation

${\displaystyle y'-{\frac {2y}{x}}=0.}$

We can see that in this case ${\displaystyle P(x)={\frac {-2}{x}}}$

${\displaystyle M(x)=e^{\int _{1}^{x}P(x)dx}}$
${\displaystyle M(x)=e^{\int _{1}^{x}{\frac {-2}{x}}\,dx}=e^{-2\ln x}={(e^{\ln x})}^{-2}=x^{-2}}$
${\displaystyle M(x)={\frac {1}{x^{2}}}.}$

Multiplying both sides by ${\displaystyle M(x)}$ we obtain

${\displaystyle {\frac {y'}{x^{2}}}-{\frac {2y}{x^{3}}}=0}$
${\displaystyle {\frac {y'x^{3}-2x^{2}y}{x^{5}}}=0}$
${\displaystyle {\frac {x(y'x^{2}-2xy)}{x^{5}}}=0}$
${\displaystyle {\frac {y'x^{2}-2xy}{x^{4}}}=0.}$

Reversing the quotient rule gives

${\displaystyle \left({\frac {y}{x^{2}}}\right)'=0}$

or

${\displaystyle {\frac {y}{x^{2}}}=C\,}$

where ${\displaystyle C}$ is a constant.

which gives

${\displaystyle y=Cx^{2}.}$