Can we find a closed form for the following integral (in terms of any known constants, elementary or special functions)? Numerical value obtained by Wolfram Alpha is:
$$I=\int_0^{\pi/2} \frac{x-\sin x}{\tan x-x} dx=0.51235905260998669767\dots$$
The function under the integral is very nice in the range of interest and looks like this:
What we know about the function under the integral:
$$f(x)=\frac{x-\sin x}{\tan x-x} $$
$$f(-x)=f(x)$$
$$\lim_{x \to 0} f(x)=\frac{1}{2}$$
$$\lim_{x \to 0} f'(x)=0$$
$$\lim_{x \to \pi/2} f(x)=0$$
$$\lim_{x \to \pi/2} f'(x)=1-\frac{\pi}{2}$$
The function is very closely approximated by its Taylor series (in the range of interest):
$$f(x)=\frac{1}{2}-\frac{9}{40}x^2+\frac{27}{2800}x^4-\frac{27}{112000}x^6+\cdots$$
This allows us to estimate the integral:
$$\frac{\pi}{4}-\frac{3}{320}\pi^3+\frac{27}{448000}\pi^5-\frac{27}{100352000}\pi^7 < I < \frac{\pi}{4}-\frac{3}{320}\pi^3+\frac{27}{448000}\pi^5$$
Or numerically (with correct digits highlighted):
$$\color{blue}{0.5123}4485141169155 < I < \color{blue}{0.51}315747016517901$$
Provided no closed form exists (which I find likely) can we find a different integral or series expression with general terms expressed in terms of known elementary or special functions?
We can also write:
$$I=\int_0^{\pi/2} \frac{\pi /2-x-\cos x}{\cot x+x-\pi/2} dx$$
Though, in this case I don't see how to use this.
Integrating by parts is hard, because for the obvious choices of $u$, we get divergence at $0$. Choosing the whole integrated function as $u$ makes the expression more complicated:
$$I=\int_0^{\frac{\pi }{2}} \frac{ x \left(1-\cos ^3 x\right)+\sin x \cos 2 x-\frac{1}{2} \sin 2 x}{(x \cos (x)-\sin (x))^2} x\, dx$$
Or maybe contour integration could work here? In this case it will involve logarithms, which I don't know how to deal with.
Putting $e^{i x}=z$ and choosing the contour to be a half of the unit circle (possibly, I'm not sure), we will have:
$$I=\frac{1}{4} \int_{-\pi/2}^{\pi/2} \frac{(2 i x -e^{ix}+e^{-ix})(e^{i x}+e^{-ix})}{e^{ix}-e^{-ix}-ix(e^{ix}+e^{-ix})} dx=\frac{1}{4i} \oint \frac{(2 z \log z-z^2+1)(z^2+1)}{(z^2-1-(z^2+1) \log z)z^2} dz$$
I have no idea what to do with logarithms, and it seems to me as the only singularity the function has inside the contour is at $z=0$.