Dirichlet's Test for Improper Integrals - Does g have to be Differentiable? As I understand - one of the versions of this statement is as follows:
"Assume $f,g$ integrable on all intervals of the form $[a,b]$ such that $a<b<\infty$. Let's also assume that:


*

*$\int_a^x f(t){\rm d}t$ is uniformly bounded for all $x>a$.

*$g$ is monotonously decreasing to $0$.


Then the improper integral $\int_a^\infty f(t)g(t){\rm d}t$ converges."
The only proof I found also assumed that $g$ is differentiable and than we can use integration by parts to finish the proof:
$$ \int_a^\infty f(t)g(t){\rm d}t=\left.F(t)g(t)\right|_a^\infty-\int_a^\infty F(t)g'(t){\rm d}t $$
Two questions:


*

*Is g being differentiable really necessary? if not, is there a place I can read a suitable proof?

*Even in the case above I couldn't quite figure out how to finish the proof. Some help will be much appreciated.
 A: The statement of the Dirichlet test can be proved without any assumption about the differentiability of $g$ and requires no special approximation  in terms of differentiable functions.
Taking $c_2 > c_1 > a$, by the second mean value theorem for integrals there exists $\xi \in (c_1,c_2)$ such that
$$\int_{c_1}^{c_2} f(t) g(t) \, dt   = g(c_1)\int_{c_1}^{\xi} f(t) \, dt   $$
Note that the assumption that $g$ is monotonically decreasing is required for this form of the theorem.
Since $g$ decreases to $0$ and is nonnegative, we have
$$\begin{align}\left|\int_{c_1}^{c_2} f(t) g(t) \, dt \right|  &= g(c_1)\left|\int_{c_1}^{\xi} f(t) \, dt\right| \\ &= g(c_1)\left|\int_{a}^{\xi} f(t) \, dt - \int_{a}^{c_1} f(t) \, dt \right| \\ &\leqslant g(c_1)\left(\left|\int_{a}^{\xi} f(t) \, dt\right| + \left|\int_{a}^{c_1} f(t) \, dt \right|\right) \end{align}   $$
By hypothesis there exists $B> 0$ such that $\left|\int_a^x f(t) \, dt\right| \leqslant B$ for all $x > a$, and it follows that
$$\left|\int_{c_1}^{c_2} f(t) g(t) \, dt \right| \leqslant 2Bg(c_1)$$
Since $g(t) \to 0$ as $t \to \infty$, there exists $K >a$ such that $g(c_1) < \epsilon/(2B)$ for all $c_1 >K$ and , thus,
$$\left|\int_{c_1}^{c_2} f(t) g(t) \, dt \right| < \epsilon$$
Therefore, the improper integral satisfies the uniform Cauchy criterion and is convergent.
(2) Using integration by parts
Where integration by parts (IBP)  can play a role here is in proving the second mean value theorem used to establish the Dirichlet test. This, in fact, is a broader application of IBP that relies only of the fact that $f$ and $g$ are Riemann integrable with no assumptions about differentiability.
Defining $F(x) = \int_{c_1}^x f(t) \, dt$, it can be shown that $g$ is Riemann-Stieltjes integrable with respect to $F$ and
$$\int_{c_1}^{c_2} f(t) \, g(t) \, dt = \int_{c_1}^{c_2} g dF = g(c_2)F(c_2) - g(c_1)F(c_1) - \int_{c_1}^{c_2} Fdg$$
Note that $F(c_1) = \int_{c_1}^{c_1} f(t) \, dt = 0$ and since $F$ is continuous and $g$ is monotonic we can apply the first mean value theorem for integrals to find $\xi \in [c_1,c_2]$ such that
$$\begin{align} \int_{c_1}^{c_2} f(t) \, g(t) \, dt  &= g(c_2)F(c_2) - F(\xi)\int_{c_1}^{c_2} dg \\ &= g(c_2)F(c_2) - F(\xi)( \, g(c_2) - g(c_1) \,) \\ &= g(c_1) \int_{c_1}^{\xi} f(t) \, dt + g(c_2) \int_{\xi}^{c_2} f(t) \, dt \end{align}$$
Since we can obtain the same result by replacing $g$ with $\hat{g}$ where $\hat{g}(t) = g(t) $ on $[c_1,c_2)$ and $\hat{g}(c_2) = 0$ we obtain 
$$\begin{align}\int_a^bf(t) g(t) \, dt &= \int_a^bf(t) \hat{g}(t)  \, dt  \\ &= \hat{g}(c_1) \int_{c_1}^{\xi} f(t) dt + \hat{g}(c_2) \int_{\xi}^{c_2} f(t) \, dt \\ &= g(c_1) \int_{c_1}^{\xi} f(t) dt \end{align} $$
