# Sums of multiplicative functions over residue classes

It was stated in this Shiu, P. work, page 169, Theorem 2, that $$\sum_{\substack{n\le x\\ n\equiv a\pmod k}}d_r^{\ell}(n)\ll\frac{x}{k}\left(\frac{\phi(k)}{k}\log x\right)^{r^{\ell}-1}.$$

Here, $$d_r(n)$$ is the number of ways of writing $$n$$ as a product of $$r$$ factors.

I want to know if there are any stronger known results, such as (ideally) an asymptotic for this sum, or even an effective implied constant?

We can consider this in a much more general setting.

Let $$f:\mathbf{N}\to\mathbf{C}$$ be a multiplicative function. I want to know if there any asymptotics for $$\sum_{\substack{n\le x\\ n\equiv a\pmod{k}}}f(n).$$

Here $$k$$ is some fixed modulus, and $$a$$ is fixed. If we didn't have the residue class condition, we could proceed via Perron's formula. If we were to attempt this approach here though, the only way I can see this working is if we assumed equidistribution along residue classes (which is an unjustified assertion for a general multiplicative function), and divide the result we get from Perron by $$k$$.

Using the orthogonality relations for Dirichlet characters the problem reduces to estimating sums of the form $$\sum_{n\le x}\chi(n)f(n)$$. In the case of $$d_r^\ell$$ it should not be hard to derive an asymptotic using standard analytic methods, as in e.g. here. The idea is to note that $$\sum_n\chi(n)d_r^\ell(n)n^{-s}=L(s,\chi)^{2^r}F(s)$$ where $$F(s)$$ is an Euler product which converges beyond $$\sigma=1$$, then use Perron's formula and shift the contour of integration to some $$\sigma<1$$.
These kinds of problems usually only become difficult when $$k$$ grows with $$x$$.