It is known (can be deduced in one turn) from this post that $$ I=\int^{\pi/2}_{0}\frac{\theta \cos(\theta)}{1+\sin^{2}(\theta)}d\theta=\frac{1}{2}\ln^2(1+\sqrt{2}) $$ I'm trying to use different approach of evaluation:
Generalize with parametrization: $\theta\to \arccos(b\cos(\theta))$. $b\in[-1,1]$
Differentiate over $b$: $$\frac{\partial I}{\partial b}=-\int^{\pi/2}_{0}\frac{\cos^2(\theta)}{(1+\sin^{2}(\theta))\sqrt{1-b^2\cos^2(\theta)}}d\theta$$ Note: argument is continuous at all point exept $\theta=\pi k, k\in\mathbb{Z}, b=\pm1$.
Use symmetry of reflection: $$-\frac{1}{2}\int^{\pi/2}_{-\pi/2}\frac{\cos^2(\theta)}{(1+\sin^{2}(\theta))\sqrt{1-b^2\cos^2(\theta)}}d\theta$$
Shift $\theta\to\theta +\pi/2$: $$-\frac{1}{2}\int^{\pi}_{0}\frac{\sin^2(\theta)}{(1+\cos^{2}(\theta))\sqrt{1-b^2\sin^2(\theta)}}d\theta$$
Use identities: $\cos^2(\theta)=\frac{1+\cos(2\theta)}{2},\sin^2(\theta)=\frac{1-\cos(2\theta)}{2}$ and substitute $t=2\theta$: $$-\frac{1}{4}\int^{2\pi}_{0}\frac{1-\cos(t)}{(3+\cos(t))\sqrt{1-\frac{b^2}{2}(1-\cos(t))}}dt$$
Use substitution from complex analysis: $\cos(t)=\frac{z^2+1}{2z},dt=\frac{dz}{iz}$, which after simplification gives: $$\frac{1}{2|b|i}\int_{|z|=1}\frac{z^2-2z+1}{(z^2+6z+1)\sqrt{z^2+\left(\frac{4}{b^2}-2\right)z+1}}\frac{dz}{\sqrt{z}}$$
Nonzero residue only at $z_1=-3+2\sqrt{2}$, which after all simplifications leads to $$\frac{\partial I}{\partial b}=\frac{\pi}{2i}\frac{1}{\sqrt{b^2-\frac{1}{2}}}$$
Which definitely is not right, because for $b>\frac{\sqrt{2}}{2}$ result appears to be complex, while it should be real. So, I wonder where I made a mistake.