Weighted arithmetic-progression error bound
= Weighted arithmetic-progression error bound
Let $E_q=\max_{(a,q)=1}|\pi(x;q,a)-\operatorname{Li}(x)/\phi(q)|$. For $Q\leq x^{1-\eta}$, the <Brun–Titchmarsh theorem> and <Cauchy-Schwarz inequality> give
$$
\sum_{q\leq Q}3^{\omega(q)}E_q\ll_\eta\left(\sum_{q\leq Q}E_q\right)^{1/2}\left(\frac{x}{\log x}\sum_{q\leq Q}\frac{9^{\omega(q)}}{\phi(q)}\right)^{1/2}.
$$
Write each summand as $\sqrt{E_q}\,3^{\omega(q)}\sqrt{E_q}$, then use $E_q\ll_\eta x/(\phi(q)\log x)$.