# Nasty Integral - Closed form solution?

Any suggestions on how to integrate this beast?:

$$\int_0^{\omega_t}\int_{\omega_t}^f\sin^2(\omega_{12}/2)\sin^2(\omega_{23}/2)d\omega_{23}d\omega_{12}$$

where:

$f{} = 2\pi+2\tan^{-1}(y,x)$

$y = -A^2\sin^2(\omega_{12}/2)\cos(\omega_t/2)-r\cos(\omega_{12}/2)$

$x = A\sin(\omega_{12}/2)[\cos(\omega_t/2)\cos(\omega_{12}/2)-r]$

$r = \sqrt{A^2\sin^2(\omega_{12}/2)[A^2\sin^2(\omega_{12}/2)+\cos^2(\omega_{12}/2)-\cos^2(\omega_t/2)]}$

I can perform the first integration fine, but when you evaluate it at f you get something nasty that I can't seem to integrate. Here is the result after the first integration:

$$\int_0^{\omega_t}\sin^2(\omega_{12}/2)\left[\left(\pi+\tan^{-1}(y,x)-\frac{xy}{x^2+y^2}\right)-\left(\frac{\omega_t}{2}-\sin(\omega_t/2)\cos(\omega_t/2)\right)\right]d\omega_{12}$$

Note: $\tan^{-1}(y,x)$ is the two argument inverse tangent function, a.k.a. atan2.

-
A standard technique for evaluating double integrals is to switch the order of integration. Does that get you anything nicer? – Qiaochu Yuan May 5 '11 at 23:01
You may have use for the usual conversion $\arctan(y,x)=2\arctan\left(\frac{\sqrt{x^2+y^2}-x}{y}\right)$. – J. M. May 5 '11 at 23:10
@okj, as a side remark, have you tried using mathematica? It is pretty good at solving these types of questions where you are seeking exact and analytic solutions. – picakhu May 6 '11 at 1:33
@picakhu: not always. My experience with elliptic integrals has shown me that just taking what Mathematica spits out isn't enough... – J. M. May 6 '11 at 10:35
The second portion at least, you can integrate nicely. Note that $\sin^2\frac{\omega_{12}}{2}=\frac12\left(1-\cos\omega_{12}\right)$ and $\sin\frac{\omega_t}{2}\cos\frac{\omega_t}{2}=\frac12\sin\omega_t$. – J. M. May 6 '11 at 15:19