Why is $\sum a_nf(n) = \int_0^xf(t)~d(A(t))$? This equation is a part of Abel's summation formula
$a_n$ is a sequence, $f$ is a real differentiable function such that $f'$ is Riemann integrable.$$A(x) = \sum_{1\le n\le x}a_n$$
I don't see why is $$\sum_{1\le n\le x} a_nf(n) = \int_0^xf(t)~d(A(t))$$
Isn't $d(A(t)) = 0$, because
$$A(t+h)-A(t) = 0,\text{for $t$ $\to$ 0}$$
 A: $A$ is a right-continuous step-function. It is constant on the intervals $[n-1, n)$ for all non-negative integers $n$, with a “jump height” equal to $a_n$ at $t=n$.
Now consider partitions $P =  \{ 0 = t_0 < t_1 < \ldots < t_N = x \} $ with $\operatorname{norm}(P) = \max(t_{j} - t_{j-1}) < 1$, and approximation sums
$$
 S(P, f, \alpha) = \sum_{j=1}^N f(c_j)\,(\alpha(t_j) - \alpha(t_{j-1}))
$$
with $c_j \in [t_{j-1}, t_j]$.
We have $\alpha(t_j) - \alpha(t_{j-1}) = a_n$ if the interval $(t_{j-1}, t_j]$ contains an integer $n$, and  $\alpha(t_j) - \alpha(t_{j-1}) = 0$ otherwise. It follows that
$$
  S(P, f, \alpha) = \sum_{n \le x} f(c_{j_n}) \, a_n
$$
where $j_n$ is the index of the interval $(t_{j-1}, t_j]$ containing the integer $n$.
Now if the norm of the partition approaches zero then $c_{j_n} \to n$  and therefore $f(c_{j_n}) \to f(n)$ for all the (finitely many) $n$ in the interval $[0, x]$. This shows that
$$
\int_0^x f(t) \, d(A(t)) = \sum_{1\le n\le x} f(n) \, a_n \, .
$$
Remark: Only the continuity of $f$ is needed for this conclusion, more precisely only the continuity of $f$ at the integers in the range $[0, x]$. The differentiability requirement comes into play when integration by parts is applied to $\int_0^x f(t) \, d(A(t))$, which then leads to the Abel's formula.
