A two-variable recurrence relation for $\int_0^{\pi/2} t^n \cot^m (t) \, \mathrm{d} t$

definite integralsgenerating-functionsintegrationpartial differential equationsrecurrence-relations

I have found a general expression for the integrals $I_n$ discussed in this question in terms of $K_l^{(l)} \, , \, 0 \leq l \leq n \, , $ where

$$ K_n^{(m)} \equiv \int \limits_0^{\pi/2} t^n \cot^m (t) \, \mathrm{d} t \, , \, n \in \mathbb{N}_0 \, , \, 0 \leq m \leq n \, .$$

I would now like to obtain an explicit formula for these integrals in order to complete the solution of the original problem.

The simplest case is trivial:
$$ K_n^{(0)} = \int \limits_0^{\pi/2} t^n \, \mathrm{d} t = \frac{1}{n+1} \left(\frac{\pi}{2}\right)^{n+1} \, , \, n \in \mathbb{N}_0 \, . \tag{1} $$
With some more effort it is possible to compute
\begin{align}
K_n^{(1)} &= \int \limits_0^{\pi/2} t^n \cot (t) \, \mathrm{d} t = -n \int \limits_0^{\pi/2} t^{n-1} \ln(\sin(t)) \, \mathrm{d} t \\
&= \frac{n!}{2^n} \left[\sum \limits_{l=0}^{\left \lfloor \frac{n-1}{2} \right \rfloor} (-1)^l \frac{\pi^{n-2l}}{(n-2l)!} \eta (2l+1) + \operatorname{1}_{2 \mathbb{N}} (n) (-1)^{\left \lfloor \frac{n+1}{2} \right \rfloor} [\zeta (n+1) + \eta (n+1)]\right] \tag{2}
\end{align}
for $n \in \mathbb{N}$ using the Fourier series of $\ln(\sin)$ and repeated integration by parts. $\zeta$ is the Riemann zeta function, $\eta$ is the Dirichlet eta function and $1_{2\mathbb{N}}$ is the indicator function of the even positive integers, i. e. $1_{2\mathbb{N}} (2k) = 1$ and $1_{2\mathbb{N}}(2k-1) = 0$ for $k \in \mathbb{N}$ .

For $n \geq m \geq 2$ we obtain the recurrence relation
$$ K_n^{(m)} = \frac{n}{m-1} K_{n-1}^{(m-1)} – K_n^{(m-2)} \tag{3} $$
from the definition. It enables us to calculate any $K_n^{(m)}$ in terms of the integrals $(1)$ and $(2)$ , but I would prefer a closed-form expression.

I have tried to solve the recurrence using generating functions. The functions
$$F^{(0)}(x) \equiv \sum \limits_{n=0}^\infty K_n^{(0)} x^n = – \frac{\ln\left(1-\frac{\pi x}{2}\right)}{x}$$
and
$$ F^{(1)}(x) \equiv \sum \limits_{n=1}^\infty K_n^{(1)} x^n $$
are known (at least in principle). If we define $K_n^{(m)} = 0$ for $m>n$ , we find (if I did not make a mistake) the following PDE for the function
$$ F(x,y) \equiv \sum \limits_{n=0}^\infty \sum \limits_{m=0}^\infty K_n^{(m)} x^n y^m – F^{(0)} (x)$$
from $(3)$ :
$$ x \frac{\partial}{\partial x} \left[x F(x,y)\right] = y \frac{\partial}{\partial y} \left[y \left(F(x,y)+F^{(0)}(x) – \frac{\pi}{2}\right) + \frac{1}{y} F(x,y)\right] \, . \tag{4} $$
It is subject to the initial conditions $F(x,0) = 0$ and $ \partial_2 F(x,0) = F^{(1)}(x) $ .

However, I am not sure how to proceed from here and could really use a hint or two regarding the following questions:

Is the method of generating functions the simplest way to solve the recurrence relation given by $(1)$, $(2)$ and $(3)$? If so, how can we find a solution to the PDE $(4)$? If not, what are possible alternative approaches ?

Best Answer

The general closed form for $$ \int \limits_0^{\pi/2} t^n \cot^m t \, dt$$ has been worked out here, as it helps to find the closely related $$\int\limits_0^\infty \frac{\arctan^n x}{x^m} dx. $$ Also see here for more about these patterns for integrals containing powers of $\tan$ and $\tanh$.