Bounding this arithmetic sum

I am interesting in bounding the arithmetic sum

$$ \sum_{n \leq x} \frac{\mu(n)^2}{\varphi(n)}$$

(The motivation is that this is a sum that comes up a lot in sieving primes, in particular in the Selberg sieve.) It is not too hard to show that this is $\geq \sum_{n \leq x} \frac{1}{n} \approx \log x$, and in fact the difference be described succinctly as follows: if $s(m)$ denotes the largest squarefree factor of $m$, then

$$\sum_{n \leq x} \frac{\mu(n)^2}{\varphi(n)} = \sum_{s(m) \leq x} \frac{1}{m}$$.

In particular, one sees that the difference

$$ \sum_{n \leq x} \frac{\mu(n)^2}{\varphi(n)} – \sum_{n \leq x} \frac{1}{n} = \sum_{m > x, s(m) \leq x} \frac{1}{m}. $$

I would like to be able to bound how small this actually is. Montgomery-Vaughan cites an unpublished result of De Bruijn that is is actually $O(1)$, so I would certainly like to see that.

The closeness of these sums is rather unintuitive to me (apart from the vague comment that $\varphi(n) \approx n$ unless $n$ has a lot of distinct prime factors, which should be relatively rare), so I would also appreciate any insight into why we could expect this.

Solutions Collecting From Web of "Bounding this arithmetic sum"

Take a look at Montgomery and Vaughn chapter 2.1 exercise 17:

17. (cf. Ward 1927) Show that for $x\geq2$, $$\sum_{n\leq x }\frac{\mu^2(n)}{\phi(n)}=\log x+\gamma+\sum_{p}\frac{\log p}{p(p-1)}+O\left(x^{-1/2}\log x\right).$$

Here $\gamma$ denotes the Euler-Mascheroni constant.

Sketch: Let $f(n)/n=\mu^2(n)/\phi(n)$. Then $f(n)$ will be a multiplicative function close to $1$. Setting $g(n)=(\mu*f)(n)$ so that $f(n)=(1*g)(n)$, it follows that $g(n)$ will be very close to zero. Indeed, at the primes $$f\left(p^{k}\right)=\begin{cases}
\frac{p}{p-1} & \text{ if }k=1\\
0 & \text{ if }k\geq2
\end{cases} $$
and
$$g\left(p^{k}\right)=\begin{cases}
\frac{1}{p-1} & \text{ if }k=1\\
\frac{-p}{p-1} & \text{ if }k=2\\
0 & \text{ if }k\geq3
\end{cases} .$$

Let $G(s)=\sum_{n=1}^\infty g(n)n^{-s}$. Then $G(1)=1$ and $$G'(1)=\frac{G'(1)}{G(1)}=\sum_{p}\frac{\log p}{p(p-1)}.$$

Then by carefully splitting up the sum we can show that $$\sum_{n\leq x }\frac{f(n)}{n}=G(1)\log x+G(1)*\gamma+G'(1)+O(Error)$$ where the error term depends on the smallest $\sigma$ such that $G(\sigma)$ converges absolutely.