Estimate $ \sum_{\substack{n\leq x\\ n\in Q\\}}\log n$ and $\sum_{\substack{n\leq x\\ n\in Q\\}} n$ where $Q$ is the square-free numbers Let $Q$ be the set of squarefree numbers. I'd like to know  estimates of following sums:
$$ \sum_{\substack{n\leq x\\ n\in Q\\}}\log n \qquad\text{and}\qquad \sum_{\substack{n\leq x\\ n\in Q\\}} n. $$
These estimates may be known in the literature but I don't find an appropriate reference.
 A: If $a_n = 1$ when $n$ is squarefree and $a_n = 0$ when $n$ is not squarefree, then you are asking for estimates on $\sum_{n \leq x} na_n$ and $\sum_{n \leq x} (\log n)a_n$.  It is classical that $\sum_{n \leq x} a_n \sim (6/\pi^2)x$.
Exercise: If $\{a_n\}$ is a sequence of nonnegative numbers and $\sum_{n \leq x} a_n \sim cx^\alpha$ where $c > 0$ and $\alpha > 0$ then $\sum_{n \leq x} na_n \sim \frac{c\alpha}{\alpha+1}x^{\alpha+1}$. So if $\sum_{n \leq x} a_n \sim \frac{6}{\pi^2}x$ then $\sum_{n \leq x} na_n \sim \frac{3}{\pi^2}x^{2}$.
Exercise: If $\{a_n\}$ is a sequence of nonnegative numbers and $\sum_{n \leq x} a_n \sim cx^\alpha$ where $c > 0$ and $\alpha > 0$ then $\sum_{n \leq x} (\log n)a_n \sim cx^\alpha\log x$. So if $\sum_{n \leq x} a_n \sim \frac{6}{\pi^2}x$ then $\sum_{n \leq x} (\log n)a_n \sim \frac{6}{\pi^2}x\log x$.
Let's merge these together and generalize by multiplication with $n^b(\log n)^d$.
Exercise: If $\{a_n\}$ is a sequence of nonnegative numbers and $\sum_{n \leq x} a_n \sim cx^\alpha(\log x)^\beta$ where  $c > 0$, $\alpha > 0$, and $\beta \geq 0$ then $\sum_{n \leq x} n^b(\log n)^da_n \sim \frac{c\alpha}{b+\alpha}x^{b+\alpha}(\log x)^{\beta+d}$ where $b > -\alpha$ and $d \geq 0$.
All the proofs use partial summation.
A: We can use the asymptotic formula
$$\displaystyle \sum_{\substack{n \leq x \\ n \in Q}} 1 = \frac{6x}{\pi^2} + O(x^{1/2}).$$
This asymptotic formula is very standard and is easy to prove. For a fixed square-free integer $m$, put $N_m(x)$ for the number of positive integers $1 \leq n \leq x$ such that $m^2 | n$. Then it is clear that
$$\displaystyle N_m(x) = \frac{x}{m^2} + O (1).$$
Further, suppose that $n \leq x$ is divisible by a square $m^2$ with $m$ square-free. Then clearly $m \leq \sqrt{x}$. Using inclusion-inclusion we therefore conclude that
$$\sum_{\substack{n \leq x \\ n \in Q}} 1 = \sum_{m \leq \sqrt{x}} \mu(m) N_m(x).$$
Using the expression for $N_m(x)$ above we then find
$$\sum_{\substack{n \leq x \\ n \in Q}} 1 = \sum_{m \leq \sqrt{x}} \mu(m) \left(\frac{x}{m^2} + O(1) \right) = \sum_{m \leq \sqrt{x}} \frac{\mu(m)x}{m^2} + O (\sqrt{x}).$$
The sum on the right can be given in terms of an Euler product. In particular, using the fact that
$$\displaystyle \frac{1}{\zeta(s)} = \prod_p \left(1 - \frac{1}{p^s} \right)$$
we find that
$$\displaystyle \sum_{m = 1}^\infty \frac{\mu(m)}{m^2} = \prod_p \left(1 - \frac{1}{p^2} \right) = \frac{6}{\pi^2}.$$
Note that
$$\displaystyle \frac{6}{\pi^2} = \sum_{m \leq \sqrt{x}} \frac{\mu(m)}{m^2} + O \left(\frac{1}{\sqrt{x}} \right).$$
Hence
$$\displaystyle \sum_{\substack{n \leq x \\ n \in Q}} = \frac{6x}{\pi^2} + O (\sqrt{x}),$$
as claimed.
Using this asymptotic formula the two sums you asked for are now easy to obtain using partial summation. In particular we have
\begin{align*} \sum_{\substack{n \leq x \\ n \in Q}} \log(n) & = \log x \sum_{\substack{n \leq x \\ n \in Q}} 1 - \int_1^x \frac{1}{t} \left(\sum_{\substack{n \leq t \\ n \in Q}} 1 \right) dt \\
& = \frac{6 x \log x}{\pi^2} + O(\sqrt{x} \log x) - \int_1^x \left(\frac{6}{\pi^2} + O(t^{-1/2}) \right) dt \\
& = \frac{6 x( \log x - 1)}{\pi^2} + O(\sqrt{x} \log x)
\end{align*}
and
\begin{align*} \sum_{\substack{n \leq x \\ n \in Q}} n & = x \sum_{\substack{n \leq x \\ n \in Q}} 1 - \int_1^x \left(\sum_{\substack{n \leq t \\ n \in Q}} 1 \right) dt \\
& = \frac{6 x^2}{\pi^2} + O(x^{3/2}) - \int_1^x \left(\frac{6t}{\pi^2} + O(t^{1/2}) \right) dt \\
& = \frac{3 x^2}{\pi^2} + O(x^{3/2}).
\end{align*}
