Why Complete the Square?
A quadratic expression is often easier to understand after it has been rewritten as a scaled square plus a constant. This form reveals where the quadratic is centered and what value remains when the squared part is zero. In integration, the same information is useful when a quadratic appears in a denominator: it makes the shift in the variable and the constant term visible before any integration method is chosen.
The algebraic step is simple, but accuracy matters. The leading coefficient scales both the squared expression and the constant needed to preserve the original quadratic. A reliable method keeps that coefficient in view throughout.
The Completed-Square Form
The condition \(a\ne 0\) is essential: it says that the expression is genuinely quadratic. If \(a=0\), the expression is linear or constant, and this formula does not apply.
An equivalent version, written without introducing \(h\) and \(r\), is
The sign inside the square can be a common source of confusion. Since \(h=-b/(2a)\), the shifted factor is \(x-h=x+b/(2a)\). The center is the value of \(x\) that makes this factor zero.
Deriving the Formula
To complete the square, first factor \(a\) out of the two terms involving \(x\). Then create a perfect-square trinomial inside the parentheses. Because the factor \(a\) multiplies the whole parenthesis, the amount added inside must also be accounted for outside.
\(ax^2+bx+c=a\left(x^2+\frac{b}{a}x\right)+c\).
Half of \(b/a\) is \(b/(2a)\), so the square to add is \(b^2/(4a^2)\).
The amount added inside is multiplied by \(a\), so its value in the full expression is \(a\cdot b^2/(4a^2)=b^2/(4a)\).
The result is \(a\left(x+\frac{b}{2a}\right)^2+c-\frac{b^2}{4a}\).
Here is the derivation as a continuous calculation. Each equality preserves the value of the expression:
This also verifies the coefficient formulas. In the form \(a(x-h)^2+r\), expansion gives \(ax^2-2ahx+ah^2+r\). Matching the coefficient of \(x\) with \(b\) requires \(-2ah=b\), so \(h=-b/(2a)\). Matching the constant term then requires \(ah^2+r=c\), giving \(r=c-b^2/(4a)\). Thus the center and residual term are determined by the coefficients.
Worked Examples
Worked Example: A Positive Leading Coefficient
Rewrite \(2x^2-8x+11\) in completed-square form, then check the result by expansion.
Here \(a=2\), \(b=-8\), and \(c=11\). The center is
The residual term is
Therefore, the completed-square form is \(2(x-2)^2+3\). To check it, expand:
This matches the original expression, so the rewrite is correct.
Worked Example: A Negative Leading Coefficient
Rewrite \(-3x^2+6x+5\) in completed-square form and verify the result.
Here \(a=-3\), \(b=6\), and \(c=5\). The center is
The residual term is
Thus the expression is \(-3(x-1)^2+8\). Expanding checks both the sign and the constant:
The negative leading coefficient stays outside the square. The residual term is \(8\), because subtracting the negative fraction in the formula increases \(c\).
Worked Example: Reading a Rational Denominator
Rewrite the denominator in the rational function \(\displaystyle \frac{1}{4x^2+4x+5}\), and identify its center and residual term.
For the denominator, \(a=4\), \(b=4\), and \(c=5\). Its center is
Its residual term is
The denominator becomes \(4\left(x+\frac12\right)^2+4\), so the rational function can be written as
To verify the denominator, expand:
The check confirms that the shift is \(x+\frac12\), corresponding to center \(-\frac12\), and that the residual term is \(4\). This identifies the quadratic’s structure without yet choosing or carrying out an integration method.
Using the Form in Rational Integrands
When a quadratic is the denominator of a rational integrand, completing the square expresses that denominator in terms of its shifted variable. For \(ax^2+bx+c\), the shift is determined by \(a\) and \(b\), while the residual term depends on all three coefficients. The same calculation can be applied to a quadratic denominator whether or not the numerator is constant.
For example, if a denominator has the form \(5x^2-10x+13\), its center is
and its residual term is
Therefore, the denominator is \(5(x-1)^2+8\). Its shifted variable is \(x-1\), and its remaining constant is \(8\). Keeping these quantities distinct helps avoid losing the scale factor \(5\) or confusing the center \(1\) with the sign that appears in the squared factor.
In a rational integrand, this rewrite is an algebraic preparation. It does not by itself determine an antiderivative, and it does not replace checking the domain of the original expression. It does make the denominator’s structure explicit so a later method can be selected with the correct shift and constants.
A Common Sign Error
A frequent mistake is to calculate the center correctly but place the wrong sign inside the square. For \(x^2-6x+10\), the center formula gives
The correct factor is \(x-h=x-3\), so the completed form is \((x-3)^2+1\). A common incorrect step is to write \((x+3)^2+1\). Expanding that expression gives
which has \(+6x\), not the original \(-6x\). The correction is to use \(x-h\), not \(x+h\), when \(h\) denotes the center. The correct form checks as
Why the Coefficients Matter
The leading coefficient \(a\) sets the scale of the square. The linear coefficient \(b\), together with \(a\), determines the center through \(-b/(2a)\). Once the center is fixed, the constant coefficient \(c\) determines the residual term. These roles explain why completing the square is more than a pattern-matching trick: it reorganizes the original coefficients into the quantities that describe the shifted expression.
For a rational integrand, this coefficient-based reading is especially useful because the denominator is often the part that determines which algebraic form is needed next. A quick expansion check is a reliable safeguard: it catches sign errors in the shift and arithmetic errors in the residual constant before they affect later work.
Check Your Understanding
For each question, keep the leading coefficient outside the square and use expansion to check your result.
- Rewrite \(x^2+8x+11\) in completed-square form. What are its center and residual term?
- Rewrite \(3x^2+12x+14\) in completed-square form. Verify the result by expanding.
- For \(-2x^2-4x+7\), calculate the center and residual term, then write the completed-square form.
- Find the completed-square form of the denominator \(2x^2-4x+9\) in the rational function \(\displaystyle \frac{1}{2x^2-4x+9}\).
- Explain why \(a\ne 0\) is required in the formula for the center.