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

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 ?

• What is :$\eta(n)$ and $\operatorname{1}_{2 \mathbb{N}} (n)$ ? – Mariusz Iwaniuk Aug 6 '18 at 12:47
• @MariuszIwaniuk Sorry, I forgot to define these functions. I have added the explanations. – ComplexYetTrivial Aug 6 '18 at 15:16
• Formula dosen't work for n=4,6,8,10... unless I'm wrong ? – Mariusz Iwaniuk Aug 6 '18 at 16:04
• @MariuszIwaniuk It seems to work for me. It yields $K_4^{(1)} = \frac{24}{16} \left(\frac{\pi^4}{24} \ln(2) - \frac{\pi^2}{2} \frac{3}{4} \zeta(3) + \frac{31}{16} \zeta(5) \right)$ , which is equal to the value given by WolframAlpha. The results appear to agree for larger $n$ as well. – ComplexYetTrivial Aug 6 '18 at 16:22
• I checked 5 times for: n=4the indicator function must be equal 1/2 to agree with formula ? I'm confused. – Mariusz Iwaniuk Aug 6 '18 at 16:47