# Using an integrating factor to solve an ODE

I have been simply asked to integrate the following: $dc/dt = 1-c-a c$.

I have used the integrating factor as $e^{(1+a) t}$.

Then finish with $c=1/(1+a)$, however my lecturer gets $c=\frac{1}{1+a}(1-e^{(a+1)t})$.

Could anyone at all show me the method to get this. I know it is meant to be a relatively easy question, but i just don't know what i am doing wrong.

Thank you.

-
Separate variables. –  David Mitra May 9 '12 at 15:47
Is $e$ a constant or a function of $(1 + a) t$? –  tentaclenorm May 9 '12 at 15:48
Is $*$ a convolution? (Only computer languages use $*$ for multiply.) –  GEdgar May 9 '12 at 15:54
sorry when i typed it the computer changed things, * is just multiplication. When i use the method of an integrating factor, my integrating factor is exp((1+a)t), so not e the constant. I thought i couldn't use separation of variables for this type of problem? –  R.M May 9 '12 at 15:59

I don't think integrating factors are needed here.

Note that \begin{align} t &=\int\frac{\mathrm{d}c}{1-(a+1)c}\\ &=-\frac{1}{a+1}\log(1-(a+1)c)+t_0\tag{1} \end{align} Solving $(1)$ yields \begin{align} c &=\frac{1}{a+1}\left(1-e^{-(a+1)(t-t_0)}\right)\\ &=\frac{1}{a+1}-\left(\frac{1}{a+1}-c_0\right)e^{-(a+1)t}\tag{2} \end{align} $c=\dfrac{1}{a+1}$ is a particular solution of $(2)$ with $c_0=\frac{1}{a+1}$ ($t_0=-\infty$),

-
ahhhhh thank you, in yours you have $t-t_o$ whereas he just has t, are you allowed to just put t there? –  R.M May 9 '12 at 16:03
@R.M: $t_0$ is the constant of integration. It can be anything, $0$ is fine. Since we could have written $e^{-(a+1)(t-t_0)}=Ce^{-(a+1)t}$, we could set $C=0$ which would be the same as setting $t_0=-\infty$; this is why $t_0=-\infty$ is valid. –  robjohn May 9 '12 at 16:10
@R.M you can determine the explicit value of $t_0$ if you are given an initial condition for your problem. Presumably, your lecturer used $c(0) = 0$ to conclude that $t_0 = 0$. –  tentaclenorm May 9 '12 at 16:12
Thank you so much everyone!!!! –  R.M May 9 '12 at 16:15

$$\frac{dc}{dt}+(1+a)c = 1$$ multiply by integrating factor $e^{(1+a)t}$: \begin{align} &e^{(1+a)t}\frac{dc}{dt}+(1+a)e^{(1+a)t}c=e^{(1+a)t} \\ &\frac{d}{dt}\left(e^{(1+a)t}c\right)=e^{(1+a)t} \\ &e^{(1+a)t}c = \int e^{(1+a)t}\,dt = \frac{e^{(1+a)t}}{1+a}+A \\ &c = \frac{1}{1+a}+Ae^{-(1+a)t} \end{align} for some constant $A$. Presumably there is an initial condition (that R.M. has not told us) to let the lecturer determine the constant $A$

-
no we aren't given any IC's either which is why i'm so confused by it all. but thanks so much!!! –  R.M May 9 '12 at 16:11
Although I was able to solve this without integrating factors, if the right side of your first equation were not a function of $c$, an integrating factor would most likely be necessary. (+1) –  robjohn May 9 '12 at 16:54

what @robjohn said is true:

because of the nature of this equation it is separable so an integrating factor is not strictly necessary. but because you requested it be done in that method:

first consider the form of the equation for an integrating factor:
A differential equation of the form $y' + P(x)y = Q(x)$ can be solved by
$y = \frac{\int{\mu Q(x)} dx}{\mu} + \frac{k}{\mu}$ where $k$ is an arbitrary constant and $\mu$ is the integrating factor ($\mu = e^{\int{P(x)}dx}$)

Let's fit your equation into the form needed for the method of integrating factors (In your case, $y$ is $c$ ):

$c' + c(1+a) = 1$

so you should obtain for an integrating factor of $\mu = e^{\int{(1+a)}dt} = e^{t(1+a)}$

so $c = \frac{1}{e^{t(1+a)}} \int{(e^{t(1+a)})dt} + \frac{k}{e^{t(1+a)}}$

if you integrated correctly, you should get $\int{(e^{t(1+a)})dt} = \frac{1}{1+a}e^{t(1+a)}$ which you will find nicely cancels with the integrating factor, $\mu$ which is already in the denominator. So your final answer should be

$c = \frac{1}{1+a} + \frac{k}{e^{t(1+a)}} = \frac{1}{1+a} + ke^{-t(1+a)}$

-