# Integrating a simple equation

I am trying to integrate a simple function:

$\frac{dA}{dt} = j - kA(t)$

where j and k are constants, and $A(0)=A_0$ is also a constant. I got to

$A(t) = jt + C - k\int A(t)dt$

but I dont know how to proceed now. Could you help me out please? I know the answer is

$A(t) = e^{-k*t} (A_0+ \frac{j}{k}e^{k*t} -1)$

How can I get there? thanks so much

-

If $k=0$, this is is easy. Suppose $k\neq 0$.

Let's first rewrite it as $$\frac{dA}{dt}+kA=j.$$ Multiplying both sides by the positive function $e^{kt}$ gives us $$e^{kt}\frac{dA}{dt}+ke^{kt}A=je^{kt}.$$ Using the product rule on the left side, we have $$\frac{d}{dt}\left[e^{kt}A\right]=je^{kt}.$$ Integrating with respect to $t$, we then have $$e^{kt}A=j\int e^{kt}\,dt=\frac{j}{k}e^{kt}+C,$$ and so $$A(t)=\frac{j}{k}+Ce^{-kt}.$$ Using our initial value to find $C$, we get $$A(t)=\frac{j}{k}+\left(A_0-\frac{j}{k}\right)e^{-kt}.$$

-
Thanks Cameron! –  Sosi Nov 13 '12 at 11:32
by the way, how can I write down all the expressions in the correct formatting in here? do you use latex or something? –  Sosi Nov 13 '12 at 11:42
LaTeX is the preferred method to use. If you're ever curious about a particular formatted bit, right-click on it, then choose Show Math As-->TeX Commands. –  Cameron Buie Nov 13 '12 at 11:48

Do you know that the solution to $\frac {dA}{dt}=-kA$ is $A(0)\exp^{-kt}$? You can see that (not a proof) by differentiating and plugging in. If so, define $B(t)=A(t)-\frac jk$. Then the answer you give just pulls out the factor $e^{-kt}$

-
thanks Ross! I'll check it out! –  Sosi Nov 12 '12 at 16:46