In mathematics, a quadratic integral is an integral of the form

It can be evaluated by completing the square in the denominator.

Positive-discriminant case
Assume that the discriminant q = b2 − 4ac is positive. In that case, define u and A by

and

The quadratic integral can now be written as

The partial fraction decomposition

allows us to evaluate the integral:

The final result for the original integral, under the assumption that q > 0, is

Negative-discriminant case
In case the discriminant q = b2 − 4ac is negative, the second term in the denominator in

is positive. Then the integral becomes
![{\displaystyle {\begin{aligned}{\frac {1}{c))\int {\frac {du}{u^{2}+A^{2))}&={\frac {1}{cA))\int {\frac {du/A}{(u/A)^{2}+1))\\[9pt]&={\frac {1}{cA))\int {\frac {dw}{w^{2}+1))\\[9pt]&={\frac {1}{cA))\arctan(w)+\mathrm {constant} \\[9pt]&={\frac {1}{cA))\arctan \left({\frac {u}{A))\right)+{\text{constant))\\[9pt]&={\frac {1}{c{\sqrt ((\frac {a}{c))-{\frac {b^{2)){4c^{2))))))}\arctan \left({\frac {x+{\frac {b}{2c))}{\sqrt ((\frac {a}{c))-{\frac {b^{2)){4c^{2))))))\right)+{\text{constant))\\[9pt]&={\frac {2}{\sqrt {4ac-b^{2}\,))}\arctan \left({\frac {2cx+b}{\sqrt {4ac-b^{2))))\right)+{\text{constant)).\end{aligned))}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0715d439a69d30944bda613d3112a8b890555207)