# Bounding the finite sum of $\frac {\log n}{n}$

So I'm completely lost in my class on Additive Number Theory.

I've been trying to show that there exists a constant B such that

$$\sum_{n \le x}\frac{\log n}{n} = \frac{1}{2}\log ^2x + B + O\left(\frac{\log x}{x}\right)$$

I've honestly been working on it all night and can't come up with a good way to approach the problem!! Help!!!

The foreign O notation is really messing with me.

-
You really need to get comfortable with the $O$ notation if you're going to do number theory. – Robert Israel Oct 24 '12 at 0:20
Big hint: You shouldn't need much more than the Euler-Maclaurin formula: en.wikipedia.org/wiki/Euler%E2%80%93Maclaurin_formula (along with knowing how to compute $\int\frac{1}{x}\log x\, dx$) – Steven Stadnicki Oct 24 '12 at 0:22

$$\sum_{n=1}^{N} a(n) f(n) = \int_{1^-}^{N^+} f(t) d(A(t)) = f(t) A(t) \rvert_{1^-}^{N^+} - \int_{1^-}^{N^+} A(t) f'(t) dt$$ (The second integral can be interpreted as a Riemann-Stieltjes integral.)
Consider the sum $\displaystyle \sum_{n \leq N} \frac{\log(n)}n$. Choose $a(n) = 1$ and $f(n) = \frac{\log(n)}n$ and you will get what you want.