A tough definite integral using contour integration For some reason, I am guessing that for any fixed $s_1,s_2>0$ and $\varepsilon >0$ being small, we have
\begin{align}&\quad-\int_0^\infty \frac{1}{2\pi} \log\left(\frac{(x-s_1)^2+s^2_2}{(x+s_1)^2+s^2_2}\right)\frac{4x\sin\varepsilon}{x^4-2x^2\cos\varepsilon +1}\,dx\\&= \log\left(\frac{1+s^2_1+s^2_2+2s_2\sin(\frac{\varepsilon}{2})+2s_1\cos(\frac{\varepsilon}{2})}{1+s^2_1+s^2_2+2s_2\sin(\frac{\varepsilon}{2})-2s_1\cos(\frac{\varepsilon}{2})}\right),
\end{align}
and I believe this can be shown by some clever contour integration. However, I really didn't figure out the contour that should be used to evaluate the integral... Any help or suggestions would be greatly appreciated!
 A: As suggested, a contour integration technique can be used to evaluate this integral. Notice first that the integrand is an even function of $x$, then
\begin{align}
I&=- \frac{1}{2\pi}\int_0^\infty \log\left(\frac{(x-s_1)^2+s^2_2}{(x+s_1)^2+s^2_2}\right)\frac{4x\sin\varepsilon}{x^4-2x^2\cos\varepsilon +1}\,dx\\
&=- \frac{1}{4\pi}\int_{-\infty}^\infty \log\left(\frac{(x-s_1)^2+s^2_2}{(x+s_1)^2+s^2_2}\right)\frac{4x\sin\varepsilon}{x^4-2x^2\cos\varepsilon +1}\,dx
\end{align}
Considering the integral
\begin{equation}
J=- \frac{1}{2\pi}\int_{-\infty}^\infty \log\left(\frac{x-s_1+is_2}{x+s_1+is_2}\right)\frac{4x\sin\varepsilon}{x^4-2x^2\cos\varepsilon +1}\,dx
\end{equation}
where the log function is defined with a branch cut between the points $−s_1−is_2$ and $s_1−is_2$ with $s_2>0$. One can show that  it is purely real (see (**)). By expressing the real part (see (*)), we find $J=I$.
The function is holomorphic for $\Im x>0$ except at the poles $x_k$ of the rational fraction with $\Im (x_k)>0$. If the real axis is closed by the upper  half-circle $C_R$, the integral can then be evaluated by the residue method. The   $C_R$ contribution vanishes as $R\to\infty$.
Assuming $0<\varepsilon<2\pi$, the poles of interest are simple : $x_+=e^{i\varepsilon/2}$ and $x_-=-e^{-i\varepsilon/2}$. The residues are then evaluated as
\begin{align}
R_{\pm}&=\operatorname{Res}\left[  \log\left(\frac{x-s_1+is_2}{x+s_1+is_2}\right)\frac{4x\sin\varepsilon}{x^4-2x^2\cos\varepsilon +1},x_\pm\right]\\
&= \log\left(\frac{x_\pm-s_1+is_2}{x_\pm+s_1+is_2}\right)\frac{4x_\pm\sin\varepsilon}{\left.\frac{d}{dx}\left[x^4-2x^2\cos\varepsilon +1\right]\right|_{x=x_\pm}}\\
&=\log\left(\frac{x_\pm-s_1+is_2}{x_\pm+s_1+is_2}\right)\frac{\sin\varepsilon}{x_\pm^2-\cos\varepsilon}\\
&=\mp i\log\left(\frac{x_\pm-s_1+is_2}{x_\pm+s_1+is_2}\right)
\end{align}
and thus
\begin{align}
I&=-\frac{1}{2\pi}2i\pi \sum_{\pm} R_{\pm}\\
&=-\log\left(\frac{\cos\left(\frac{\varepsilon}{2}\right)-s_1+i(s_2+\sin\left(\frac{\varepsilon}{2}\right))}{\cos\left(\frac{\varepsilon}{2}\right)+s_1+i(s_2+\sin\left(\frac{\varepsilon}{2}\right))}\right)+\log\left(\frac{-\cos\left(\frac{\varepsilon}{2}\right)-s_1+i(s_2+\sin\left(\frac{\varepsilon}{2}\right))}{-\cos\left(\frac{\varepsilon}{2}\right)+s_1+i(s_2+\sin\left(\frac{\varepsilon}{2}\right))}\right)\\
&=-\log\left(\frac{(\cos\left(\frac{\varepsilon}{2}\right)-s_1)^2+(s_2+\sin\left(\frac{\varepsilon}{2}\right))^2}{(\cos\left(\frac{\varepsilon}{2}\right)+s_1)^2+(s_2+\sin\left(\frac{\varepsilon}{2}\right))^2}\right)
\end{align}
Finally,
\begin{equation}
I= \log\left(\frac{1+s^2_1+s^2_2+2s_2\sin(\frac{\varepsilon}{2})+2s_1\cos(\frac{\varepsilon}{2})}{1+s^2_1+s^2_2+2s_2\sin(\frac{\varepsilon}{2})-2s_1\cos(\frac{\varepsilon}{2})}\right)
\end{equation}
as proposed.

