Require a solution (numerically or analytically) to a tricky trigonometric integral

135 Views Asked by At

The integral is:

$$\frac{1}{2\pi} \int_{-\pi}^{\pi}\sin^2\left ( \frac{\theta_{k}}{2} \right )dk$$

where $$\theta_{k} = \arctan\left ( \frac{4\sin{k}}{4e^{J}\sin^2{k} + e^{J} - e^{-J}} \right )$$

Is it possible to analytically solve this through substitution to obtain a solution dependent on J? If so, how would I go about solving this? It should be worth noting that J is a constant.

Both mathematica and Python are struggling, unless I have coded wrong?

2

There are 2 best solutions below

4
On

Firstly, one can see that the integrand is an even function, so the integral reduces to

$$ I = \frac{1}{\pi} \int_0^{\pi} \sin^2\left(\frac{1}{2}\arctan\left(\frac{4\sin k}{4e^J \sin^2 k + e^J - e^{-J}}\right)\right) $$

Define $X := \frac{4\sin k}{4e^J \sin^2 k + e^J - e^{-J}}$ and $T := \arctan(X)$. Then, $X = \tan(T)$ and so $\sin^2\left(\frac{1}{2}T\right) = \frac{1}{2}\left(1 - 2\cos(T)\right) = \frac{1}{2}\left(1 - \frac{2}{\sqrt{X^2 + 1}}\right)$ Therefore,

\begin{align*} I &= \frac{1}{\pi} \int_0^{\pi} \sin^2 \left(\frac{1}{2} T(X(k)) \right) dk \\ &= \frac{1}{2} - \frac{1}{\pi}\int_0^{\pi} \frac{1}{\sqrt{X^2 + 1}} dk \\ &= \frac{1}{2} - \frac{1}{\pi}I_0 \end{align*}

Next we tackle the integral (help me). We abstract the constants by writing $X := \frac{\sin k}{a\sin^2 k + b}$ instead, where $a = e^J$ and $b = \frac{1}{4}\left(a - a^{-1}\right)$. We also assume that $J > 0$, which means $a > 1$ and $b > 0$. Then,

$$ \begin{align*} I_0 &= \int_0^{\pi} \frac{1}{\sqrt{1 + \left(\frac{\sin k}{a\sin^2 k + b}\right)^2}} dk \\ &= \int_0^{\pi} \frac{1}{\sqrt{\frac{(a\sin^2 k + b)^2 + \sin^2 k}{(a\sin^2 k + b)^2}}} dk \\ &= \int_0^{\pi} \frac{a\sin k + b}{\sqrt{a^2\sin^4 k + (2ab + 1)\sin^2 k + b^2}} dk \end{align*} $$

Where in the final step, we actually used the fact that $a\sin^2 k + b > 0$ to allow extracting the square root. Finally, the final expression can be split into two integrals. The first one is $\int_0^{\pi} \frac{a\sin k}{\sqrt{a^2(1 - \cos^2 k)^2 + (2ab + 1)(1 - \cos^2 k) + b^2}} dk$, which after a substitution $t = \cos k$ and simplification gives something like $\int_{-1}^1 \frac{1}{\sqrt{t^4 + At^2 + B}} dt$, which I doubt has a closed form. The second integral is something similar except it's 50 times worse, and it seems that one might be able to write it in terms of elliptic integrals, but I am not bothered to do so. But this form should be enough for accurate numeric approximation.

0
On

Using $$a=e^J \qquad \text{and}\qquad b=\frac{e^J-e^{-J}}{4}=\frac 12 \sinh(J) $$ we have to compute $$I=\frac 1{2\pi}\int_{-\pi}^{+\pi}\sin ^2\left(\frac{1}{2} \tan ^{-1}\left(\frac{\sin (k)}{a \sin ^2(k)+b}\right)\right)\,dk$$ $$I=\frac 2{\pi}\int_{0}^{\frac \pi2}\sin ^2\left(\frac{1}{2} \tan ^{-1}\left(\frac{\sin (k)}{a \sin ^2(k)+b}\right)\right)\,dk$$ $$I=\frac 12-\frac 1{\pi}\int_{0}^{\frac \pi2}\cos \left(\tan ^{-1}\left(\frac{\sin (k)}{a \sin ^2(k)+b}\right)\right)\,dk$$ $$I=\frac 12-\frac 1{\pi}\int_{0}^{\frac \pi2}\frac{a \sin ^2(k)+b}{\sqrt{\left(a \sin ^2(k)+b\right)^2+\sin ^2(k)}}\,dk$$ Let $$\alpha=a^2 \qquad \qquad\beta=1+2ab \qquad \qquad \gamma=b^2$$ to write the integral $$\color{blue}{I=\frac 12-\frac 1{\pi}\int_{0}^{\frac \pi2}\frac{a \sin ^2(k)+b}{\sqrt{\alpha \sin ^4(k)+\beta \sin ^2(k)+\gamma }}\,dk}$$

