This is a continuation of a previous question.
Consider the sum $\sum_{d|P(z),d≤x}μ(d)\sum_{n≤x,d|n}1$, which is clearly equal to $\sum_{d|P(z),d≤x}μ(d)×(x/d+O(1))$. A text I'm reading claims this is equal to $\sum_{d|P(z),d≤x}μ(d)(x/d)+O(1)$, but I don't understand this step.
How does one show that the last step, that this sum is equal to $\sum_{d|P(z),d≤x}x/d+O(1)$?
I believe this question comes from Zeev Rudnick's 2015 lecture series on sieves (notes available here), and in particular from the lecture on the Selberg Sieve.
I'll note that these notes have two typos on the same line, both of which are fixed later. Rudnick writes $$ \begin{align} S(x, z) :=& \sum_{n \leq x} \sum_{\substack{d \mid n \\ d \mid P(z)}} \mu(d) = \sum_{\substack{d \mid P(z) \\ d \leq x}} \mu(d) \sum_{\substack{n \leq x \\ d \mid n}} 1 \\ =& \color{#cb4154}{\sum_{\substack{d \mid P(z) \\ d \leq x}} \frac{x}{d}} + \color{#228b22}{O(1)} \end{align}$$ as the last displayed equation in page 2 of those notes. The first equality is the subject of a previous question. I have colored two parts on the last line, as each have a mistake (or are confusingly written).
The red part is missing $\mu(d)$, i.e. it should read $$ \color{#cb4154}{\sum_{\substack{d \mid P(z) \\ d \leq x}} \frac{x}{d}} \to \sum_{\substack{d \mid P(z) \\ d \leq x}} \mu(d)\frac{x}{d}, $$ and the green part is actually still part of the sum, i.e. it should read $$ \color{#228b22}{O(1)} \mapsto \sum_{\substack{d \mid P(z) \\ d \leq x}} O(1). $$
This is also how Rudnick uses them later. After determining that one can choose $P(z) \leq x$ at the top of page 3, (and thus remove the $d \leq x$ bounds from the sums), Rudnick writes that $$ S(x, z) \leq x \sum_{d \mid P(z)} \frac{\mu(d)}{d} + O(\sum_{d \mid P(z)} 1), $$ which is what you get if you use the corrected versions noted above.