Evaluate $\int_{-\pi/2}^{\pi/2}\frac{\arctan(\sin^2(x))}{\sin^2(x)}dx$

As per the title the integral,$$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\frac{\arctan \left(\sin^2(x) \right)}{\sin^2(x)} \,dx$$

I tried Feynman’s integral trick as that seemed like the obvious step to me, but after differentiating and what seemed like a fairly obvious substitution, I got an integral that had a seemingly not trivially factorable $$4$$th-degree polynomial in the denominator. Can anyone provide a solution, process, or hints as to what I need to do to take down this monster? This is not for a class but for my mathematical endeavors.

• What makes you think there will be a closed form solution? Commented Jun 10, 2023 at 21:46
• wolframalpha.com/… Commented Jun 10, 2023 at 21:47
• Ah, integrating by parts, we end up with a rational function of sin and cos, so of course it has a closed form solution (the usual $\tan(u/2)$ substitution). Commented Jun 10, 2023 at 21:54

The integral can be written as $$I=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\mathrm{cosec}^2 x\arctan(\sin^2(x)) dx,$$ so integration by parts gives $$I=\Big[-\mathrm{cot}x\arctan(\sin^2(x))\Big]_{-\frac{\pi}{2}}^{\frac{\pi}{2}}+\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\mathrm{cot}x\frac{2 \sin x \cos x}{1+\sin^4 x} dx = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\frac{2\cos^2 x}{1+\sin^4 x} dx.$$ Now use the substitution $$T=\tan x$$, giving $$I=\int_{-\infty}^{\infty}\frac{\frac{2}{1+T^2}}{1+\frac{T^4}{(1+T^2)^2}} \frac{1}{1+T^2}dT=\int_{-\infty}^{\infty}\frac{2}{2T^4+2T^2+1} dT.$$ The denominator factorises into two irreducible quadratics as $$2T^4+2T^2+1=(\sqrt{2}T^2+aT+1)(\sqrt{2}T^2-aT+1),$$ where $$a=\sqrt{2\sqrt{2}-2}$$, so, using partial fractions, $$I=\int_{-\infty}^{\infty}\frac{\sqrt{2}T + a}{a(\sqrt{2}T^2+aT+1)} -\frac{\sqrt{2}T - a}{a(\sqrt{2}T^2-aT+1)}dT$$ $$=\Big[\frac{1}{2a}\ln\Big( \frac{\sqrt{2}T^2+aT+1}{\sqrt{2}T^2-aT+1}\Big)\Big]_{-\infty}^{\infty}+\frac{1}{2}\int_{-\infty}^{\infty}\frac{1}{\sqrt{2}T^2+aT+1} +\frac{1}{\sqrt{2}T^2-aT+1}dT$$ $$=\frac{1}{2}\int_{-\infty}^{\infty}\frac{1}{\sqrt{2}T^2+aT+1} +\frac{1}{\sqrt{2}T^2-aT+1}dT$$ $$=\frac{1}{2\sqrt{2}}\int_{-\infty}^{\infty}\frac{1}{\Big(T+\frac{a}{2\sqrt{2}}\Big)^2+b^2} +\frac{1}{\Big(T-\frac{a}{2\sqrt{2}}\Big)^2+b^2}dT,$$ where $$8b^2=4\sqrt{2}-a^2$$. The shift is irrelevant, as the integral is from $$-\infty$$ to $$\infty$$, so $$I=\frac{1}{\sqrt{2}}\int_{-\infty}^{\infty}\frac{1}{T^2+b^2}dT=\Big[\frac{1}{\sqrt{2}b}\arctan\Big(\frac{T}{b}\Big)\Big]_{-\infty}^{\infty}=\frac{\pi}{\sqrt{2}b}$$ which (I think) is $$I=\sqrt{2}\pi\sqrt{\sqrt2-1}$$.

• Your answer is incorrect according to Desmos. Commented Jun 10, 2023 at 23:02
• Thank you. Yes, I fear an extra factor of $\sqrt{2}$ crept in.
– mcd
Commented Jun 10, 2023 at 23:06
• Perfect. I will give +1 Commented Jun 10, 2023 at 23:13