Mathematica produces an antiderivative in terms of elliptic integrals of the first and third kinds but not the definite integral integral. The problem is the evaluation at the upper bound where appear several indeterminate forms because the arguments of the elliptic integrals involve $\tan(k)$. I let my computer running $14$ hours for no result.

Notice that using $k=\sin ^{-1}(t)$ which leads to $$\int_0^1 \frac{a t^2+b}{\sqrt{1-t^2} \sqrt{\alpha t^4+\beta t^2+\gamma}}\,dt$$ Mathematica does not return anything.

I did not find any way to perform any detailed asymptotic analysis except that, for $J > \frac 12$ $$\color{red}{\large I \sim \frac{1}{2} e^{-(2 J+1)}}$$

A few numbers for $\log(I)$

$$\left( \begin{array}{ccc} J & \text{estimate} & \text{exact} \\ 0.5 & -2.69315 & -2.64093 \\ 1.0 & -3.69315 & -3.69321 \\ 1.5 & -4.69315 & -4.71096 \\ 2.0 & -5.69315 & -5.71733 \\ 2.5 & -6.69315 & -6.71966 \\ 3.0 & -7.69315 & -7.72051 \\ 3.5 & -8.69315 & -8.72083 \\ 4.0 & -9.69315 & -9.72094 \\ 4.5 & -10.6931 & -10.7210 \\ 5.0 & -11.6931 & -11.7210 \\ \end{array} \right)$$

Edit

Thanks to @Ulrich Neumann (have a look here), we have the solution for

$$I(t)=\int_{0}^{t}\frac{a \sin ^2(k)+b}{\sqrt{\alpha \sin ^4(k)+\beta \sin ^2(k)+\gamma }}\,dk$$

and thanks to @Andreas (have a look here) we have the value at the upper bound

$$\frac ab \left(2 b (a+b)+\sqrt{4 a b+1}+1\right) \sqrt{b (a+b)+\frac{1}{2} \left(\sqrt{4 a b+1}+1\right)} \times$$ $$\,\,\large\color{red}{\int_{0}^{\frac \pi2}\frac{a \sin ^2(k)+b}{\sqrt{\left(a \sin ^2(k)+b\right)^2+\sin ^2(k)}}\,dk }=$$ $$\left(b \left(\sqrt{4 a b+1}-1\right)+a \left(\sqrt{4 a b+1}+1\right)\right)\times $$ $$ K\left(\frac{2 \sqrt{4 a b+1}}{2 b (a+b)+\sqrt{4 a b+1}+1}\right)+$$ $$b \left(2 a (a+b)-\sqrt{4 a b+1}+1\right) \times $$ $$\Pi \left(\frac{2 a (a+b)+\sqrt{4 a b+1}+1}{2 \left((a+b)^2+1\right)}|\frac{2 \sqrt{4 a b+1}}{2 b (a+b)+\sqrt{4 a b+1}+1}\right)$$

Edit

Let $b=\frac{c^2-1}{4 a}$ with $c>1$ and this simplify as $$\frac{(c+1) \sqrt{4 a^2+(c-1)^2}}{c-1}\,\int_{0}^{\frac \pi2}\frac{a \sin ^2(k)+b}{\sqrt{\left(a \sin ^2(k)+b\right)^2+\sin ^2(k)}}\,dk =$$ $$2 K\left(\frac{16 a^2 c}{\left(4 a^2+(c-1)^2\right) (c+1)^2}\right)+$$ $$(c-1)\,\, \Pi \left(\frac{4 a^2}{4 a^2+(c-1)^2}|\frac{16 a^2 c}{\left(4 a^2+(c-1)^2\right) (c+1)^2}\right)$$