# Evaluate $\int_{0}^{\pi} \frac{x\coth x-1}{x^2}dx$

I've been trying to evaluate certain series recently, and I found that $$\sum_{r=1}^{\infty}\frac{1}{r}\arctan\frac{1}{r}=\frac{\pi}{2}\int_{0}^{\pi} \frac{x\coth x-1}{x^2} \, dx$$ Therefore, I would like to know how to evaluate $$\int_{0}^{\pi} \frac{x\coth x-1}{x^2} \, dx$$ The integral is approximately equal to $$0.895004...$$ but even Wolfram Alpha gives no closed form solution. Any ideas? Part of the problem is that the indefinite integral has no elementary antiderivative. I've tried using 'Feynman's trick' on this integral too but without success.

• I would assume an answer $$\frac1\pi\sum_{n=1}^\infty\frac{B_{2n}(2\pi)^{2n}}{(2n)!(2n-1)}$$ is not what you are looking for.
– user
Mar 21, 2021 at 20:40
• @user That's definitely very cool and I'd be interested in how you got that, but as you guesses that isn;t what I'm looking for :) Mar 21, 2021 at 21:24
• I got it from the Laurent series for $\coth(x)$.
– user
Mar 22, 2021 at 9:02
• Another representation is $$-\Im \int_{0}^{\infty} \frac{e^{i t} \ln (1-e^{-t})}{t} \, dt$$ but this is in a similar light to my question on $\sum_{k=3}^{\infty} \frac{\ln (k)}{k^2-4}$ for which no closed-form is possible. Apr 15, 2022 at 0:44

An inelegant method (for pure mathematicians) is to use infinite series forms for both sides of the claimed equality to meet at some identical intermediate result:

Starting with the infinte series expansion for $$\arctan x$$ $$\arctan x = \sum _{k=1}^{\infty } \frac{(-1)^{k-1} }{2 k-1}x^{2 k-1}$$

immediately gives

$$\sum _{r=1}^{\infty } \frac{1 }{r}\arctan\left(\frac{1}{r}\right)=\sum _{r=1}^\infty \frac{1}{r} \sum _{k=1}^{\infty } \frac{(-1)^{k-1} }{2 k-1} \frac{1}{r^{2 k-1}}\tag{1}$$

swapping the order of the double sum gives

$$\sum _{r=1}^{\infty } \frac{1 }{r}\arctan\left(\frac{1}{r}\right)=\sum _{k=1}^{\infty } \frac{(-1)^{k-1} \zeta (2 k)}{2 k-1}\tag{2}$$

Then using the infinite series expansion for $$\coth x$$ $$\coth(x)=\frac{1}{x}+2 \sum _{k=1}^{\infty } \frac{ (-1)^{k-1} \zeta (2 k)}{\pi ^{2 k}}x^{2 k-1}$$

We can integrate $$\frac{\pi}{2}\int_{0}^{\pi} \frac{x\coth x-1}{x^2} \, dx$$ term by term to give $$\frac{\pi}{2}\int_{0}^{\pi} \frac{x\coth x-1}{x^2} \, dx=\sum _{k=1}^{\infty } \frac{(-1)^{k-1} \zeta (2 k)}{2 k-1}\tag{3}$$

• Nice solution, for sure. But what to do not knowing the lhs ? This was my problem. Cheers and (+1) for sure. Mar 25, 2021 at 6:12

Approximations.

Since $$\frac{x \coth (x)-1}{x^2}=\sum_{n=0}^\infty \frac{2^{2 n+2} B_{2 n+2} }{(2 n+2)!}x^{2 n}$$ it is simple to build a $$[2k,4]$$ Padé approximant of it. For example $$P_1= \frac{7 \left(2 x^2+45\right)}{x^4+105 x^2+945}$$ $$P_2=\frac{1}{21}+\frac{43 x^2+990}{7 \left(x^4+60 x^2+495\right)}$$ $$P_3=\frac{7613}{117978}-\frac{x^2}{6678}+\frac{121 \left(166969 x^2+3935295\right)}{39326 \left(106 x^4+5610 x^2+45045\right)}$$ and so on. So, we face the problem of $$I(a,b,c,d)=\int_0^\pi \frac {a x^2+b}{(x^2+c)(x^2+d)}\,dx$$ $$I(a,b,c,d)=\frac 1{c-d} \Bigg[ \frac{ (b-a d)}{\sqrt{d}}\tan ^{-1}\left(\frac{\pi }{\sqrt{d}}\right)-\frac{ (b-a c)}{\sqrt{c}}\tan ^{-1}\left(\frac{\pi }{\sqrt{c}}\right)\Bigg]$$ Now, some numerical results $$\left( \begin{array}{cc} k & \text{approximation} \\ 1 & 0.8949240197 \\ 2 & 0.8950080586 \\ 3 & 0.8950039337 \\ 4 & 0.8950042166 \\ 5 & 0.8950041937 \\ 6 & 0.8950041958 \\ 7 & 0.8950041956 \end{array} \right)$$