$$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\frac{\arctan \left(\sin^2(x) \right)}{\sin^2(x)} \,dx=2\int_{0}^{\frac{\pi}{2}}\frac{\arctan \left(\sin^2(x) \right)}{\sin^2(x)} \,dx$$ $$x=\sin ^{-1}\left(\sqrt{t}\right)\quad \implies \quad \int_{0}^{\frac{\pi}{2}}\frac{\arctan \left(\sin^2(x) \right)}{\sin^2(x)} \,dx=\frac 12\int_0^1\frac{\tan ^{-1}(t)}{ t^{3/2}\sqrt{1-t}}$$ Now, consider $$I=\int\frac{\tan ^{-1}(t)}{ t^{3/2}\sqrt{1-t}}\,dt$$ One integration by parts gives $$I=-\frac{2 \sqrt{1-t}\, \tan ^{-1}(t)}{\sqrt{t}}+2\int \frac{ \sqrt{1-t}}{\sqrt{t} \left(t^2+1\right)}\,dt$$ $$\frac{\sqrt{1-t}}{\sqrt{t}}=u \quad \implies\quad t=\frac{1}{u^2+1}\quad \implies$$ $$\int \frac{ \sqrt{1-t}}{\sqrt{t} \left(t^2+1\right)}\,dt=-2\int\frac{u^2}{u^4+2 u^2+2}\,du$$

$$\frac{u^2}{u^4+2 u^2+2}=\frac{u^2}{\left(u^2+(1-i)\right) \left(u^2+(1+i)\right)}=\frac{\frac{1}{2}-\frac{i}{2}}{u^2+(1+i)}+\frac{\frac{1}{2}+\frac{i}{2}}{u^2+(1-i)}$$ $$\int\frac{u^2}{u^4+2 u^2+2}\,du=\frac{\tan ^{-1}\left(\frac{u}{\sqrt{1-i}}\right)}{(1-i)^{3/2}}+\frac{\tan ^{-1}\left(\frac{u}{\sqrt{1+i}}\right)}{(1+i)^{3/2}}$$ $$\int_0^\infty\frac{u^2}{u^4+2 u^2+2}\,du=\frac{1}{4} i \left(\sqrt{1-i}-\sqrt{1+i}\right) \pi=\frac{1}{2} \sqrt{\frac{1}{\sqrt{2}}-\frac{1}{2}} \pi$$

By using the fact that the integrand is even and the substitution $$u = \sin^2(x)$$, you will have

$$I = \int_{0}^1 (1-u)^{-\frac12} u^{-\frac32} \arctan(u)\mathrm du$$

\begin{align} I &= \int_0^1 \left(1-u\right)^{-\frac12}u^{-\frac32}\arctan(u)\mathrm d u\\ &= \int_{0}^1 \left(1-u\right)^{-\frac12}u^{-\frac32}\left(\sum_{k=0}^{\infty}\frac{(-1)^k}{2k+1} u^{2k+1}\right)\mathrm d u\\ &= \sum_{k=0}^{\infty}\frac{(-1)^k}{2k+1}\left(\int_{0}^{1}\left(1-u\right)^{\frac12 - 1}u^{2k+\frac12 - 1} \mathrm du \right)\\ &= \sum_{k=0}^{\infty} \frac{(-1)^k}{2k+1}B\left(\frac12, 2k+\frac12\right)\\ &= \sum_{k=0}^{\infty} \frac{(-1)^k}{2k+1} \frac{\Gamma \left(\frac12\right)\Gamma\left(2k+\frac12\right)}{\Gamma(2k+1)}\\ &= \sum_{k=0}^{\infty}\frac{(-1)^k}{2k+1}\times\frac{\sqrt \pi}{2}\times \frac{(4k)!\sqrt \pi}{(2k)!4^{2k}}\times\frac{1}{(2k)!}\\ &= \frac\pi{\sqrt 2}\sum_{k=0}^{\infty} \frac{(4k)!}{2^{4k}\sqrt 2(2k)!(2k+1)!}(-1)^k\\ &= \frac\pi{\sqrt 2} \left[\sqrt{\frac{1 - \sqrt{1-x}}{x}}\right]_{|x=-1}\\ &= \frac\pi{\sqrt2}\sqrt{\sqrt{2} - 1} \end{align}

