Let $\psi(x)=\sum\_{n\leq x} \Lambda(n)$ be the weighted prime counting function. I am trying to evaluate the integral $$\kappa:=\int\_{1}^{\infty}\frac{\psi(x)-x}{x^{2}}dx$$ in several different ways. Originally, this integral came up as a particular part in a particular case for a a formula for a summatory function I was looking at. From now on, let $\gamma$ refer to the Euler-Mascheroni constant. 


(Now Corrected:) I found a fun, elementary approach to this integral which gave $\kappa=-1-\gamma$ if we assume the quantitative prime number theorem. (Precisely, we just need to assume that this integral is absolutely convergent. ) Since I am not too confident about this, I naturally wanted to check by complex analytic methods to see if my answer was correct. My question then is: 



> 
> What other ways can be used to prove this identity? 
> 
> 
> 


I feel like knowing many approaches to this problem will give a greater understanding of certain properties of these functions. A friend suggested that it must be related to the logarithmic derivative of $\zeta(s)$, and certain special values, but I cannot see how to use this.


Thanks a lot!


**Additional Remark:** 


I attempted to use the explicit formula for $\psi(x)$, and deduced $\kappa=-\gamma-1$. Originally I felt this was wrong, but after reading Julian Rosen's answer I think it is correct. Here is the alternate solution:


Substituting in the explicit formula, and then integrating termwise we have$$\kappa=\int\_{1}^{\infty}\left(-\sum\_{\rho}\frac{x^{\rho-2}}{\rho}-\frac{\log2\pi}{x^{2}}-\frac{\log\left(1-x^{-2}\right)}{2x^{2}}\right)dx=\sum\_{\rho}\frac{1}{\rho(\rho-1)}-\log2\pi+1-\log2$$since


$$\frac{1}{2}\int\_{1}^{\infty}\frac{\log\left(1-x^{-2}\right)^{-1}}{x^{2}}dx=\frac{1}{2}\int\_{1}^{\infty}\sum\_{i=1}^{\infty}\frac{1}{ix^{2i+2}}dx=\sum\_{i=1}^{\infty}\frac{1}{2i(2i+1)}=1-\log2.$$As $$\sum\_{\rho}\frac{1}{\rho(\rho-1)}=\sum\_{\rho}\frac{1}{\rho-1}-\frac{1}{\rho}=-\sum\_{\rho}\frac{1}{1-\rho}+\frac{1}{\rho}=2B=-\gamma-2+\log4\pi$$it follows that $\kappa=-\gamma-1$.



Evaluating the integral $\int_0^\infty \frac{\psi(x)-x}{x^2}dx.$
Consider $f(s):=\int\_1^{\infty}\frac{\psi(x)-x}{x^s}dx$, which converges for $Re(s)\geq2$. For $Re(s)>2$, we can separate the numerator and integrate by parts (using the Riemann-Stieltjes integral, for convenience) to get $f(s)=\frac{1}{s-1}\int\_1^{\infty}\frac{1}{x^{s-1}}d\psi(x)-\frac{1}{s-2}$. Now, $\frac{\zeta'}{\zeta}(s)=-\sum\frac{\Lambda(n)}{n^s}=-\int\_1^{\infty}\frac{1}{x^s}d\psi(x)$, so we can write $f(s)=\frac{-1}{s-1}\frac{\zeta'}{\zeta}(s-1)-\frac{1}{s-2}$. $\frac{\zeta'}{\zeta}(s-1)$ has a Laurent expansion at $s=2$ of the form $\frac{\zeta'}{\zeta}(s-1)=\frac{-1}{s-2}+\gamma+O(s-2)$, so that $f(s)=\frac{-1-\gamma}{s-1}+O(s-2)$. This holds for $Re(s)>2$, but if we let $s$ decrease to 2 and use the dominated convergence theorem, we get that the value of the integral is $-\gamma-1$.


Hmm...this isn't quite the same as either value you gave. Maybe I made a mistake somewhere.


