# Improper Integral - Partial Fractions or a Trick?

$$\int_{-\infty}^{\infty}\frac{dx}{(x^2+ax+a^2)(x^2+bx+b^2)}$$ a and b are real constants

How should I solve the above integral? Is there a nice, interesting method? or is partial fractions the only way to do it?

I did solve it using partial fractions, but it got really lengthy and cumbersome - wondering if there's a nicer way to do it.

Thanks a lot!

• Are $a,b$ positive? – Szeto Jul 2 '18 at 5:12
• Nothing of that sort has been mentioned. – arya_stark Jul 2 '18 at 5:13
• For what it's worth: WolframAlpha spits out an answer. wolframalpha.com/input/… – Benjamin Dickman Jul 2 '18 at 5:18
• How's that gonna help? – arya_stark Jul 2 '18 at 5:19
• Have you tried $y=x+(a+b)/4$ to make partial fractions less messy? – J.G. Jul 2 '18 at 6:11

Wolfy’s answer is over-complicated, because it doesn’t know residue theorem:).

This integral is what exactly residue theorem can deal with easily.

The denominator can be factorized to $$(x-p|a|)(x-\overline p|a|)(x-q|b|)(x-\overline q|b|)$$

where $$p=\frac{-\text{sgn}(a)+i\sqrt 3}2$$ $$q=\frac{-\text{sgn}(b)+i\sqrt 3}2$$

Now, take a contour $C$ which is an infinitely large semicircle centered at the origin on the upper half of the complex plane.

By residue theorem, $$\oint_C\frac1{(x-p|a|)(x-\overline p|a|)(x-q|b|)(x-\overline q|b|)}dx=2\pi i\sum \text{residue included}$$

Also note that $$\oint_C=\underbrace{\int_{\text{arc}}}_{\to0}+\int^\infty_{-\infty}$$

The only residue included are at $A=p|a|$ and $B=q|b|$, and the residues at these two points are respectively $$\text{Res}_{p|a|}=\frac1{(p|a|-\overline p|a|)(p|a|-q|b|)(p|a|-\overline q|b|)}=\frac1{i\sqrt3|a| (p|a|-q|b|)(p|a|-\overline q|b|) }$$ $$\text{Res}_{q|b|}=\frac1{(q|b|-p|a|)(q|b|-\overline p|a|)(q|b|-\overline q|b|)}=\frac1{i\sqrt3|b| (q|b|-p|a|)(q|b|-\overline p|a|) }$$

The residues can be compactly written as

$$\text{Res}_{A}=\frac1{i\sqrt3|a| (A-B)(A-\overline B) }$$

$$\text{Res}_{B}=\frac1{i\sqrt3|b| (B-A)(B-\overline A) }$$

The computation is then complete:

$$\color{red}{\int^\infty_{-\infty}\frac1{(x^2+ax+a^2)(x^2+bx+b^2)}dx=\frac{2\pi}{\sqrt3(A-B)}\left(\frac1{|a|(A-\overline B)}+\frac1{|b|(\overline A-B)}\right)}$$

The residues might look complicated but do not be afraid to do some tedious algebra to add them up. There are surely some good simplifications/effective cancellations.

**Can you observe the hidden symmetry between $a$ and $b$ in the result? :)