<s>[INST] Integral $\int_{-D}^D \frac{1}{x-ia} \log \frac{(x-2D)^2+a^2}{x^2+a^2} dx$ For $a>0$ and $D>0$, I want to evaluate the integral
$$\int_{-D}^D \frac{1}{x-ia} \log \frac{(x-2D)^2+a^2}{x^2+a^2} dx.$$
Here $i$ is the imaginary unit. This integral arises when evaluating a Feynman diagram in physics.
 [/INST] It does not seem to be the most pleasant integral. Focusing on the antoderivative, let first $x=a y$ and $k=\frac{2D}a$to make
$$I=\int \frac{1}{x-ia} \log \left(\frac{(x-2D)^2+a^2}{x^2+a^2}\right)\,dx=\int\frac{1}{y-i}\log \left(\frac{\left(y-k\right)^2+1}{y^2+1}\right)\,dy$$ Deloping the logarithm of the ratio, you then face two integrals looking like
$$J_k=\int \frac{1}{y-i}\log \left({\left(y-k\right)^2+1}{}\right)\,dy$$
$$J_k=\text{Li}_2\left(\frac{k-y-i}{k-2
   i}\right)+\text{Li}_2\left(\frac{k-y+i}{k}\right)+\log (y-i) \log
   \left((k-y)^2+1\right)-\log (k) \log (-k+y-i)+\left(\log \left(\frac{y-i}{k-2
   i}\right)-\log (y-i)\right) \log (-k+y+i)$$
$$J_0=\text{Li}_2\left(-\frac{1}{2} i (y+i)\right)+\left(\log \left(y^2+1\right)-\log
   (y+i)\right) \log (y-i)-\frac{1}{2} \log ^2(y-i)+$$ $$\log \left(\frac{1}{2} (1+i
   y)\right) \log (y+i)$$
The definite integral will not be very nice looking.
</s>