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)}$
$$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}$$