Need help with a certain integrating technique

How do I integrate this?

$$\frac{\text{d}P}{\text{d}t} = \frac{(r(t) - B)}{z} \cdot P(t) + c\cdot w$$

The t is just the top limit in the integral.

Let me be more specific. I have this:

$$\frac{dP}{dt} = g(t)P(t) + k$$ where $k$ is a constant and $g(t)$ is any function of $t$, is to put all $P(t)$ on the same side and multiply as such: \begin{eqnarray*} \frac{dP}{dt} - g(t)P(t) &=& K\\ e^{\int^t-g(s)ds}\frac{dP}{dt} - g(t)e^{\int^t-g(s)ds}P(t) &=& Ke^{\int^t-g(s)ds}\\ \frac{d}{dt}\Big(e^{-\int^t g(s)ds}P(t)\Big) &=& Ke^{\int^t-g(s)ds} \end{eqnarray*}

-
What is the lower limit? –  Amzoti Nov 19 '13 at 7:12
Which function is $g$? –  P.. Nov 19 '13 at 7:14
I edited my post to be more specific –  Jackson Hart Nov 19 '13 at 7:19
Check most recent update –  Jackson Hart Nov 19 '13 at 7:23
So you just actually need help solving this differential equation using an integration factor? –  dreamer Nov 19 '13 at 7:23
show 1 more comment

(Assuming you just want to solve the differential equation that you stated).

Note: it was stated in the comments that it may be assumed that $r(t)=at$

$g(t)=\frac{at-B}{z}$

$\dfrac{dP}{dt} = g(t)P(t) + k \iff \dfrac{dP}{dt}-gP=k$

Use $e^{-\int g dt}=e^{-\int\frac{at-B}{z}dt}=e^{\frac{Bt-\frac{a}{2}t^2}{z}}$ as your integrating factor.

Then $e^{\frac{Bt-\frac{a}{2}t^2}{z}}\dfrac{dP}{dt} -\frac{at-B}{z}e^{\frac{Bt-\frac{a}{2}t^2}{z}} P=ke^{\frac{Bt-\frac{a}{2}t^2}{z}}$

Or equivalently, $\dfrac{d}{dt}\left(e^{\frac{Bt-\frac{a}{2}t^2}{z}}P \right)=ke^{\frac{Bt-\frac{a}{2}t^2}{z}}$,

From here you would need to integrate on both sides, but that doesn't seem like a walk in the park (the expression on the right hand side could in fact only be expressed in terms of error functions).

-
Thank you for the help! But how do I integrate? that was my question from the beginning –  Jackson Hart Nov 19 '13 at 7:42
@JacksonHart The thing is, we don't really know much about your function $g$, in fact, not even every general function $g$ is integrable. So I'm not sure if it is possible to work this out further (if you would give me a specific function $g$ I could do it, but that's not the case here). –  dreamer Nov 19 '13 at 7:47
If you scroll to the very very top I added the function. You can see what I called "g" –  Jackson Hart Nov 19 '13 at 7:49
@JacksonHart Ah ok, the text is slightly confusing because later on you say that $g$ is any general function of $t$. Are $B$ and $z$ constants? –  dreamer Nov 19 '13 at 7:50
yes but r(t) is not –  Jackson Hart Nov 19 '13 at 7:52