Is is possible to evaluate $\int \frac{1-\text{sech}(\pi x)}{x} \, dx$ to some reasonable form? Is it possible to evaluate this integral to some reasonable formula?
$$\int \frac{1-\text{sech}(\pi  x)}{x} \, dx$$
I used integration by parts and got this result:
$$\int \frac{1-\text{sech}(\pi  x)}{x} \, dx=-\frac{2}{\pi} \int \frac{\tan ^{-1}\left(\tanh \left(\frac{\pi  x}{2}\right)\right)}{x^2} \, dx+\log (x)-\frac{2 \tan ^{-1}\left(\tanh \left(\frac{\pi  x}{2}\right)\right)}{\pi  x}$$
Hoping for simplifying somehow $\tan ^{-1}\left(\tanh \left(\frac{\pi  x}{2}\right)\right)$ but without any success.
 A: One method is to use the series expansion for $\text{sech}(x)$ in the form
$$ \text{sech}(x) = \sum_{n=0}^{\infty} \frac{E_{2n} \, x^{2n}}{(2n)!} \hspace{10mm} |x| < \frac{\pi}{2}.$$
This leads to
\begin{align}
I &= \int \frac{1 - \text{sech}(\pi x)}{x} \, dx \\
&= - \sum_{n=1}^{\infty} \frac{E_{2n} \, \pi^{2n}}{(2n)!} \, \int x^{2n-1} \, dx \\
&= - \sum_{n=1}^{\infty} \frac{E_{2n} \, (\pi \, x)^{2n}}{(2n) \, (2n)!} + c_{0}
\end{align}
for $|x| < \frac{1}{2}$.
A: Here is a solution with justified steps at the end:
$$\mathrm{\int\frac{1-sech(\pi x)}{x}dx=ln(x)-\int \frac{sech(\pi x)}{x}dx=ln(x)-2\int \frac{1}{1-\left(-e^{2\pi x}\right)}\frac{e^{\pi x}}{x}dx=ln(x)-2\int \frac{e^{\pi x}}{x} \sum_{n=0}^\infty \left(-e^{2\pi x}\right)^n=\sum_{n=0}^\infty(-1)^n\int\frac{e^{(2n+1)\pi x}}{x}dx= \boxed{\mathrm{ C+ln(x)-2\sum_{n=0}^\infty(-1)^n Ei((2 n+1) π x)}}, \left| -e^{2\pi x}\right|<1\implies \boxed{\mathrm{Re(x)<0}}}$$

*

*Integrate the reciprocal function.

*Use the main definition of the hyperbolic secant function and use partial fractions.

*Use the Best Friend Geometric Series expansion

*Rearrange and factor using algebra and integrating term by term.

*Use the definition of the Exponential Integral function

*Simplify and add constant of integration.

*First please see What is the integral of $\frac1x$?. Note the ln(x) is not a typo. The absolute value bars would cause
the complex numbers to be calculated wrongly. This means the negative signs must cancel for x$< 0$ in integration , for example:
$\mathrm{a,b\ge0:ln(-b)-ln(-a)=ln\left(\frac
{-b}{-a}\right)=ln(b)-ln(a)=ln|-b|-ln|-a|}$
For an example see this computation and this other computation for a sum representation of:
$$\mathrm{\int_{-1}^{-1-3i} \frac{1-sech(\pi x)}{x}dx= \frac{ln(5)+ln(2)}{2}+tan^{-1}(3)i-2i\pi -2\sum_{n=0}^\infty \left[(-1)^n\big(Ei((-1-3i)(2n+1)\pi )-Ei(-(2n+1)\pi )\big)\right]=1.12618…+1.25671…i}$$
Notice that the function is odd, so you do not necessarily need $\mathrm{Re(x)>0}$. Please correct me and give me feedback!
A: This is exact formula with (if I am not mistaken) globally convergent series:
$$\frac{1-\text{sech}(\pi  x)}{x}=\frac{1}{x}-\frac{4}{\pi  x} \sum _{n=0}^{\infty } \frac{(-1)^n (2 n+1)}{(2 n+1)^2+4 x^2}$$
So we have:
$$\int \frac{1-\text{sech}(\pi  x)}{x} \, dx=\frac{2}{\pi } \sum _{n=0}^{\infty } \frac{(-1)^n (2 n+1) \log \left((2 n+1)^2+4 x^2\right)}{(2 n+1)^2}$$
If someone is interested how I found these results - I used some of formulas from this wolfram site page and from Partial fraction expansion section of Wikipedia page on Trigonometric functions.
