Closed form for $I=\int_{0}^{\infty}\frac{x^n}{x^2+u^2}\tanh(x) \, dx$

solve

$$I=\int_{0}^{\infty}\frac{x^n}{x^2+u^2}\tanh(x) dx:0<n<2$$

I tried for $n=1$ :

$$I(v)=\int_{0}^{\infty}\frac{x}{x^2+u^2}\tanh(vx) dx$$

$$I'(v)=\int_{0}^{\infty}(\frac{1}{\cosh^2(vx)}-\frac{u^2}{(x^2+u^2)\cosh^2(vx)}) dx$$

$$I'(v)=-\sum_{k=1}^{\infty}(-1)^ku^{-2k}\int_{0}^{\infty}(\frac{x^{2k}}{\cosh^2(vx)})dx$$

$$I'(v)=-\frac{1}{v}\sum_{k=1}^{\infty}(-1)^k(uv)^{-2k}\int_{0}^{\infty}(\frac{x^{2k}}{\cosh^2(x)})dx$$

and i solved the last integral in term of zeta function but i failed to find the result of sum .

I interested to find the result of sum.


If you can find for $n=1$ and for general n ?

using two method complex and real :)


As Lucian stated in the comments above, the integral converges only if $-2 < n <1$.

I'll do the case $n=-1$ using contour integration.

For $u>0$ and not equal to $\pi \left(k + \frac{1}{2} \right)$ (where $k$ is a nonnegative integer), consider the complex function

$$ f(z) = \frac{\tanh z}{u^{2}+z^{2}} \frac{1}{z}.$$

Integrating the function $f(z)$ around a rectangular contour in the upper half-plane of height $K \pi$ and then letting $K \to \infty$ discretely, we find

$$ \begin{align} \int_{0}^{\infty} \frac{\tanh x}{(u^{2}+x^{2})} \, \frac{dx}{x} &= \frac{1}{2} \int_{-\infty}^{\infty} \frac{\tanh x}{(u^{2}+x^{2})} \, \frac{dx}{x} \\ &= \pi i \left(\text{Res}[f(z), iu] + \sum_{n=0}^{\infty} \text{Res}\left[f(z), i \pi \left(k+\frac{1}{2} \right)\right] \right) \end{align}$$

where

$$ \text{Res}[f(z), iu] = \lim_{z \to iu} \frac{\tanh z}{z+iu} \frac{1}{z} = \frac{\tanh (iu)}{2iu} \frac{1}{iu} = \frac{\tan u}{2iu^{2}}$$

and

$$ \begin{align} \text{Res}\left[f(z), i \pi \left(k+\frac{1}{2} \right)\right] &= \lim_{z \to i \pi (k+1/2)} \frac{\sinh z}{\frac{d}{dz} (u^{2}+z^{2})z \cosh z } \\ &= \frac{1}{i \pi} \frac{1}{\left( (u^{2}-\pi^{2}(k+ \frac{1}{2})^{2} \right) (k + \frac{1}{2})} \\ &= - \frac{1}{i \pi^{3}} \frac{1}{\left(k- \frac{u}{\pi} + \frac{1}{2} \right)\left(k + \frac{u}{\pi} + \frac{1}{2} \right) \left(k + \frac{1}{2} \right)} . \end{align}$$

In general, $$ \sum_{k=0}^{\infty} \frac{1}{(k+a)(k+b)(k+c)}= \frac{(b-c) \ \psi(a)+ (c-a) \ \psi(b)+(a-b) \ \psi(c)}{(a-b)(b-c)(c-a)}$$

where $a \ne b$, $b \ne c$, $c \ne a$, and $a, b, c \ne 0, -1, -2, \ldots$ .

Here $\psi(z)$ is the digamma function.

This identity can be derived by starting on the right side of the equation and replacing each digamma function with its series representation.

Using this identity, we get $$ \sum_{k=0}^{\infty} \text{Res} \left[f(z), i \pi \left(k+\frac{1}{2} \right)\right] = \frac{1}{i \pi} \frac{\psi \left(\frac{1}{2} - \frac{u}{\pi} \right) + \psi \left(\frac{1}{2} + \frac{u}{\pi} \right) - 2 \psi \left( \frac{1}{2}\right)}{2u^{2}}.$$

Therefore,

$$ \begin{align} \int_{0}^{\infty} \frac{\tanh x}{u^{2}+x^{2}} \frac{dx}{x} &= \frac{1}{2u^{2}} \left[\pi \tan u + \psi \left(\frac{1}{2} - \frac{u}{\pi} \right) + \psi \left( \frac{1}{2} + \frac{u}{\pi}\right) - 2 \,\psi \left( \frac{1}{2}\right) \right] \\ &= \frac{1}{2u^{2}} \left[\pi \tan u + \psi \left(\frac{1}{2} - \frac{u}{\pi} \right) + \psi \left( \frac{1}{2} + \frac{u}{\pi}\right) +2 \gamma + 4 \log 2 \right] .\end{align}$$

Checking with Wolfram Alpha, this result appears to be correct for various values of $u$.

EDIT:

When $u = \pi$, the formula reduces to

$$\int_{0}^{\infty} \frac{\tanh x}{\pi^{2}+x^{2}} \frac{dx}{x} = \frac{2}{\pi^{2}}.$$