∫IntegralPasoEspañol
Rational functions

Integration by completing the square

Material by the IntegralPaso project. Conditions and limits are stated in each guide; external teaching review is pending.

ax2+bx+c=a(x+b2a)2+c−b24aax^2+bx+c=a\left(x+\frac b{2a}\right)^2+c-\frac{b^2}{4a}

A shift converts a quadratic into a standard form. The constant sign then determines whether an arctangent, a logarithm or a radical substitution is appropriate.

Common mistake

The discriminant determines real roots; check the domain before integrating.

Step-by-step example

  1. Complete the square.

    x2+2x+5=(x+1)2+4x^2+2x+5=(x+1)^2+4
  2. Shift the variable.

    u=(x+1)/2,dx=2 duu=(x+1)/2,\quad dx=2\,du
  3. Apply the arctangent rule.

    ∫dxx2+2x+5=12arctan⁡x+12+C\int\frac{dx}{x^2+2x+5}=\frac12\arctan\frac{x+1}{2}+C

Common questions about this method

Why complete the square in an integral?

It rewrites a quadratic as a shifted square plus a constant. You can then recognize an arctangent form, a difference of squares, or a radical suited to trigonometric substitution. The sign of the constant and where the quadratic occurs in the integrand matter.

Does the answer always involve arctangent?

No. In a denominator, a sum of squares with constant numerator leads to arctangent; a difference of squares can yield logarithms. If the numerator contains a part proportional to the derivative of the denominator, separate it first.

Study quadratic denominators →
Practice this method