next up previous index
Next: Using Matrix Algebra Up: Methods for Solving ODEs Previous: Separation of Variables   Index

Click for printer friendely version of this HowTo


Integrating Factors

Using integrating factors is a useful trick to use when you can not separate the different variables or, if you are able to separate the variables, the integration is too difficult. Here we will present an example of how integrating factors are used and then give a general formula for this method.

The simplest ODEs are linear with constant coefficients:

$\displaystyle \frac{\textrm{d}y}{\textrm{d}t} = f(y,t) = -ay - b$ (2.10.8)

where $ a$ is a constant. You may have guessed that this is similar to Equation 2.4.1, with a similar solution, the exponential function (Equation 2.4.2). The only difference here is that there is an added constant. Thus, just as you would expect, the solution is exponential plus a constant. Solving this equation, however, uses a trick, an integrating factor, and in this case the integrating factor is $ e^{at}$. The main idea is to multiply the equation by a well chosen integrating factor that makes the integration simple. The task of choosing a good integrating factor can be boiled down to following a standard formula, so, overall, finding the solution is not too hard. Thus, starting from Equation 2.10.9, we can move everything to one side,

$\displaystyle \frac{dy}{dt} + ay + b =0$ (2.10.9)

and multiply through by $ e^{at}$:

$\displaystyle e^{at}\frac{\textrm{d}y}{\textrm{d}t} + aye^{at} + be^{at} = \frac{\textrm{d}}{\textrm{d}t} [y e^{at}] + be^{at} = 0.$    

We can now integrate both sides of the equation and get:

$\displaystyle y e^{at} + \frac{b}{a}e^{at} + K = 0$    

where $ K$ is an arbitrary integration constant that is determined by the initial conditions.

To finally solve the equation we multiply through by $ e^{-at}$ giving us:

$\displaystyle y + \frac{b}{a} + Ke^{-at} = 0,$    

or

$\displaystyle y = -Ke^{-at} - \frac{b}{a}.$ (2.10.10)

To solve for $ K$, we let $ t=0$ and thus,

$\displaystyle y(0) = -K -\frac{b}{a},$    

or

$\displaystyle K = y(0) + \frac{b}{a},$    

an the complete solution is written as

$\displaystyle y = -(y(0) + \frac{b}{a}) e^{-at} - \frac{b}{a}.$ (2.10.11)

To verify our solution is correct we can take the derivative of Equation 2.10.12, plug it into Equation 2.10.10 and make sure that everything cancels out. That is,

$\displaystyle \frac{\textrm{d}y}{\textrm{d}t}$ $\displaystyle = a(y(0) + \frac{b}{a}) e^{-at}$    
  $\displaystyle = (ay(0) + b)e^{-at}$ (2.10.12)

and from Equation 2.10.10

$\displaystyle ay$ $\displaystyle = - \frac{\textrm{d}y}{\textrm{d}t} - b$    
  $\displaystyle = -(ay(0) + b) e^{-at} - b.$ (2.10.13)

Plugging the results of Equations 2.10.13 and 2.10.14 into Equation 2.10.10, we have
$\displaystyle {\frac{\textrm{d}y}{\textrm{d}t} + ay + b}$
  $\displaystyle =$ $\displaystyle (ay(0) + b)e^{-at} - (ay(0) - b) e^{-at} - b + b$  
  $\displaystyle =$ $\displaystyle 0,$  

which is exactly what it should reduce to.

In general, given the equation

$\displaystyle \frac{\textrm{d}y}{\textrm{d}x} + P(x)y = Q(x),$ (2.10.14)

the solution for $ y(x)$ can be found with the formula

$\displaystyle y(x)= [\mu(x)]^{-1}\left( \int \mu(x)Q(x) \textrm{d}x + C\right),$ (2.10.15)

where $ \mu(x)$ is the integrating factor and

$\displaystyle \mu(x) = \textrm{exp} \left( \int P(x) \textrm{d}x \right).$ (2.10.16)

no_titleno_title

Example 2.10.3.2 (no_title)  

In Example 2.4.0.1 we created the ODE:

$\displaystyle \frac{\textrm{d}A}{\textrm{d}t} = l(P_{\textrm{max}} - A) -kA,$    

which can easily be solved using this method. Following our recipe, we have:

$\displaystyle \frac{\textrm{d}A}{\textrm{d}t} + A(l + k) - lP_{\textrm{max}}$ $\displaystyle = 0$    
$\displaystyle e^{(l+k)t}\frac{\textrm{d}A}{\textrm{d}t} + A(l + k)e^{(l+k)t} - lP_{\textrm{max}}e^{(l+k)t}$ $\displaystyle = 0$    
$\displaystyle \frac{\textrm{d}}{\textrm{d}t}Ae^{(l+k)t} - lP_{\textrm{max}}e^{(l+k)t}$ $\displaystyle = 0,$    

and after integrating both sides with respect to $ t$, we have:

$\displaystyle Ae^{(l+k)t} - \frac{lP_{\textrm{max}}}{(l+k)}e^{(l+k)t} + K$ $\displaystyle = 0$    
$\displaystyle A - \frac{lP_{\textrm{max}}}{(l+k)} + Ke^{-(l+k)t}$ $\displaystyle = 0$    
$\displaystyle A$ $\displaystyle = \frac{lP_{\textrm{max}}}{(l+k)} - Ke^{-(l+k)t}.$    

We can now solve for $ K$ by setting $ t=0$:

$\displaystyle A(0)$ $\displaystyle = \frac{lP_{\textrm{max}}}{(l+k)} - K$    
$\displaystyle K$ $\displaystyle = \frac{lP_{\textrm{max}}}{(l+k)} - A(0),$    

making our general solution:

$\displaystyle A(t) = \frac{lP_{\textrm{max}}}{(l+k)} - \left[\frac{lP_{\textrm{max}}}{(l+k)} - A(0)\right]e^{-(l+k)t},$    

or

$\displaystyle A(t) = \frac{P_{\textrm{max}}}{(1+\frac{k}{l})} - \left[\frac{P_{\textrm{max}}}{(1+\frac{k}{l})} - A(0)\right]e^{-(l+k)t}.$    

$ \vert\boldsymbol{\vert}$


next up previous index
Next: Using Matrix Algebra Up: Methods for Solving ODEs Previous: Separation of Variables   Index

Click for printer friendely version of this HowTo

Frank Starmer 2004-05-19
>