• Could you clarify how you evaluated the final sum to the bracketed expression? Thanks Commented Jun 11, 2023 at 8:33
• It is a well known series en.m.wikipedia.org/wiki/List_of_mathematical_series. Tou can prove it using the generating function. In Wikipedia link you have a reference there. Commented Jun 11, 2023 at 11:58

We will calculate the following integral by using the residue theorem:

$$\displaystyle\int_{-\frac\pi2}^{\frac\pi2}\frac{\arctan\left(\sin^2\!\!x\right)}{\sin^2\!\!x}\,\mathrm dx\;.$$

First of all, we use the substitution $$\;x=\arcsin\left(\!\!\dfrac1{\sqrt{z^2+1}}\!\!\right)\;$$ and then we integrate by parts:

$$\displaystyle\int_{-\frac\pi2}^{\frac\pi2}\frac{\arctan\left(\sin^2\!\!x\right)}{\sin^2\!\!x}\,\mathrm dx=2\int_0^{\frac\pi2}\frac{\arctan\left(\sin^2\!\!x\right)}{\sin^2\!\!x}\,\mathrm dx=$$

$$=\displaystyle2\int_0^{+\infty}\!\!\!\arctan\left(\!\dfrac1{z^2+1}\!\right)\mathrm dz=$$

$$=\displaystyle\left[2z\arctan\left(\!\dfrac1{z^2+1}\!\right)\right]_0^{+\infty}+4\int_0^{+\infty}\!\!\!\frac{z^2}{z^4+2z^2+2}\,\mathrm dz=$$

$$=\displaystyle\int_{-\infty}^{+\infty}\!\!\!\frac{2z^2}{z^4+2z^2+2}\,\mathrm dz\,.$$

By using the residue theorem, we get that

$$\displaystyle\int_{-\infty}^{+\infty}\!\!\!\frac{2z^2}{z^4+2z^2+2}\,\mathrm dz=2\pi i\!\!\!\sum_{\;\alpha_j\text{ pole}\\\text{Im}(\alpha_j)>0}\!\!\!\mathrm{Res}\left(\!\frac{2z^2}{z^4+2z^2+2},\alpha_j\!\right).$$

Since $$\;z^4+2z^2+2=\left(z^2+\sqrt2\right)^2-2\left(\sqrt2-1\right)z^2=$$

$$=\left(z^2+\sqrt2\sqrt{\sqrt2-1}\,z+\sqrt2\right)\left(z^2-\sqrt2\sqrt{\sqrt2-1}\,z+\sqrt2\right)\;,$$

the poles $$\,\alpha_j\,$$ such that $$\,\text{Im}(\alpha_j)>0\;$$ are :

$$\alpha_1=\dfrac{\sqrt2}2\bigg(\!\!\!-\!\sqrt{\sqrt2-1}+i\sqrt{\sqrt2+1}\bigg)\;,$$

$$\alpha_2=\dfrac{\sqrt2}2\bigg(\!\!\sqrt{\sqrt2-1}+i\sqrt{\sqrt2+1}\bigg)\;.$$

Moreover ,

\begin{align}\mathrm{Res}\left(\!\dfrac{2z^2}{z^4+2z^2+2},\alpha_1\!\right)&=\dfrac{2\alpha_1^2}{4\alpha_1^3+4\alpha_1}=\dfrac{\alpha_1}{2\left(\alpha_1^2+1\right)}=\\[3pt]&=\dfrac{\sqrt2}{4i}\left(\sqrt{\sqrt2-1}-i\sqrt{\sqrt2+1}\,\right)\;,\end{align}

$$\mathrm{Res}\left(\!\dfrac{2z^2}{z^4+2z^2+2},\alpha_2\!\right)=\dfrac{\sqrt2}{4i}\left(\sqrt{\sqrt2-1}+i\sqrt{\sqrt2+1}\,\right)\;,$$

hence ,

$$\displaystyle\int_{-\infty}^{+\infty}\!\!\!\frac{2z^2}{z^4+2z^2+2}\,\mathrm dz=\pi\sqrt2\sqrt{\sqrt2-1}\,.$$

