Compute $\int_0^{\pi/2} \frac{1}{(\sinh t)^{2}+(\sin{\theta)^{2}}} d\theta$ by residues We want to compute $\int_0^{\pi/2} \frac{1}{(\sinh t)^{2}+(\sin{\theta)^{2}}} d\theta$ with $t>0$ using residues. 
The first thing I want to do is using $z=e^{i\theta}$ to transform the integral to an integral over the unit circle. But I don't know how to do it.
Then I want to use the residue theorem to compute the integral. I have been searching and I found that the solution equals $\pi/\sinh(2t)$.
Please, can anyone help me to solve this integral?
 A: If you substitute $z = e^{i\theta}$ directly, you get a polynomial of degree $4$ in the denominator, and finding its roots may be a bit difficult. If you first transform the $(\sin\theta)^2$ using a trigonometric identity,
$$\sin^2\theta = \frac{1}{2}(1 - \cos (2\theta)),$$
the substitution leads to a quadratic polynomial in the denominator, and that is easier to handle. So
$$\begin{align}
\int_0^{\pi/2} \frac{d\theta}{(\sinh t)^2 + (\sin\theta)^2} &= \int_0^{\pi/2} \frac{2\,d\theta}{2(\sinh t)^2 + 1 - \cos (2\theta)}\\
&= \int_0^\pi \frac{d\varphi}{1+2(\sinh t)^2 - \cos \varphi}\\
&= \int_0^\pi \frac{d\varphi}{(\cosh t)^2 + (\sinh t)^2 - \cos\varphi}\\
&= \int_0^\pi \frac{d\varphi}{\cosh (2t) - \cos\varphi}.
\end{align}$$
By parity ($\cos$ is even), we obtain
$$\int_0^{\pi/2} \frac{d\theta}{(\sinh t)^2 + (\sin \theta)^2} = \frac{1}{2}\int_{-\pi}^\pi \frac{d\varphi}{\cosh (2t) - \cos\varphi}.$$
Now we can substitute $z = e^{i\varphi}$ and obtain an integral over the unit circle,
$$\begin{align}
\int_0^{\pi/2} \frac{d\theta}{(\sinh t)^2 + (\sin \theta)^2}
&= \frac{1}{2}\int_{\lvert z\rvert = 1} \frac{1}{\cosh (2t) - \frac{1}{2}(z + z^{-1})}\frac{dz}{iz}\\
&= \frac{1}{i} \int_{\lvert z\rvert = 1} \frac{dz}{2\cosh (2t)z - z^2 - 1}\\
&= i \int_{\lvert z\rvert = 1} \frac{dz}{z^2 - 2\cosh (2t)z + 1}\\
&= i \int_{\lvert z\rvert = 1} \frac{dz}{(z-\cosh (2t))^2 - (\sinh (2t))^2}\\
&= i \int_{\lvert z\rvert = 1} \frac{dz}{(z-\cosh (2t) - \sinh (2t))(z-\cosh (2t) + \sinh (2t))}.
\end{align}$$
The zero $\cosh (2t) + \sinh (2t)$ of the denominator lies outside the unit disk, hence by Cauchy's integral formula/the residue theorem,
$$\begin{align}
\int_0^{\pi/2} \frac{d\theta}{(\sinh t)^2 + (\sin \theta)^2}
&= i\frac{2\pi i}{(\cosh (2t) - \sinh (2t)) - (\cosh (2t) + \sinh (2t))}\\
&= \frac{-2\pi}{-2\sinh (2t)}\\
&= \frac{\pi}{\sinh (2t)}.
\end{align}$$
