Show that\begin{align*} \int_{-\infty}^\infty \frac{e^x}{e^{2x}+e^{2a}}\frac{1}{x^2+\pi^2}dx = \frac{2\pi e^{-a}}{4a^2+\pi^2}-\frac{1}{1+e^{2a}} \end{align*}where $a\in \mathbb{R}$.
My small try
Let $\displaystyle f(z) = \frac{e^z}{(e^{2z}+e^{2a})z}$. Let $\Gamma$ be the positively oriented rectangle in the complex plane with vertices $R-i\pi$, $R+i\pi$, $-R+i\pi$ and $-R-i\pi$ where $R>|a|$. There are three first order poles of $f(z)$ lying inside $\Gamma$ at $z= 0, \frac{i\pi}{2}+a$ and $-\frac{i\pi}{2}+a$. Then, by the residue theorem, we have \begin{align*} \int_\Gamma f(z)\; dz &= 2\pi i \left( \mathop{\text{Res}}_{z=0} \; f(z) + \mathop{\text{Res}}_{z=\frac{i\pi}{2}+a} \; f(z) + \mathop{\text{Res}}_{z=-\frac{i\pi}{2}+a} \; f(z)\right) \\ &= 2\pi i \left( \frac{1}{1+e^{2a}} - \frac{i e^{-a}}{2a+i\pi} + \frac{i e^{-a}}{2a-i\pi}\right) \\ &= 2\pi i \left( \frac{1}{1+e^{2a}} - \frac{2\pi e^{-a}}{4a^2 +\pi^2}\right) \tag{1} \end{align*}
Suppose $a\ge 0$. Let $\displaystyle f(z) = \frac{e^z}{(e^{2z}+e^{2a})(z^2+\pi^2)}$. Then $f(z)$ will have poles $$ z=\pi i, z_k=(k+\frac12)\pi i+a,k=0,1,2,\cdots.$$ in the upper half plane.
Set $R_n=\sqrt{(k+1)^2\pi^2+a^2}$. Let $\Gamma_n$ be the union of the upper semi-circle $\gamma_n$ with radius $R_n$ centered at $0$ and the segment from $-R_n$ to $R_n$. Clearly $f(z)$ has poles $$ z=\pi i, z_k=(k+\frac12)\pi i+a,k=0,1,2,\cdots, n $$ and analytic in $\gamma_n$. Then \begin{align*} \int_{-R_n}^{R_n}f(x)dx+\int_{\gamma_n} f(z)\; dz &= 2\pi i \left( \mathop{\text{Res}}_{z=\pi i} \; f(z) + \sum_{k=0}^n\mathop{\text{Res}}_{z=z_k} \; f(z)\right) \\ &= 2\pi i \left( \frac{i}{2\pi(1+e^{2a})}+\sum_{k=0}^n\frac{i (-1)^{k+1}e^{-a}}{2} \frac{1}{z_k^2+\pi^2}\right) \\ &=-\frac{1}{1+e^{2a}}+\pi e^{-a}\sum_{k=0}^n \frac{(-1)^{k}}{z_k^2+\pi^2}. \end{align*} Now letting $n\to\infty$ gives \begin{align*} \int_\infty^\infty f(x)\; dx &=-\frac{1}{1+e^{2a}}+\pi e^{-a}\sum_{k=0}^\infty \frac{(-1)^{k}}{z_k^2+\pi^2}. \end{align*} Note $$ \begin{eqnarray} &&\sum_{k=0}^\infty \frac{(-1)^{k}}{z_k^2+\pi^2}=\sum_{k=0}^\infty \frac{(-1)^{k}}{((k+\frac12)\pi i+a)^2+\pi^2}\\ &=&\frac{1}{\pi^2}\sum_{k=0}^\infty (-1)^{k-1} \frac{1}{(k+(\frac12-\frac{ai}{\pi}))^2-1}\\ &=&\frac{1}{2\pi^2}\sum_{k=0}^\infty (-1)^{k-1}\bigg(\frac{1}{k-\frac12-\frac{ai}{\pi}}-\frac{1}{k+\frac{3}2-\frac{ai}{\pi}}\bigg)\\ &=&-\frac{1}{2\pi^2}\bigg(\frac{1}{-\frac12-\frac{ai}{\pi}}-\frac{1}{\frac12-\frac{ai}{\pi}}\bigg)\\ &=&\frac{2}{4a^2+\pi^2}. \end{eqnarray}$$