Ab*surd* Integrals

I am unable to find a proof for these integrals on the internet. emphasized text $$\displaystyle \int_0^{\frac{\pi}{2}} \cot^{-1}(\sqrt{1+\csc{\theta}}\,) \, \text{d}\theta = \frac{\pi^2}{12}$$

$$\displaystyle \int_0^\frac{\pi}{2} \csc^{-1}(\sqrt{1+\cot{\theta}}\,) \, \text{d}\theta = \frac{\pi^2}{8}$$

Sources: Brilliant, AoPS

I tried differentiating under the integral sign but I can't think of an appropriate parameter that leaves easily integrable rational functions.

I have tried exploiting the bounds to reflect and transform the integrand but to no avail.

A real solution is preferred but a complex solution is perfectly acceptable.

A geometric solution is not something I have considered but I'm just grasping at straws here.

• I understand your craving for these integrals, but capitalizing (part of) your title is not a good idea in view of the norm of this community. Commented Feb 5, 2017 at 13:56
• @SangchulLee It's a pun on the word "surd" Commented Feb 5, 2017 at 14:03
• I'm sure he knows that. Anyway I just enclosed it with asterisks. Commented Feb 5, 2017 at 14:03
• At the first glance you have inverse trig functions and trig functions. The best way would be to use integral representation of inverse functions, thus getting double algebraic integral of trig functions. After substitutions you will get just double algebraic integral, which almost surely can be resolved in known functions Commented Feb 5, 2017 at 14:04
• As an example, $$\cot^{-1}(x)=\tan^{-1} (1/x)=\int_0^1 \frac{x}{x^2+y^2} dy$$ Commented Feb 5, 2017 at 14:09

$$I_2=\int_{0}^{\pi/2}\arcsin\sqrt{\frac{\tan t}{1+\tan t}}\,dt=\int_{0}^{\pi/2}\arctan\sqrt{\tan t}\,dt=\int_{0}^{+\infty}\frac{\arctan\sqrt{u}}{1+u^2}\,du$$ and by splitting the last integration range as $(0,1)\cup(1,+\infty)$ and performing the substitution $u\mapsto\frac{1}{u}$ on the second part, $$I_2 = \int_{0}^{1}\frac{\arctan\sqrt{u}}{1+u^2}\,du+\int_{0}^{1}\frac{\frac{\pi}{2}-\arctan\sqrt{u}}{1+u^2}\,du = \frac{\pi}{2}\int_{0}^{1}\frac{du}{1+u^2}=\frac{\pi}{2}\cdot\frac{\pi}{4}=\color{red}{\frac{\pi^2}{8}}.$$ The first integral is $$I_1=\frac{\pi^2}{4}-\int_{0}^{\pi/2}\arctan\sqrt{\frac{1+\sin t}{\sin t}}\,dt=\frac{\pi^2}{4}-2\int_{0}^{\pi/4}\arctan\sqrt{\frac{1+\cos(2t)}{\cos (2t)}}\,dt$$ and $$\int_{0}^{\pi/4}\arctan\sqrt{\frac{1+\cos(2t)}{\cos (2t)}}\,dt=\int_{0}^{1}\arctan\sqrt{\frac{2}{1-u^2}}\frac{du}{1+u^2}$$ is a variant of Ahmed's integral that can be tackled through differentiation under the integral sign: it is enough to be able to integrate $\frac{\sqrt{1-u^2}}{(1+a-u^2)(1+u^2)}$.