<s>[INST] Integral of $\frac{1}{(ax^2+bx+c)}$ from $-\infty$ to $\infty$ Can someone spot my error? I am trying to find a general solution for 
$$\int_{-\infty}^\infty \frac {1}{ax^2 + bx + c} \, dx $$ using complex analysis.
I substitute a complex variable, $z$, for $x$ then find the roots and take only the root above the real axis 
$$z = \frac{-b}{2a} + \frac{\sqrt{4ac - b^2}}{2a}i$$
This tells me that:
$$\int_{-\infty}^\infty \frac 1 {ax^2 + bx + c} \, dx = \int \frac {dz} {\left( z + \frac{b+\sqrt{4ac-b^2}i}{2a} \right) \left(z+\frac{b-\sqrt{4ac-b^2}i}{2a} \right)}$$
Finding the residue at $\ z = \displaystyle\frac {-b}{2a} + \frac{\sqrt {4ac - b^2}}{2a}i$
$$R\left(\frac {-b}{2a} + \frac{\sqrt{4ac - b^2}}{2a}i\right) 
= \frac{1}{\left(\frac{-b+i\sqrt{4ac-b^2}}{2a}+\frac{-b+i\sqrt{4ac-b^2}}{2a}\right)} = \frac{1}{\frac{2i\sqrt{4ac-b^2}}{2a}} = \frac{a}{i\sqrt{4ac-b^2}}$$
$$\int_{-\infty}^\infty \frac {1}{(ax^2 + bx + c)}dx= {2\pi i} R = \frac{2a\pi}{\sqrt {4ac-b^2}}$$
but checking some example on wolfram alpha, I can see that the actual value is $\frac{2\pi}{\sqrt {4ac-b^2}}$. My question is where does that $a$ go? What mistake did I make?
Thanks!
 [/INST] You had
$$
\left( z + \frac{b+\sqrt{4ac-b^2}i}{2a} \right) \left(z+\frac{b-\sqrt{4ac-b^2}i}{2a} \right)
$$
where you needed
$$
a \left( z + \frac{b+\sqrt{4ac-b^2}i}{2a} \right) \left(z+\frac{b-\sqrt{4ac-b^2}i}{2a} \right).
$$
</s>