TITLE: How to proof the following Gronwall type inequality?
QUESTION [5 upvotes]: Suppose that $g,k:  [0,a] \to \mathbb R$ are continuous, $a >0 $, $\,k(t) \ge 0$,$\ c(t) \in C^1([0,a])$, $\, \dot c(t) \ge 0  $ (i.e. $c(t)$ is non decreasing) and  $g(t)$ satisfies $$g(t) \le c(t) + \int^{t}_{0} k(s) g(s)ds$$ for all $0  \le t \le a$. 
I want to show that for all $t \in [0,a]$, $$ g(t) \le c(t)e^{\int^{t}_{0} k(s) ds} $$ 
I have noticed that there is a proof for a more general case in wikipedia. However, I do not quite understand the proof and since the above is a less general case, I would guess that there is a simpler way to prove it. 
Let $G = c(t) + \int^{t}_{0} k(s) g(s)ds $. Then $G \in C^1([0,a])$. Taking the derivative, $$\dot G = \dot c + k(t)g(t) \\  \dot c =  \dot G - k(t)g(t)  \ge \dot G - k(t)G(t)$$. 
I am stuck here and not sure if I am going in the right direction. I suppose the goal is to reach $$ \frac{d}{dt} (G(t)e^{-\int^{t}_{0} k(s)ds}) \le\frac{d}{dt} c(t) $$ and integrate both sides. Any hints would be appreciated.

REPLY [3 votes]: Almost as in the answer of user161825, but with correct estimation.
Since $k(t) \geq 0$, we have $\int_0^t k(s) ds \geq 0$. Hence, 
$$
0 < e^{-\int_0^t k(s) ds} \leq 1.
$$
Therefore, since $c' \geq 0$, we get 
$$
\left(G'(t) - k(t) G(t) \right) e^{-\int_0^t k(s) ds} \leq c' e^{-\int_0^t k(s) ds} \leq c'.
$$
However, 
$$
\frac{d}{dt}\left( G(t) e^{-\int_0^t k(s) ds} \right) = G'(t) e^{-\int_0^t k(s) ds} - k(t) G(t) e^{-\int_0^t k(s) ds} = \left(G'(t) - k(t) G(t) \right) e^{-\int_0^t k(s) ds}.
$$
And thus,
$$
\frac{d}{dt}\left( G(t) e^{-\int_0^t k(s) ds} \right)  \leq \frac{d}{dt} c.
$$