Just for the fun of it, an inverse symbolic calculator proposed as an approximation $$I= \Big[e^\alpha \, \pi^\beta \cot ^4(e \pi ) \csc ^{10}(e \pi )\Big]^{\frac 1 {25}}$$ $$\alpha =38+e-\frac{5}{e}-\frac{47}{\pi }-16 \pi\qquad \text{and} \qquad \beta=14 e-19$$ which is in error of $$2.29\times 10^{-20}$$.

Another method, if you'd like:

Consider the continued fraction of $$\coth x$$ which is

$$\coth x=\dfrac{1}{x}\left\{1+\dfrac{x^2}{3+\dfrac{x^2}{5+\dfrac{x^2}{7+\dfrac{x^2}{\ddots}}}}\right\}$$ Considering the third iteration, that is:

$$\dfrac{1}{x}+\dfrac{x}{3+\dfrac{x^2}{5+\dfrac{x^2}{7}}}=\dfrac{1}{x}+\dfrac{5x+\dfrac{x^3}{7}}{15+\dfrac{10x^2}{7}}=\dfrac{105+45x^2+x^4}{5x(21+2x^2)}$$ we may write

$$\int_0^{\pi}\dfrac{105+45x^2+x^4}{5x^2(21+2x^2)}-\dfrac{5(21+2x^2)}{5x^2(21+2x^2)}dx= \int_0^{\pi}\dfrac{35+x^2}{105+10x^2}dx\approx 0.89\color{red}{6287}$$ which was only the third iteration.

Not an answer, but I thought I'd give some equivalent statements. As James and the original poster mentioned, we have: $$\sum _{r=1}^{\infty } \frac{1 }{r}\arctan\left(\frac{1}{r}\right)= \sum _{n=0}^{\infty } \frac{(-1)^{n}}{2n+1}\zeta(2n+2) = \frac{\pi}{2}\int_{0}^{\pi} \frac{x\coth x-1}{x^2} \, dx \tag{1}$$

Changing the integrand yields the equivalent: $$\frac{1}{2}\int_{0}^{1} \frac{\pi\coth (\pi x)}{x} - \frac{1}{x^2} \, dx = \frac{1}{2}\int_{0}^{\infty} \pi\coth (\frac{\pi}{e^x}) - e^x \, dx = (1)$$

Recalling that: $$\int_{0}^{\infty} e^{-x} \frac{\sin t x}{\sinh x} \, dx = \frac{\pi}{2} \ \coth(\frac{\pi}{2} t) - t$$

and integrating over $$t$$ with some rearranging gives us $$\int_{0}^{\infty} \frac{Si(x)}{e^x-1} \, dx = (1)$$ This integral (where Si(x) is the Sine Integral) also equals (1) and part by part can give the series above.

If one expands the $$\coth(x)$$ in the original integral it can be rearranged to: $$\frac{\pi}{4} + \frac{1}{4}\int_{0}^{\pi} \psi^{(0)}(-ie^{ix}) \ - \psi^{(0)}(-ie^{-ix}) \ - (-i + 2\cos(x)) \tan(x) \ dx = (1)$$ However, this form is basically useless as the Polygamma function doesn't simplify anything.

I hope others will have better luck than I did.

This isn't really an answer, but an approximation. It can be shown that, for large positive $$x$$, $$\sum_{n=1}^\infty \frac{1}{n} \arctan{(\frac{x}{n})} \sim \frac{1}{2}\big( \gamma \ \pi + \frac{1}{x} + \pi \log{x} + 2\pi \text{Ei}(-2\pi x) \big)$$ where Ei is the exponential integral. The number 1 is hardly large, but putting in for the right hand side gives seven decimal digit agreement. Plotting the integral against this asymptotic form shows that the latter really is a stellar approximation, even for $$x$$ as small as 1/2.