Trouble Solving A Differential Equation Involving Integrating Factor

The equation of motion of a train is given by $$m\frac{\mathrm{dv} }{\mathrm{d} t} = mk(1-e^{-t})-mcv$$ where $v$ is the speed,$t$ is the time and $m,k,c$ are constants.How to find $v$ when $v=0$ and $t=0$. This is what i've tried so far $$\frac{\mathrm{dv} }{\mathrm{d} t}=k(1-e^{-t}-cv)$$ after seperating and factoring $m$.Now I Don't know how to put this in $$\frac{\mathrm{dy} }{\mathrm{d} x}+Py = Q$$ form and figure out the integrating factor.Please Help.

Thank You.

-

Hint: $$k(1-e^{-t}-cv) = k(1-e^{-t}) - ckv.$$ What happens if you put $P=ck$?

-
I get $k(1-e^{-t})-Pv$ – alok Aug 28 '12 at 11:31
So the equation is $$\frac{dv}{dt}+ckv = k(1-e^{-t}).$$ It is a linear equation as you wanted. But maybe I do not understand your question. The integrating factor is always the same: en.wikipedia.org/wiki/… – Siminore Aug 28 '12 at 11:33
Yes.It's a linear equation as i wanted.Now what is $\int Pdx$> – alok Aug 28 '12 at 11:38
In my opinion, you should now try to do your homework by yourself. You should compute the primitive of a constant function... – Siminore Aug 28 '12 at 11:40

Let's start by re-arranging the equation:

$\dot{v} + cv = k(1-e^{-t}) \, .$

Clearly $P(t) = c$ and so the integrating factor is $\mu = e^{\int \! c \, dt} = e^{ct},$ and we shall consider

$e^{ct}\dot{v} + ce^{ct}v = ke^{ct}(1-e^{-t}) \, ,$

$\frac{d}{dt} \, (e^{ct}v) = ke^{ct}(1-e^{-t}) \, ,$

$e^{ct}v = k\left(\frac{e^{ct}}{c} - \frac{e^{t(c-1)}}{c-1} \right) + \alpha \, ,$

$v(t) = k\left(\frac{1}{c} - \frac{e^{-t}}{c-1} \right) + \alpha e^{-ct} \, .$

Notice that $\alpha$ is a fixed constant: the constant of integration.

-