This seems like something that should be in discussed in the literature, but I can't find anything. Here $\pi(x)$ is the prime counting function and $\psi(x)$ is the usual sum of the Von Mangoldt function.

Are there non-trivial estimates for the quantity $\int_{1}^{N} |\psi(x) - x| dx$? The prime number theorem asserts $|\pi(x)- x/ln(x)| = o(x/ln(x))$, or, equivalently, $|\psi(x) - x| = o(x)$. Using this we trivially have the estimate $o(N^2)$ for the expression above (which we can make a bit more quantitative using quantitative forms of the pnt) however it seems plausible that this could be improved since we are asking for average case instead of worst case information about $|\psi(x) - x|$. In fact since we know that $\psi(x) - x$ oscillates to the extremes $\pm \sqrt{x}/ln(x)$ infinitely often, it seems plausible that it might spend a fair amount of time away from these extremes.