In an analytic number theory textbook (by Jörg Brüdern) I found this exercise:
Prove $$ \prod_{p \leq x}\left(1-\frac{1}{p}\right)^{-1}=B \log x+O(1) $$ with a fitting $B\in\mathbb{R}$.
Obviously I can write $$\prod_{p\leq x}\Big(1-\frac{1}{p}\Big)^{-1}=\sum_{n\leq x}\frac{1}{n} + \sum_{n>x, p\mid n\Rightarrow p\leq x} \frac{1}{n}$$ with $p$ being prime. I showed that $$\sum_{n\leq x}\frac{1}{n} \leq 1+ \log(x) $$ and spend quite much time trying to find any upper bound for the second sum. It had various ideas but none of them worked out.
Then I got the idea to consider the product
$$\prod_{p\leq x} (1+\frac{1}{p}):(1-\frac{1}{p})^{-1}=\prod_{p\leq x} (1+\frac{1}{p})(1-\frac{1}{p})= \prod_{p\leq x} (1-\frac{1}{p^2})=O(1)$$ because this last product is converging for $x\to\infty$ (because the sum $\sum_{n=1}^\infty\vert{n^{-2}}\vert$ is converging, right?)
Since I already proved (in another exercise) that $$\prod_{p\leq x} (1+\frac{1}{p})=O(\log(x))$$
it immediately follows that $$\prod_{p\leq x}(1-\frac{1}{p})^{-1}= B\log(x)+O(1)=O(\log(x))$$
because the quotient is $O(1)$.
So my question is, is this above a valid argument to proof the statement?
And is there any "direct" way to estimate the right sum above? If so, I'd appreciate any hints on this.
Brüdern, Jörg (2013). Einführung in die analytische Zahlentheorie. Springer-Verlag.
$$ \log\prod_{p\leqslant x}\left(1-\frac{1}{p}\right)=-\sum_{p\leqslant x}\frac{1}{p}+\sum_{p\leqslant x}\left(\log\left(1-\frac{1}{p}\right)+\frac{1}{p}\right) $$ The second sum converges because the general term is $\mathcal{O}\left(\frac{1}{p^2}\right)$, as for the first sum we have the estimation $\sum_{p\leqslant x}\frac{1}{p}=\log\log x+c+\mathcal{O}\left(\frac{1}{\log x}\right)$ for a constant $c$. Therefore, using the fact that the rest of the series $\sum\frac{1}{n^2}$ is a $\mathcal{O}\left(\frac{1}{n}\right)$, we have $$ \log\prod_{p\leqslant x}\left(1-\frac{1}{p}\right)=-\log\log x+A+\mathcal{O}\left(\frac{1}{\log x}\right) $$ for a constant $A$. Finally, $$ \prod_{p\leqslant x}\left(1-\frac{1}{p}\right)^{-1}=e^A \log x+\mathcal{O}(1) $$