(*): using $\log\left( Z \right)=\frac{1}{2}\log\left|Z\right|^2+i\operatorname{Arg}(Z)$
(**): If
\begin{equation}
J=\int_{-\infty}^\infty \log\left(\frac{x-s_1+is_2}{x+s_1+is_2}\right)f(x)\,dx
\end{equation}
where $f(-x)=-f(x)$ and $s_{1,2}$ are real, then the complex conjugate
\begin{align}
J^*&=\int_{-\infty}^\infty \log\left(\frac{x-s_1-is_2}{x+s_1-is_2}\right)f(x)\,dx\\
&=\int_{-\infty}^\infty \log\left(\frac{-x+s_1+is_2}{-x-s_1+is_2}\right)f(x)\,dx\\
&=\int_{-\infty}^\infty \log\left(\frac{y+s_1+is_2}{y-s_1+is_2}\right)f(-y)\,dy\\
&=J
\end{align}
The integral is thus real.
A: Following Zacky's comments, the biggest challenge is the evaluation of $$\int_{-\infty}^\infty \left(\frac{x^2}{x^2-2ax\cos t+a^2+b^2}+\frac{x^2}{x^2+2ax\cos t+a^2+b^2}\right)\frac{2a\sin t \sin y}{x^4-2x^2\cos y +1}dx,$$ note that the integrand is even in $x$ and we can restrict the domain of $t$ to be $[0,\frac{\pi}{2}]$. To calculate the above integral we let $f(z)$ to the integrand with $x$ being replaced by $z$, and integrate along a large upper semi-circle of radius $R$, call this path $\gamma_R$, then $f$ has four simple poles located at $\pm a\cos(t)+i\sqrt{(a\sin(t))^2+b^2}$, $e^{\frac{iy}{2}}$ and $-e^{-\frac{iy}{2}}$, respectively. However, the residue calculations at these points are very sophisticated and I didn't see any simplifications that can be made to make things clear...
A: Without contour integration.
I changed notations and focused on
$$\int \frac{ x  }{x^4-2 x^2 \cos
   (t)+1}\log \left(\frac{(x-a)^2+b^2}{(a+x)^2+b^2}\right)$$ Surprising or not, a CAS is able to compute the antiderivative which is a monster.
What I should do first is partial fraction decomposition to get
$$\frac x{x^4-2 x^2 \cos(t)+1}=\frac 1{r-s} \left(\frac x {x^2-r}-\frac x {x^2-s} \right)$$ where $r$ and $s$ are the roots of the quadratic equation in $x^2$; they are $r=e^{it}$ and $s=e^{-it}$.
I should decompose the logarithm too and integrate; each of the four required integrals has a closed form (not the most pleasant but perfectly workable).
Integrate from $0$ to $p$ and take the limit when $p\to \infty$.
