find this integral $\int_{0}^{+\infty}e^{-\beta {x}}\left(\frac{1}{x}-\coth{x}\right)dx$ find the intgeral
$$\int_{0}^{+\infty}e^{-\beta {x}}\left(\dfrac{1}{x}-\coth{x}\right)dx$$
where $\Re{(\beta)}>0$
maybe useStarting 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}$$
 A: The formula $$I(a,b,c):=\int_0^\infty\left(\frac{e^{-at}}{t}-\frac{be^{-ct}}{1-e^{-bt}}\right)dt=\log\frac{b}{a}+\psi\left(\frac{c}{b}\right)$$ is obtained using an integral representation of the digamma function $$\psi(z)=\int_0^\infty\left(\frac{e^{-t}}{t}-\frac{e^{-zt}}{1-e^{-t}}\right)dt$$ and a Frullani integral. As $\coth x=(1+e^{-2x})/(1-e^{-2x})$, the given integral equals $$\frac12\big(I(\beta,2,\beta)+I(\beta,2,2+\beta)\big)=\color{blue}{\frac1\beta+\log\frac2\beta+\psi\left(\frac\beta2\right)}$$ (after using $\psi(1+z)=\psi(z)+1/z$).
A: $$I= \int_{0}^{\infty} e^{-\beta w}\left(\frac{1}{w}-\operatorname{coth}(w)\right) d w $$
Now, from the definition of $\operatorname{coth}(w)$
$$\operatorname{coth}(w)=\frac{e^{w}+e^{-w}}{e^{w}-e^{-w}} $$
$$\operatorname{coth}(w)=\frac{e^{-w}}{e^{-w}} \cdot \frac{e^{w}+e^{-w}}{e^{w}-e^{-w}} $$
$$\operatorname{coth}(w)=\frac{1+e^{-2 w}}{1-e^{-2 w}}$$
Plugging this last result in the integral
$$I= \int_{0}^{\infty} e^{-\beta w}\left(\frac{1}{w}-\frac{1+e^{-2 w}}{1-e^{-2 w}}\right) d w$$
Lets do another substitution, $$w=\frac{x}{2}$$
$$I= \int_{0}^{\infty} e^{-\frac{\beta x}{2 }}\left(\frac{2}{x}-\frac{1+e^{-x}}{1-e^{-x}}\right) \frac{d x}{2} $$
$$I= \int_{0}^{\infty} e^{-\frac{\beta x}{2 }}\left(\frac{1}{x}-\frac{1}{2} \cdot \frac{1+e^{-x}}{\left(1-e^{-x}\right)}\right) d x $$
$$I=\int_{0}^{\infty}\left\{\frac{e^{-\frac{\beta x}{2 }}}{x}-\frac{e^{-\frac{\beta x}{2 }}+e^{-\frac{\beta x}{2 }} e^{-x}}{2\left(1-e^{-x}\right)}\right\} d x $$
$$I= \int_{0}^{\infty}\left\{\frac{e^{-\frac{\beta x}{2 }}+e^{-x}-e^{-x}}{x}-\frac{e^{-\frac{\beta x}{2 }}+e^{-\frac{\beta x}{2 }}-e^{-\frac{\beta x}{2 }}+e^{-\frac{\beta x}{2 }} e^{-x}}{2\left(1-e^{-x}\right)}\right\} d x$$
We now rewrite this integral as the sum of three integrals:
$$I=\int_{0}^{\infty} \frac{e^{-x}}{x}-\frac{2 e^{-\frac{\beta x}{2 }}}{2\left(1-e^{-x}\right)} d x+\int_{0}^{\infty} \frac{e^{-\frac{\beta x}{2 }}-e^{-\frac{\beta x}{2 }} e^{-x}}{2\left(1-e^{-x}\right)} d x+\int_{0}^{\infty} \frac{e^{-\frac{\beta x}{2 }}-e^{-x}}{x} d x$$
$$I=\int_{0}^{\infty} \frac{e^{-x}}{x}-\frac{e^{-\frac{\beta x}{2 }}}{\left(1-e^{-x}\right)} d x+\frac{1}{2} \int_{0}^{\infty} e^{-\frac{\beta x}{2 }} d x-\int_{0}^{\infty} \frac{e^{-x}-e^{-\frac{\beta x}{2 }}}{x} d x $$
the first integral is the integral representation of the Digamma function $\psi(\frac{\beta}{2})$
the third is Frullani's integral representation of
$\log \left(\frac{\beta}{2}\right)$
The second integral is straightforward:
$$\frac{1}{2} \int_{0}^{\infty} e^{-\frac{\beta x}{2 }} d x=\frac{1}{2}\left[-\left.\frac{2}{\beta} e^{-\frac{\beta x}{2 }}\right|_{0} ^{\infty}\right]=\frac{1}{\beta}$$
Putting all together we finally get that
$$\boxed{I= \int_{0}^{\infty} e^{-{\beta w}}\left(\frac{1}{w}-\operatorname{coth}(w)\right) d w=\frac{1}{\beta}+\psi\Big(\frac{\beta}{2}\Big)-\log \Big(\frac{\beta}{2}\Big)}$$
