I am at a loss to evaluate the following integral: $$ I=\frac{1}{\pi}\displaystyle\int_{q_1}^{q_2} dq\,\sqrt{2m(E-V(q))} $$ where $V(q)=U\tan^2(\alpha q)$, $U>0$ and $V(q_1)=V(q_2)=E$. (Thus the integrand vanishes at the endpoints.)
This integral is the action for the potential $V(q)$ in the action-angle formalism of classical mechanics. The answer is given as $$ I=\frac{1}{\alpha}\left(\sqrt{2m(E+U)}-\sqrt{2mU}\right)\, . $$
Mathematica will spit out an answer for the indefinite integral in terms of $\arcsin$ and $\hbox{arctanh}$ but it seems so far from what the answer is that I get no insight into the solution.
The usual tricks - including trig substitutions and various Euler substitutions - do not seem to work. Since the integrand contains a square, I looked at breaking the integrand to the form $\sqrt{(A-B\tan(\alpha q))(A+B\tan(\alpha q))}$ but this doesn't seem to improve the situation.
I tried using a complex substitution since Mma tells the antiderivative is expressible as an arctanh but that got me nowhere.
I thought about trying some version of Leibnitz's rule for definite integrals whose limits are functions of differential variables and take advantage of the property that the integral vanishes at the endpoint, but to no avail.
I suspect there might be a very specific trick which is not very well known. More probably it's a multistep process with several sequential substitutions which are not immediately obvious.
I'm stuck and I'll take any serious hint towards the solution.