Interesting integral $\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(1+\sin ^{2} x\right)^{2}}$ Latest Edit
Inspired by @J.G., I find a formula in general,
$$
\begin{aligned}
\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(1+\sin ^{2} x\right)^{n}} &=2 \int_{0}^{\pi} \frac{d x}{(3-\cos x)^{n}} \\
&=\left.\frac{2(-1)^{n}}{(n-1) !} \frac{\partial^{n}}{\partial a^{n}}\left(\int_{0}^{\pi} \frac{d x}{a-\cos x} \right)\right|_{a=3} \\
&=\left.\frac{2(-1)^{n} \pi}{(n-1) !} \frac{\partial^{n}}{\partial a^{n}}\left(\frac{1}{\sqrt{a^{2}-1}}\right)\right|_{a=3}
\end{aligned}
$$

Multiplying both the numerator and denominator $\sec^4x$ yields
$\displaystyle I=\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(1+\sin ^{2} x\right)^{2}}=\int_{0}^{\frac{\pi}{2}} \frac{\sec ^{4} x}{\left(\sec ^{2} x+\tan ^{2} x\right)^{2}} d x \tag*{} $
Letting $ t=\tan x$ gives
$\displaystyle \begin{aligned}I&= \int_{0}^{\infty} \frac{1+t^{2}}{\left(1+2 t^{2}\right)^{2}} d t\\&=\int_{0}^{\infty} \frac{1+\frac{1}{t^{2}}}{\left(2 t+\frac{1}{t}\right)^{2}} d t\\&=\int_{0}^{\infty} \frac{\frac{3}{4}\left(2+\frac{1}{t^{2}}\right)-\frac{1}{4}\left(2-\frac{1}{t^{2}}\right)}{\left(2 t+\frac{1}{t}\right)^{2}} d t\\&=\frac{3}{4} \int_{0}^{\infty} \frac{d\left(2 t-\frac{1}{t}\right)}{\left(2 t-\frac{1}{t}\right)^{2}+8}-\frac{1}{4} \int_{0}^{\infty} \frac{d\left(2 t+\frac{1}{t}\right)}{\left(2 t+\frac{1}{t}\right)^{2}}\\&=\left[\frac{3}{8 \sqrt{3}} \tan ^{-1}\left(\frac{2 t-\frac{1}{t}}{2 \sqrt{2}}\right)+\frac{1}{4\left(2 t+\frac{1}{t}\right)}\right]_{0}^{\infty}\\&=\frac{3 \pi}{8 \sqrt{2}}\end{aligned}\tag*{} $
Is there any method other than tangent half-angle substitution?

Start as J.G., then using differentiation yields
$$
\begin{aligned}
\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(1+\frac{1-\cos 2 x}{2}\right)^{2}} &=4 \int_{0}^{\frac{\pi}{2}} \frac{d x}{(3-\cos 2 x)^{2}} \\
&=2 \int_{0}^{\pi} \frac{d x}{(3-\cos x)^{2}} \\
&=-\left.2 \frac{\partial}{\partial a} \int_{0}^{\pi} \frac{d x}{a-\cos x}\right|_{a=3} \\
&=-\left.2 \frac{\partial}{\partial a}\left(\frac{\pi}{\sqrt{a^{2}-1}}\right)\right|_{a=3} \\
&=\frac{3 \pi}{8 \sqrt{2}}
\end{aligned}
$$
where the last second line comes from my post$\int_{0}^{\pi} \frac{d \theta}{a-b \cos \theta} =\frac{\pi}{\sqrt{a^{2}-b^{2}}}$.
