# Integrate $\int_{-\infty}^\infty [4(\log r_1 - \log r_2) - 2(x_1^2/r_1^2 - x_2^2/r_2^2)]^2 dx$

As the title suggests, I am having trouble evaluating the following definite integral:

$$\int_{-\infty}^\infty \left[4\left(\log r_1 - \log r_2\right) - 2\left(\frac{x_1^2}{r_1^2} - \frac{x_2^2}{r_2^2}\right)\right]^2 dx$$

where

\begin{align} x_1 &= x-a\\ x_2 &= x+a\\ r_1^2 &= x_1^2 + z^2\\ r_2^2 &= x_2^2 + z^2 \end{align}

and $$a > 0$$, $$z > 0$$.

I've started by expanding the square, which gives

$$\int_{-\infty}^\infty \left[16\left(\log r_1 - \log r_2\right)^2 - 16\left(\log r_1 - \log r_2\right)\left(\frac{x_1^2}{r_1^2} - \frac{x_2^2}{r_2^2}\right) + 4\left(\frac{x_1^2}{r_1^2} - \frac{x_2^2}{r_2^2}\right)^2\right] dx.$$

I managed to integrate the rightmost term $$4(x_1^2/r_1^2 - x_2^2/r_2^2)^2$$ using a partial fraction decomposition. However, I'm struggling with the two remaining terms: $$16(\log r_1 - \log r_2)^2$$ and $$-16(\log r_1 - \log r_2)(x_1^2/r_1^2 - x_2^2/r_2^2)$$.

I only know that the integral converges, as I am able to approach it numericaly by fixing $$a$$ and $$z$$.

If anyone has an idea on how to proceed, or, even better, has a solution, I'll take it.

Thanks!