<s>[INST] Asymptotic formula of $\sum_{n \le x} \frac{d(n)}{n^a}$ As the title says, I'm trying to prove 
$$\sum_{n \le x} \frac{d(n)}{n^a}= \frac{x^{1-a} \log x}{1-a} + \zeta(a)^2+O(x^{1-a}),$$
for $x \ge 2$ and $a>0,a \ne 1$, where $d(n)$ is the number of divisors of $n$. There is a post here dealing with the case $a=1$. This is what I have done so far:
\begin{align*}
\sum_{n \le x} \frac{d(n)}{n^a} &= \sum_{n \le x} \frac{1}{n^a} \sum_{d \mid n} 1 = \sum_{d \le x} \sum_{\substack{n \le x \\\ d \mid n}} \frac{1}{n^a} = \sum_{d \le x} \sum_{q \le x/d } \frac{1}{(qd)^a} = \sum_{d \le x} \frac{1}{d^a} \sum_{q \le x/d} \frac{1}{q^a} \\\
&= \sum_{d \le x} \frac{1}{d^a} \left( \frac{(x/d)^{1-a}}{1-a} + \zeta(a) + O((x/d)^{-a}) \right) \\\
&= \sum_{d \le x} \left( \frac{x^{1-a}}{d(1-a)} + \frac{\zeta(a)}{d^a} \right) + O(x^{1-a}),
\end{align*}
from here things start to go out of hand... I've tried using the relevant formulas from this page, but I can't get it to "fit". Any help would be appreciated.
 [/INST] What you're trying to show isn't true.  You should have $\zeta(a)^2$ rather than $\zeta(a)$.  (See Exercise 3.3 in Apostol's number theory book in the link above.)  
With that correction, you're almost there!  Picking up where you left off we have, and using two of the formulas in Apostol's text in the link above,
$$
\begin{align}
&\sum_{d \le x} \left( \frac{x^{1-a}}{d(1-a)} + \frac{\zeta(a)}{d^a} \right) + O\left(x^{1-a}\right) \\
&= \frac{x^{1-a}}{1-a} \sum_{d \le x} \frac{1}{d} + \zeta(a) \sum_{d \le x}\frac{1}{d^a}  + O\left(x^{1-a}\right) \\
&= \frac{x^{1-a}}{1-a} \Big(\log x + O(1)\Big) + \zeta(a) \left(\frac{x^{1-a}}{1-a} + \zeta(a) + O(x^{-a})\right)  + O\left(x^{1-a}\right) \\
&= \frac{x^{1-a} \log x}{1-a} + \zeta(a)^2 + O\left(x^{1-a}\right). \\
\end{align}
$$
</s>