By integration by parts on $$\csc^2 x$$, we have $$I=\int_{-\pi / 2}^{\pi / 2} \frac{\arctan \left(\sin ^2(x)\right)}{\sin ^2(x)} d x= $$2 \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\cos ^2 x}{1+\sin ^4 x} d x = 4\int_{0}^{\frac{\pi}{2}} \frac{\cos ^2 x}{1+\sin ^4 x} d x$$$$ Multiplying both numerator and denominator by $$\sec^2 x$$ transforms the integral into $$I=4 \int_0^{\frac{\pi}{2}} \frac{\sec ^2 x}{\sec ^4 x+\tan ^4 x} d x$$ Letting $$t=\tan x$$ gives $$I=4 \int_0^{\frac{\pi}{2}} \frac{d t}{2 t^4+2 t^2+1}$$ Playing a little trick on the integrand make the life easier. \begin{aligned} &\quad \int_0^{\frac{\pi}{2}} \frac{d t}{2 t^4+2 t^2+1} \\ & =\int_0^{\infty} \frac{\frac{1}{t^2}}{2 t^2+\frac{1}{t^2}+2} d t \\ & =\frac{1}{2} \int_0^{\infty} \frac{\left(\sqrt{2}+\frac{1}{t^2}\right)-\left(\sqrt{2}-\frac{1}{t^2}\right)}{2 t^2+\frac{1}{t^2}+2} d t \\ & =\frac{1}{2}\left[\int_0^{\infty} \frac{d\left(\sqrt{2} t-\frac{1}{t}\right)}{\left(\sqrt{2} t-\frac{1}{t}\right)^2+2(1+\sqrt{2})}-\int_0^{\infty} \frac{d\left(\sqrt{2} t+\frac{1}{t}\right)}{\left(\sqrt{2} t+\frac{1}{t}\right)^2-2(\sqrt{2}-1)}\right] \\ & =\frac{1}{2 \sqrt{2(1+\sqrt{2})}}\left[\tan ^{-1}\left(\frac{\sqrt{2} t-\frac{1}{t}}{\sqrt{2(1+\sqrt{2})}}\right)\right]_0^{\infty}\\ & \quad + \frac{1}{4 \sqrt{2(\sqrt{2}-1)}}\underbrace{\left[\ln \left(\frac{\sqrt{2} t+\frac{1}{t}+\sqrt{2(\sqrt{2}-1)}}{\sqrt{2} t+\frac{1}{t}-\sqrt{2(\sqrt{2}-1)}}\right)\right]_0^{\infty}}_{=0} \\ & =\frac{\pi}{2 \sqrt{2(1+\sqrt{2})}} \\ & \end{aligned} Now we can conclude that $$\boxed{I=4 \cdot \frac{\pi}{2 \sqrt{2(1+\sqrt{2})}}=\pi \sqrt{2(\sqrt{2}-1)}}$$

