Closed form for the integral $\int_0^{\pi/2} \frac{x-\sin x}{\tan x-x} dx$
Solution 1:
Here's something that may be helpful or not:
$$\begin{align} \int_0^{\pi/2}\frac{x-\sin(x)}{\tan(x)-x}dx &=\int_0^{\pi/2}\frac{x\cot(x)-\cos(x)}{1-x\cot(x)}dx\\ &=\int_0^{\pi/2}(x\cot(x)-\cos(x))\sum_{n=0}^\infty x^n\cot^n(x) dx\\ &=\sum_{n=0}^\infty \int_0^{\pi/2}(x\cot(x)-\cos(x))x^n\cot^n(x) dx\\ &=\sum_{n=1}^\infty \int_0^{\pi/2} x^n\cot^n(x) dx-\sum_{n=0}^\infty \int_0^{\pi/2}x^n\cot^n(x)\cos(x) dx\\ \end{align}$$
This probably won't lead to a nice closed form, but it could lead to some good approximations. The first couple terms of the leftmost series are $$\int_0^{\pi/2} x\cot(x)dx=\frac{\pi\ln(2)}{2}$$ $$\int_0^{\pi/2} x^2\cot^2(x)dx=\pi\ln(2)-\frac{\pi^3}{24}$$ $$\int_0^{\pi/2} x^3\cot^3(x)dx=\frac{9\pi\zeta(3)}{16}+\frac{3\pi\ln(2)}{2}-\frac{\pi^3}{16}-\frac{\pi^3\ln(2)}{8}$$ and the first couple of terms of the rightmost series are $$\int_0^{\pi/2} \cos(x)=1$$ $$\int_0^{\pi/2} x\cot(x)\cos(x)=2G-1$$ $$\int_0^{\pi/2} x^2\cot^2(x)\cos(x)=4G+2-\frac{\pi^2}{2}$$ where $G$ is Catalan's constant.
Perhaps this can lead to a nice approximation?
NOTE: The (hard) integrals are courtesy of Wolfram. If you want to know how to do any of them, leave a comment and I'll get back to you when I figure them all out myself. :)
Solution 2:
A short answer regarding the series expansion of the integral.
Let $\,\displaystyle a_{m,n}:=\int_0^{\frac{\pi}{2}}(\cos x)^m \left(\frac{x}{\sin x}\right)^n\,$ with $\,\,m,n\in\mathbb{N}_0\,$.
It’s $\enspace\displaystyle a_{0,0}=\frac{\pi}{2}\enspace$ , $\enspace\displaystyle a_{m,0}=\frac{\sqrt{\pi}}{2}\frac{\Gamma\left(\frac{m-1}{2}\right)}{\Gamma\left(\frac{m}{2}\right)}\enspace$ for $\enspace m>0\,$
and $\enspace\displaystyle a_{0,n}=I_n\enspace$ ( see my answer in Generalised Integral $I_n=\int_0^{\pi/2} \frac{x^n}{\sin ^n x} \ \mathrm{d}x, \quad n\in \mathbb{Z}^+.$ ) .
It's: $$\int\limits_0^{\frac{\pi}{2}}\frac{x-\sin x}{\tan x - x}dx = -\frac{\pi}{2} + \int\limits_0^{\frac{\pi}{2}}\frac{1-\cos x}{1-x\cot x}dx = -\frac{\pi}{2} + \sum\limits_{n=0}^\infty (a_{n,n} – a_{n+1,n}) $$
For $\,n\ge 1\,$ we have:
$$a_{n,n}=\int\limits_0^{\frac{\pi}{2}} (x\cot x)^n dx = \frac{\left(\frac{\pi}{2}\right)^{n+1}\cos\frac{\pi n}{2}}{n+1} +$$$$+\frac{n}{2}\sum\limits_{q=0}^n {\binom n q}\sum\limits_{l=0}^n \frac{\left(\frac{\pi}{2}\right)^l\sin\frac{\pi l}{2}}{2^l l!}\sum\limits_{j=0}^{n-1} \begin{bmatrix}n\\{j+1}\end{bmatrix}\sum\limits_{v=0}^j {\binom j v}(-q)^{j-v}\eta(n-l+1-v)$$
$$a_{n+1,n}=\int\limits_0^{\frac{\pi}{2}} (\cos x)(x\cot x)^n dx =$$ $$=\frac{n}{2}\sum\limits_{q=0}^{n+1} {\binom {n+1} q}\sum\limits_{l=0}^n \frac{\left(\frac{\pi}{2}\right)^l\cos\frac{\pi l}{2}}{l!}\sum\limits_{j=0}^{n-1} \frac{1}{2^j} \begin{bmatrix}n\\{j+1}\end{bmatrix}\sum\limits_{v=0}^j {\binom j v}(1-2q)^{j-v}\beta(n-l+1-v)$$
with the Stirling numbers of the first kind $\begin{bmatrix}n\\k\end{bmatrix}$ defined by $\displaystyle\sum\limits_{k=0}^n\begin{bmatrix}n\\k\end{bmatrix}x^k:=\prod\limits_{k=0}^{n-1}(x+k),$
and $\enspace\beta(s)$ := Dirichlet $\beta$ function, $\enspace\eta(s)$ := Dirichlet $\eta$ function, $\,\,$ and their analytical extensions which also can be read in my answer of the question Generalised Integral $I_n=\int_0^{\pi/2} \frac{x^n}{\sin ^n x} \ \mathrm{d}x, \quad n\in \mathbb{Z}^+.$