= Solution
Put $D(z)=\sinh^2z+\cosh^2a$ and $S=\sinh(2a)>0$. Traverse the rectangle $-R\to R\to R+\pi i\to-R+\pi i\to-R$ with <positive orientation of a contour>, taking $R>a$. Part (i) shows that the only enclosed <poles> of $f(z)=z/D(z)$ are
$$
z_+=a+\frac{\pi i}2,\qquad z_-=-a+\frac{\pi i}2.
$$
They are <simple poles> because
$$
D'(z)=2\sinh z\cosh z=\sinh(2z),\qquad D'(z_+)=-S,\quad D'(z_-)=S.
$$
The <residue formula for a quotient at a simple denominator zero> gives
$$
\operatorname{Res}(f,z_+)=-\frac{a+\pi i/2}{S},\qquad \operatorname{Res}(f,z_-)=\frac{-a+\pi i/2}{S}.
$$
Their imaginary terms cancel and their <residues> sum to $-2a/S$. Thus <Cauchy's residue theorem> gives
$$
\int_{\Gamma_R}f(z)\,dz=-\frac{4\pi ia}{S}.
$$
\Image[/past-exam-of-the-metric-spaces-and-complex-analysis-course-of-the-university-of-oxford/metric-2015-residue-contour.png]
{title=The <positively oriented contour> encloses the two <poles> at $\pm a+\pi i/2$}
{description=The top edge is traversed from right to left. Its reversed <orientation of a contour> and the imaginary shift in the numerator produce $-i\pi$ times the desired real <integral>.}
The choice of numerator $z$ makes the horizontal sides useful. The <hyperbolic sine> satisfies $\sinh(z+\pi i)=-\sinh z$, so $D(x+\pi i)=D(x)$. Consequently the lower and upper <contour integrals>, with their actual orientations, add to
$$
\begin{aligned}
\int_{-R}^{R}\frac{x}{D(x)}\,dx+\int_R^{-R}\frac{x+\pi i}{D(x)}\,dx
&=-\pi i\int_{-R}^{R}\frac{dx}{D(x)}.
\end{aligned}
$$
It remains to justify discarding both vertical sides. On either side $z=\pm R+iy$, $0\leq y\leq\pi$, the <reverse triangle inequality> and part (b)(ii) imply
$$
|D(z)|\geq|\sinh z|^2-\cosh^2a\geq\sinh^2R-\cosh^2a.
$$
This lower bound is positive for sufficiently large $R$. Also $|z|\leq R+\pi$ and each vertical side has length $\pi$. The <estimation lemma> bounds the absolute value of the sum $V_R$ of the vertical contributions by
$$
|V_R|\leq\frac{2\pi(R+\pi)}{\sinh^2R-\cosh^2a}\longrightarrow0.
$$
The real <improper integral> converges absolutely, since its integrand is continuous on the <real axis> and decays like $4e^{-2|x|}$ at infinity. Combining all four sides and taking $R\to\infty$ gives
$$
-\pi i\int_{-\infty}^{\infty}\frac{dx}{\sinh^2x+\cosh^2a}=-\frac{4\pi ia}{\sinh(2a)}.
$$
Therefore
$$
\boxed{\int_{-\infty}^{\infty}\frac{dx}{\sinh^2x+\cosh^2a}=\frac{4a}{\sinh(2a)},\qquad a>0.}
$$
An independent real-variable check uses the <hyperbolic tangent> substitution $u=\tanh x$: the <integral> becomes $\int_{-1}^{1}du/(\cosh^2a-u^2\sinh^2a)$. Its <antiderivative> uses the <inverse hyperbolic tangent>, giving $2\operatorname{arctanh}(\tanh a)/(\sinh a\cosh a)=4a/\sinh(2a)$. As $a\downarrow0$, this tends to $2$, agreeing with $\int_{-\infty}^{\infty}\operatorname{sech}^2x\,dx=2$ and checking the factor of two.
Back to article page