integral $\int_0^{\pi} \left( \frac{\pi}{2} - x \right) \frac{\tan x}{x} \, {\rm d}x$

Evaluate , if possible in a closed form, the integral:

$$\int_0^{\pi} \left( \frac{\pi}{2} - x \right) \frac{\tan x}{x} \, {\rm d}x$$

Basically, I have not done that much. I broke the integral

\begin{align*} \int_{0}^{\pi} \left ( \frac{\pi}{2}-x \right ) \frac{\tan x}{x} \, {\rm d}x &= \int_{0}^{\pi/2} \left ( \frac{\pi}{2} - x \right ) \frac{\tan x}{x} \, {\rm d}x + \int_{\pi/2}^{\pi} \left ( \frac{\pi}{2} - x \right ) \frac{\tan x}{x} \, {\rm d}x\\ &\!\!\!\!\!\!\overset{u=\pi/2-x}{=\! =\! =\! =\! =\! =\!} \int_{0}^{\pi/2} \frac{u \cot u}{\frac{\pi}{2}-u} \, {\rm d}u + \int_{-\pi/2}^{0} \frac{u \cot u}{\frac{\pi}{2}-u} \, {\rm d}u\\ &= \int_{-\pi/2}^{\pi/2} \frac{u \cot u}{\frac{\pi}{2}-u} \, {\rm d}u\\ &\approx 2.13897 \end{align*}

I have no idea how to evaluate this. I was thinking of IBP and then some kind of Fourier , but I cannot get it to work. Any ideas?

• What is the origin of this integral? What makes you believe that there is a closed-form solution? Aug 23, 2016 at 17:38
• @Dr.MV Well I found it at an integration marathon. By closed form I mean whatever kind. It many contain special functions for example. Aug 23, 2016 at 17:56
• where was this marathon, on AOPS? Aug 23, 2016 at 18:45
• \begin{align} u & = \frac \pi 2 - x \\ \\ x & = \frac \pi 2 - u\\ \\ \text{As $x$ goes from $0$ to $\frac \pi 2$, } & \text{ $u$ goes from $\frac\pi2$ to $0$.} \\ \\ du & = -dx \\ \\ \int_0^{\pi/2} \left( \frac \pi 2 - x \right) \frac{\tan x} x \, dx & = \int_{\pi/2}^0 u \, \frac{\tan\left(\frac \pi 2 - u \right)}{\frac\pi2 - u} \, (-du) = \int_0^{\pi/2} u\, \frac{\cot u}{\frac\pi2-u} \, du \\ \\ & = \int_0^{\pi/2} \frac 1 {\displaystyle \left( \frac \pi 2 -u \right) \frac{\tan u} u} \, du \end{align} Aug 31, 2018 at 21:40
• The integral of this function is equal to the integral of its reciprocal, and I wonder if something should be made of that. Aug 31, 2018 at 21:40