Proving: $\int_0^\infty\left(\frac{\ln x}{x^2+2ax\cos(t)+a^2}\right)\rm{d}x=\frac{t\ln (a)}{a\sin (t)}$ 
Show that $$\int_{0}^{\infty} \left(\frac{\ln x}{x^2+2ax\cos (t) + a^2}\right)\rm{d}x=\frac{t\ln (a)}{a \sin(t)}$$

I used this integral to prove some similar integrals for different values of $t$ and $a$ like $t=\frac{\pi}{2}$, but I was not able to prove this one. I tried some methods like contour integration but many of them leads to more difficult integrals.
I think that chebyshev polynomials will be used as $\sum\limits_0^\infty{U_k (t)}x^k=\frac1{x^2-2x\cos(t)+1}$ ,where $\{U_k(t)\}$ is chebyshev polynomial of second kind defined by the identity  $\{U_k(\cos\theta)\}=\frac {\sin(k+1)\theta}{\sin\theta}$
Can anybody help me to prove this!?
 A: $$I=\int_{0}^{\infty} \left(\frac{\ln x}{x^2 + 2 a x \cos (t) + a^2}\right) \rm{d}x$$
Put $$x=\frac{1}{y}$$
$$I=\int_{0}^{\infty} \left(\frac{-\ln y}{a^2y^2 + 2 a y \cos (t) + 1}\right) \rm{d}y$$
Put $ay=z$
$$I=-\frac{1}{a}\int_{0}^{\infty} \left(\frac{\ln z-\ln a}{z^2 + 2 z \cos (t) + \cos^2t+\sin^2t}\right) \rm{d}z$$
$$I=-\frac{1}{a}\int_{0}^{\infty} \left(\frac{\ln z}{z^2 + 2 z \cos (t) + 1}\right) \rm{d}z+\frac{1}{a}\int_{0}^{\infty} \left(\frac{\ln a}{z^2 + 2 z \cos (t) +\cos^2t+\sin^2t }\right) \rm{d}z$$
$$I=-\frac{1}{a}J+\frac{\ln a}{a\sin t}\left|\tan^{-1}\frac{z+\cos t}{\sin t}\right|_{0}^{\infty}$$
$$I=-\frac{1}{a}J+\frac{\ln a}{a\sin t}\left(\frac{\pi}{2}-\tan^{-1}(\cot t)\right)$$
$$I=-\frac{1}{a}J+\frac{\ln a}{a\sin t}\left(\frac{\pi}{2}-\tan^{-1}\left(\tan\left(\frac{\pi}{2}- t\right)\right)\right)$$
$$I=-\frac{1}{a}J+\frac{t\ln a}{a\sin t}$$
$J=0$ can be easily obtained by putting $z=\frac{1}{u}$
$$I=-\frac{1}{a}(0)+\frac{t\ln a}{a\sin t}$$
$$I=\frac{t\ln a}{a\sin t}$$
A: Here's a complex analysis based solution. Consider the function $f(z)=\frac{\ln^2(z)}{z^2-2az\cos t+a^2}$. Now use a keyhole contour centered on $z=0$. The reason why we want to do this is because we want to take advantage of the fact that the discontinuity of $\ln^2z$ along the branch cut is proportional to $\ln z$. Indeed
$$\lim_{\epsilon\to 0}[\ln^2(x+i\epsilon)-\ln^2(x-i\epsilon)]=4i\pi\ln |x|~~, ~~x<0$$ 
Considering the poles in the keyhole contour and since the contour avoids all branch cuts but includes the poles of the denominator at $z_{\pm}=ae^{\pm it}$ we see that the integral can be evaluated using the residue theorem
$$\oint{f(z)dz}=2\pi i\sum_\pm \text{Res}_{z=z_\pm}(f(z))=\frac{4\pi it\ln a}{a\sin t}$$
However, since the integral of the function on the large circle ($R\to\infty$) and the small circle ($r\to0$) vanish, the only thing left to consider is the integral on the paths surrounding the branch cut:
$$\begin{align}\oint{f(z)dz}&=\int_{z=re^{i\pi}} f(z)dz-\int_{z=re^{-i\pi}} f(z)dz\\&=\int_{0}^{\infty}dr\frac{\ln^2(re^{i\pi})-\ln^2(re^{-i\pi})}{r^2+2ar\cos t+a^2}\\&=4\pi i\int_{0}^{\infty}dr\frac{\ln r}{r^2+2ar\cos t+a^2}\end{align}$$
and thus we conclude the desired result:
$$\int_{0}^{\infty}dr\frac{\ln r}{r^2+2ar\cos t+a^2}=\frac{t\ln a}{a\sin t}$$
A: Let $r$ and $s$ be the roots of the quadratic (denominator) an uds aprtial fraction decomposition
$$\frac{1}{(x-r) (x-s)}=\frac1 {r-s}\left(\frac1 {x-r}-\frac1 {x-s} \right)$$and remember that
$$\int\frac{\log(x)}{x-a}=\text{Li}_2\left(\frac{x}{a}\right)+\log (x) \log \left(1-\frac{x}{a}\right)$$ So
$$I=\int \frac{\log(x)}{(x-r) (x-s)}=\frac1 {r-s}\left(\text{Li}_2\left(\frac{x}{r}\right)+\text{Li}_2\left(\frac{x}{s}\right)+\log (x)
   \log \left(1-\frac{x}{r}\right)-\log (x) \log \left(1-\frac{x}{s}\right) \right)$$
$$J=\int_0^\infty \frac{\log(x)}{(x-r) (x-s)}=\frac{\log ^2\left(-\frac{1}{s}\right)-\log ^2\left(-\frac{1}{r}\right)}{2 (r-s)}$$
Now,$r=-a\,e^{it}$ and $s=-a\,e^{-it}$ gives
$$J=\frac{\log ^2\left(\frac{e^{-i t}}{a}\right)-\log ^2\left(\frac{e^{i t}}{a}\right) } {4 i a \sin (t) }=\frac{4i t \log(a)}{4 i a \sin (t) }=\frac{t \log(a)}{a \sin(t)}$$
