Originally Posted by

**chiph588@** $\displaystyle d\mid n \iff \frac{n}{d}\mid n $.

Therefore $\displaystyle \sum_{d\mid n} A(d)B\left(\frac{n}{d}\right) = \sum_{\frac{n}{d}\mid n} A(d)B\left(\frac{n}{d}\right) $.

Let $\displaystyle q=\frac{n}{d} \implies d=\frac{n}{q} $

Thus $\displaystyle \sum_{d\mid n} A(d)B\left(\frac{n}{d}\right) = \sum_{\frac{n}{d}\mid n} A(d)B\left(\frac{n}{d}\right) = \sum_{q/mid n} A\left(\frac{n}{q}\right)B(q) $.

In summary, the identity you're trying to prove simply reverses the order in which the terms are summed.