Doubt in exercise 3.1.12 of Book Problems in analytic number theory by My Ram Murthy While trying problems from above mentioned book I am unable to think about how to prove the question which I am writing below. 

Question is ->If limit x->$\infty \frac {π(x) } {x/log(x) } $ = $\alpha$ 
  Then show that $\sum_{p\leq x} 1/p = \alpha log log(x) + o(log log(x) ) $  . 
What I thought ->taking a(n) = 1 if n = prime, 0 otherwise and f(n) = 1/n and using abel summation formula I got $\sum_{p\leq x } 1/p = π(x) / x + \int_{2}^x  \frac {π(x) } {t^2} dt $ . 

Now  using $\int_{2}^x = \int_{2}^{\infty} -\int_x^{\infty} $  I get  π(x) = O(1/log (x) ) + O $(\int_2^{\infty} \frac {1} {t logt } dt -  \alpha \int_x^ {\infty} \frac {1} { t logt } dt )$ . 
Now the problem is $ loglog (\infty) $ diverges. 
Can someone please tell where I am doing mistake in integral. 
I tried this problem yesterday also but couldn't solve it. Please help. 
 A: You are applying the partial summation in a completely wrong way.
$$\sum_{p\le x} 1/p=\sum_{n\le x} \frac{\pi(n)-\pi(n-1)}{n}=\frac{\pi(x)}{x}+\sum_{n\le x-1} \pi(n)(\frac1n-\frac1{n+1})$$ $$= \frac{\frac{x}{\log x}a(1 +o(1))}{x}+\sum_{n\le x-1}\frac{n a(1 +o(1))}{\log n} \frac{1+o(1)}{n^2}= a(1+o(1))\log \log x$$
(the last step is because the derivative of $\log \log x$ is $\frac1{x\log x}$)
Note that since $\ell=\sum_p 1/p^2$ converges, we do it the opposite way : 
$$\sum_{p< x} 1/p^2=\ell-\sum_{p\ge x}1/p^2=\ell-\frac{\pi(x)}{x^2}-\sum_{n\ge x} \pi(n)(\frac1{n^2}-\frac1{(n+1)^2})$$
The integral version is the same, just replace $\frac1n-\frac1{n+1}=\int_n^{n+1} \frac1{t^2}dt$
A: This will be the same solution in a different language... I like using Stieltjes integrals and integrating by parts better than Abel transforms (which is the same):
$$
\sum_{p\le x} \frac1p = \int_{2-}^x \frac{\mathrm{d}\pi(t)}{t} 
= \left[\frac{\mathrm{d}\pi(t)}{t}\right]_{2-}^x-\int_{2-}^x \pi(t)\mathrm{d}\left(\frac1t\right) 
= \frac{\pi(x)}{x}+\int_{2}^x\frac{\pi(t)}{t^2} \mathrm{d}t.
$$
After this point we just have to replace $\pi(t)$ by $\alpha\frac{t}{\log t}$, knowing that $\int_2^x\frac{\mathrm{d}t}{t\log t} = \log\log x+O(1)$:
$$
\left|\sum_{p\le x} \frac1p-\alpha\log\log x\right| =
\left|\int_{2}^x\frac{\pi(t)}{t^2} \mathrm{d}t
-\int_{2}^x\frac{\alpha\frac{t}{\log t}}{t^2} \mathrm{d}t +O(1)\right|
\le \int_{2}^x\frac{\Big|\frac{\log t}{t}\pi(t)-\alpha\Big|}{t\log t} \mathrm{d}t+O(1).
$$
For every fixed $\varepsilon>0$ there is some $K=K(\varepsilon)$ such that 
$\Big|\frac{\log t}{t}\pi(t)-\alpha\Big|<\varepsilon$ for $t\ge K$, so
$$
\int_{2}^x\frac{\Big|\frac{\log t}{t}\pi(t)-\alpha\Big|}{t\log t} \mathrm{d}t
=\int_2^K+\int_K^x \le O_\varepsilon(1)+\int_K^x\frac{\varepsilon}{t\log t} \mathrm{d}t = \varepsilon\log\log x + O_\varepsilon(1);
$$
$$
0 \le 
\limsup_{x\to\infty} \left|\frac{\sum_{p\le x} \frac1p}{\log\log x}-\alpha\right| 
\le 
\limsup_{x\to\infty} \left(\varepsilon+\frac{O_\varepsilon(1)}{\log\log x}\right)
=\varepsilon
$$
This holds for all $\varepsilon>0$, so
$$
\lim_{x\to\infty} \left|\frac{\sum_{p\le x} \frac1p}{\log\log x}-\alpha\right| = 0.
$$
