Let $d(n)$ be the divisor function defined by $d(n) = \sum_{m|n} 1$. I am in need of estimate of the following type:
$$
\sum_{Q \leq n \leq Q + H} d^2(n) \ll H (\log (Q + H))^T
$$
where $T$ can be any positive number, and the implicit constant in $\ll$ is independent of $Q$ and $H$. I would appreciate any references or explanations on how to prove this. Thanks you very much!