Is there a sensible way to regularize $\int_0^\infty \tan x\, dx$? I wonder if there is any sensible generalization of regularization which would be able to ascribe finite values to $\int_0^\infty \tan x \,dx$ and $\int_{-\infty}^0 \psi(x)dx$?
Perticularly, since $\tan x$ starts with a positive segment, $\int_0^\infty \tan x\, dx$ logically should be either positive or at least non-negative (compare $\int_0^\infty \sin x\, dx$ which sums up to $1$ using Cesaro integration).
On the other hand the fact that the centers of mass of positive and negative segments coincide in each period, speaks in favor of the natural regularization being zero.
 A: Two pieces of good news.  


*

*The formulae $\int_{0}^\infty \sin(x)\,dx=1$ and $\int_0^\infty \tan x\,dx=\ln 2$ hold.  (Can‘t say anything about $\psi$ since I don‘t know what it means).

*These are not the result of dodgy ad hoc formal manipulations but are valid within an elementary and mainstream mathematical theory which has been around  for over 60 years and is well documented in the literature—that of definite integrals of distributions.
Roughly speaking, every distribution on the line has a primitive and so one can reduce the problem of defining such definite integrals to that of the limit of a distribution at a point (possibly infinite).  This is, as I said, standard and elementary (and was investigated by several rather prominent mathematicians).  Should you display any interest in checking this theory out, I would be delighted to hunt down some references for you.
A: Well, after some thinking, I came to the following method.
To find $\int_0^\infty \tan x\, dx$ we have to subtract from the mean value of the antiderivative at infinity its value at $0$. This follows the spirit of Cesaro integration.
An antiderivative of $\tan x$ (if interpreted in the sense of principal value) is $-\ln |\cos x|$.
Its value at zero is zero, so we only have to find its mean at infinity.
The mean value of that function over period is $\frac1{\pi}\int_0^{\pi } (-\ln |\cos x|) \, dx=\ln 2$, the same is its mean value at infinity.
The Cesaro mean of the antiderivative of $\tan x$ clearly approaches $\ln 2$:

Thus the answer to the question is $\ln 2$.
I will update the post regarding the integral $\int_{-\infty}^0 \psi(x)dx$.
