
\[\sum_{n\leq x}d\left(n\right)=x\ln x+(2\gamma-1)x+O\left(\sqrt{x}\right),\]