Malthus Model - Solution Differential Equation I have this equation of a time dependent Malthus model with a term representing a time dependent immigration:
$$N'(t)=r(t)N(t) + m(t)$$
with $r(t)$ and $m(t)$ both continuous and periodic with Period $T$.
I have to prove that the function
$$N_\infty (t)=\int_{-\infty}^t exp\biggl(\int_s ^t r(\sigma)d\sigma\biggr)m(s)ds$$
is a solution of the ODE above.
I tried to derive $N_\infty (t)$ to obtain our ODE, but unsuccessful. I think that I do somethings wrong on the calculation.
I know that the derivative of an integral is so computed:
Let $G(t):=\int_a^x f(t)dt$. Then $G'(t)=f(x)$
So in our case I did:
$$N'_\infty (t)= exp\biggl(\int_s ^t r(\sigma)d\sigma\biggr)m(t)$$
But I think I miss something. Someone can help me please?
 A: With $a$ in the domain of definition let $R(t) = \int_{a}^{t}r(s)ds$ so that $R'(t) = r(t)$. Then if we use the theory of an integrating factor
$$\frac{d}{dt}\left(N(t)\exp(-R(t))\right) = \exp(-R(t))m(t).$$
Integrating this with respect to $t$ gives us
$$N(t)\exp(-R(t))-N(a) = \int_{a}^{t}\exp(-R(s))m(s)ds.$$
Therefore the solution is given by
$$N(t) = N(a)\exp(R(t))+\exp(R(t))\int_{a}^{t}\exp(-R(s))m(s) = N(a)\exp\left(\int_{a}^{t}r(s)ds\right)+\exp\left(\int_{a}^{t}r(s)ds\right) \int_{a}^{t}\exp(-R(s))m(s)ds.$$
A: The derivative of $N_\infty(t)$ is incorrect. To calculate its derivative the Leibniz integral rule should be used because the variable $t$ is in the integral sign as well as in the integrand.
$$ N^\prime_\infty (t) = exp\left(\int_t^t r(\sigma)\,d\sigma\right) m(t) + \int_{-\infty}^t r(t)\, exp\left(\int_s^t r(\sigma)d\sigma\right) m(s)\,ds $$
Now the second term is equal to r(t)N(t)
$$ r(t)N(t) = \int_{-\infty}^t r(t)\, exp\left(\int_s^t r(\sigma)d\sigma\right) m(s)\,ds $$
Moreover
$$ exp\left(\int_t^t r(\sigma)\,d\sigma\right) = exp(0) = 1 $$
Then, replacing in $N^\prime_\infty(t)$
$$ N^\prime_\infty (t) = m(t) + r(t)N(t) $$
which is the ODE. So that solution satisfies it.
