Wikipedia's page (here) on the average order of arithmetic functions gives the following as a means of finding such an order using Dirichlet Series:
Define $f$ as an arithmetic function on $n$, and define a function $F$ by $F[n]=\sum_{d | n}f(d)$. Obviously the $d$ here are the divisors of $n$. However, the page then states
$$\sum_{n \le x}F(n) = \sum_{d \le x}f(d)\!\!\sum_{n \le x,d\mid n}1 = \sum_{d \le x}f(d)[x/d]$$
The bit that's confusing me this: on the right hand side, what is meant by $\sum_{d \le x}f(d)$? It can't mean the divisors of $n$ or $x$, because the other half of the expression is $\sum_{n \le x,d | n}f(d)[x/d]$ - so if a sum is to be taken over divisors, that's the notation they're using.
Can someone please explain?
Let $S$ be the finite set of ordered pairs of positive integers $(n, d)$ such that $d \mid n \leqslant x.$ (The value of the real number $x \geqslant 1$ is fixed throughout, so we don't need to include it in the notation for $S.$)
For each positive integer $n$ such that $n \leqslant x,$ let $T(n)$ be the subset of $S$ consisting of all ordered pairs $(n, d)$ such that $d \mid n.$ Similarly, for each positive integer $d$ such that $d \leqslant x,$ let $U(d)$ be the subset of $S$ consisting of all ordered pairs $(n, d)$ such that $d \mid n.$ Note, for later use: $$ |U(d)| = [x/d], \text{ for all } d \leqslant x. $$
We have two different partitions of the same finite set $S$: $$ \bigcup_{n \leqslant x}T(n) = S = \bigcup_{d \leqslant x}U(d). $$ It follows that for any function $g \colon S \to \mathbb{N},$ $$ \sum_{n\leqslant x}\sum_{d \mid n}g(n, d) = \sum_{n\leqslant x}\sum_{d \in T(n)}g(n, d) = \sum_{(n, d) \in S}g(n, d) = \sum_{d \leqslant x}\sum_{n \in U(d)}g(n, d) = \sum_{d \leqslant x}\sum_{d \mid n}g(n, d). $$ Given a function $f \colon \mathbb{N} \to \mathbb{N},$ define $g \colon S \to \mathbb{N},$ $(n, d) \mapsto f(d).$ Applying the above identity, we get: $$ \sum_{n\leqslant x}\sum_{d \mid n}f(d) = \sum_{d \leqslant x}\sum_{n \in U(d)}f(d) = \sum_{d \leqslant x}\sum_{d \mid n}f(d). $$ I think the middle formula is easier to read then the right hand one, because it makes it clear that for each value of $d \leqslant x,$ the inner sum is a sum of the constant term $f(d)$ over a finite set of values of $n,$ so all that matters in it is the number of values of $n.$
Substituting the expression for $F(n),$ we get: $$ \sum_{n \leqslant x}F(n) = \sum_{d\leqslant x}\sum_{n \in U(d)}f(d) = \sum_{d\leqslant x}f(d)\!\!\sum_{n \in U(d)}1 = \sum_{d\leqslant x}f(d)|U(d)| = \sum_{d\leqslant x}f(d)[x/d]. $$