It would take too long to explain the context reasonably well - but in short, this integral, or rather its equivalent $$\int\frac{x\cos x\,dx}{\sqrt{1-k^2\sin^2x}},\qquad 0<k<1$$ is related to generating function of a canonical transformation between two distinguished sets of local Darboux coordinates on a certain $SL(2,\mathbb{C})$ character variety.
I would be grateful for any help with the calculation of this integral. It would be especially nice to hear from people industrially guessing closed form expressions for integrals which look much less computable. The answer will be awarded a bounty, unless I manage to find it myself first.
P.S. I have reasons to believe that
The answer can be found in a closed form.
Moreover, I expect it to be given by a linear combination of dilogarithms $\operatorname{Li}_2(\cdot)$ with arguments expressed in terms of elementary functions (roughly, square roots and trigonometric functions).
P.P.S. I intentionally do not tag my question as "integration", "calculus" etc, as these happen to be ignored tags of some highly-qualified participants. Please don't modify this!