The integral is easily ready for Feynman's trick, but I will use a double integral $$I=\int_{-\pi/2}^{\pi/2}\frac{\arctan(\sin^2x)}{\sin^2x}dx=2\int_0^1\int_0^{\pi/2}\frac{1}{1+y^2\sin^4x}dx\space dy$$ $$=2\int_0^1\int_0^{\pi/2}\frac{(1+\tan^2x)\sec^2x}{(1+\tan^2x)^2+y^2\tan^4x}dx\space dy=2\int_0^1\int_0^\infty\frac{1+x^2}{(1+x^2)^2+y^2x^4}dx\space dy$$ $$=\int_0^1\int_{-\infty}^\infty\frac{1+x^2}{(1+y^2)x^4+2x^2+1}dx\space dy$$ Here I will derive a formula with general constants to make it easier. I start with a simpler integral $$I(p)$$ and evaluate it using symmetry. Notice that the leading coefficient and the constant are equivalent. $$I(p)=\int_{-\infty}^\infty\frac{1}{x^4+px^2+1}dx=\int_{-\infty}^\infty\frac{x^2}{x^4+px^2+1}dx$$ $$\int_{-\infty}^\infty\frac{x\sqrt{2-p}}{x^4+px^2+1}dx=0$$ $$I(p)+I(p)+0=2I(p)=\int_{-\infty}^\infty\frac{1+x\sqrt{2-p}+x^2}{x^4+px^2+1}dx=\int_{-\infty}^\infty\frac{dx}{x^2-x\sqrt{2-p}+1}$$$$=\int_{-\infty}^\infty\frac{dx}{(x-\sqrt{2-p}/2)^2+(2+p)/4}=\int_{-\infty}^\infty\frac{dx}{x^2+(2+p)/4}=\frac{2\pi}{\sqrt{2+p}}$$ $$I(p)=\int_{-\infty}^\infty\frac{1}{x^4+px^2+1}dx=\frac{\pi}{\sqrt{2+p}}$$ Now we can move on to the generalized version of our inside integral. I applied a substitution that would equalize the leading coefficient and the constant of the biquadratic so that I could use the symmetry I had previously established $$\int_{-\infty}^\infty\frac{1+x^2}{ax^4+bx^2+c}dx=\int_{-\infty}^\infty\frac{1+x^2\sqrt{c/a}}{cx^4+bx^2\sqrt{c/a}+c}(c/a)^{1/4}dx$$$$=a^{-1/4}c^{-3/4}\int_{-\infty}^\infty\frac{1+x^2\sqrt{c/a}}{x^4+bx^2\sqrt{1/(ac)}+1}dx=a^{-1/4}c^{-3/4}(1+\sqrt{c/a})I(\frac{b}{\sqrt{ac}})=\frac{\pi(1+\sqrt{c/a})}{\sqrt c\sqrt{b+2\sqrt{ac}}}$$ Going back $$I=\int_0^1\frac{\pi(1+\sqrt{1/(1+y^2)})}{\sqrt{2+2\sqrt{1+y^2}}}dy=\frac{\pi}{\sqrt2}\int_0^1\frac{\sqrt{1+\sqrt{1+y^2}}}{\sqrt{1+y^2}}dy$$ $$x=\sqrt{1+y^2},\space dy=\frac{x}{\sqrt{x^2-1}}$$ $$I=\frac{\pi}{\sqrt2}\int_1^\sqrt2 \frac{\sqrt{1+x}}{x}\frac{x\space dx}{\sqrt{x^2-1}}$$ $$I=\frac{\pi}{\sqrt2}\int_1^\sqrt2 \frac{dx}{\sqrt{x-1}}=\frac{\pi}{\sqrt2}\int_0^{\sqrt2-1} x^{-1/2}dx=\frac{2\pi}{\sqrt2}\sqrt{\sqrt2-1}$$

Following @mcd's/@Lai' solutions, I want to simplify their calculations of the integral: $$\begin{eqnarray} I&=&\int_{-\infty}^{\infty}\frac{2}{2T^4+2T^2+1} dT=\int_{0}^{\infty}\frac{4}{2T^4+2T^2+1} dT\\ &\overset{t=\sqrt[4]2T}=&\frac4{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{t^4+\sqrt2t^2+1} dt=\frac4{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{t^4+\sqrt2t^2+1} dt\\ &=&\frac4{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{t^2+\sqrt2+\frac1{t^2}} d(-\frac1t).\tag1 \end{eqnarray}$$ On the other hand $$\begin{eqnarray} I&=&\frac4{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{t^4+\sqrt2t^2+1} dt\overset{t\to \frac1t}=\frac4{\sqrt[4]2}\int_{0}^{\infty}\frac{t^2}{t^4+\sqrt2t^2+1} dt\\ &=&\frac4{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{t^2+\sqrt2+\frac1{t^2}} dt.\tag2 \end{eqnarray}$$ Adding (1) to (2) giving $$\begin{eqnarray} I&=&\frac2{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{t^2+\sqrt2+\frac1{t^2}} d(t-\frac1t)\\ &=&\frac2{\sqrt[4]2}\int_{0}^{\infty}\frac{1}{(t-\frac1t)^2+\sqrt2+2} d(t-\frac1t)\\ &=&\frac2{\sqrt[4]2}\int_{-\infty}^{\infty}\frac{1}{t^2+\sqrt2+2} dt\\ &=&\frac2{\sqrt[4]2}\frac\pi{\sqrt{\sqrt2+2}}=\sqrt2\pi\sqrt{\sqrt2-1}. \end{eqnarray}$$