<s>[INST] Integration of a rational function from +/- infinity I am trying to calculate the integral
$$\int_{-\infty}^{\infty}{\frac{a+x}{b^2 + (a+x)^2}\frac{1}{1+c(a-x)^2}}dx$$
where $\{a, b, c\}\in \mathbb{R}$. I have looked in a table of integrals for rational functions, but with no luck. Is there a smart trick I can utilize?
 [/INST] Why don't you want to simplify it by putting the term under the integral in the following manner:
$$\frac{a+x}{b^2 + (a+x)^2}\frac{1}{1+c(a-x)^2}=\frac{\alpha +x}{\beta  (c (x-a)^2+1)}-\frac{\gamma }{\delta +x}$$
with $$\alpha =\frac{4 a^2 c+a b^2 c+1}{b^2 c}$$
$$\beta =\frac{4 a^2 c+4 a b^2 c+b^4 c+1}{b^2 c}$$
$$\gamma =\frac{b^2}{4 a^2 c+4 a b^2 c+b^4 c+1}$$
$$\delta =a+b^2$$
which are just constants.
So
$$
\begin{eqnarray*}
\int_{-\infty}^{\infty}{\frac{a+x}{b^2 + (a+x)^2}\frac{1}{1+c(a-x)^2}}dx=\frac{\alpha}{\beta c}\int_{-\infty}^{\infty} \frac{1}{ (x-a)^2+\frac{1}{c}}dx&+&\\+\frac{1}{\beta c}\int_{-\infty}^{\infty} \frac{x}{ (x-a)^2+\frac{1}{c}}dx &-&\\-\gamma\int_{-\infty}^{\infty} \frac{1}{\delta +x}dx
\end{eqnarray*}
$$
</s>