# How to solve the differential equation $dN/dt=aN-\mu t$ in terms of $t$, $a$, $\mu$ and $N(0)$

The number, $N$, of animals of a certain species at time $t$ years increases at a rate of $aN$ per year by births, but decreases at a rate of $\mu t$ per year by deaths, where $a$ and $\mu$ are positive constants.

Modelled as continuous variables, $N$ and $t$ are related by the differential equation: $$dN/dt=aN-\mu t$$

Given that $N=N(0)$ when $t=0$, find $N$ in terms of $t$, $a$, $\mu$ and $N(0)$.

-
integrating factor method hint: $e^{at}(e^{-at}N)'=N'-aN$. –  anon Jul 14 '12 at 17:29
This is just a very standard first-order linear ODE... What have you tried? –  KennyTM Jul 14 '12 at 17:29
I know how to use integrating factor to solve this type of questions, but I'm confused by the "Given that $N=N(0)$ when t=0 and express N in terms of $N(0)$ and ...". –  Vic. Jul 15 '12 at 2:55

You can use an integrating factor.

$$e^{-at}N'(t) - ae^{-at}N(t) = -\mu t e^{-at}$$

Now undo the product rule.

$$\left(e^{-at} N(t)\right)' = -\mu te^{-at}$$

Now integrate to see that $$e^{-at}N(t) - N(0) = -\mu \int_0^t se^{-as}\,ds.$$

To finish, integrate by parts and solve for $N$.

-
@anon fixed the omission Thanks. –  ncmathsadist Jul 14 '12 at 17:34