Why Rewrite a Quadratic?
A quadratic expression does not always advertise the best integration method in its expanded form. For example, \(x^2+4x+13\) may look like an ordinary polynomial, but its denominator becomes much easier to read after rewriting it as \((x+2)^2+9\). The rewritten form shows a shifted square plus a positive constant, a standard inverse-trigonometric pattern.
Completing the square is an algebraic rewrite, not an integration method by itself. Its strategic value is that it reveals the sign and scale of the expression around its center. Those features help distinguish denominator forms associated with logarithms or inverse tangents, and radicands suited to trigonometric substitution.
The center of the square is \(h=-\frac{b}{2a}\). Writing \(u=x-h\) makes the quadratic a multiple of \(u^2\) plus a constant. The sign of that constant, after factoring out the leading coefficient, is often the key clue.
Completing the Square and Reading the Sign
To derive the formula, factor \(a\) from the quadratic terms, then add and subtract the square of half the coefficient of \(x\) inside the parentheses:
The completed form commonly reveals one of these denominator patterns, after translating and scaling the variable:
For \(r>0\), the first pattern has an inverse-tangent antiderivative; the second factors into linear terms and leads to a logarithm. A repeated-square denominator, \(1/u^2\), is a different power-rule case, so it should not be mistaken for either pattern.
Why the Denominator Patterns Give These Forms
The inverse-tangent pattern follows directly by scaling the standard derivative of \(\arctan\). Set \(z=u/r\), so \(du=r\,dz\) and \(u^2+r^2=r^2(1+z^2)\). Then
For the difference of squares, \(u^2-r^2=(u-r)(u+r)\). The partial-fraction identity
shows why logarithms appear: integrating the two reciprocal linear factors gives logarithms. These justifications also make the sign and scale in each formula easier to check.
Worked Example: A Shifted Sum of Squares
Worked Example: A Shifted Sum of Squares
Evaluate \(\displaystyle \int \frac{dx}{x^2+4x+13}\).
Complete the square. Half of \(4\) is \(2\), and \(2^2=4\), so
Let \(u=x+2\). Then \(du=dx\), and the integral becomes
Check by differentiating. With \(u=x+2\),
The derivative is the original integrand, so the antiderivative is correct.
Numerators Can Reveal More Than One Form
A completed-square denominator can be useful even when the numerator is not a constant. Compare the numerator with the derivative of the denominator. If it contains that derivative, separate the matching part from what remains. The matching part may integrate to a logarithm; the remainder may still have an inverse-tangent form.
Worked Example: Separating a Logarithmic Part from an Inverse-Tangent Part
Evaluate \(\displaystyle \int \frac{2x+1}{x^2+2x+5}\,dx\).
First complete the square:
The derivative of the denominator is \(2x+2\). Rewrite the numerator as \(2x+1=(2x+2)-1\), giving
The first integral is \(\ln(x^2+2x+5)\), since the denominator is positive for every real \(x\). In the second, use the inverse-tangent formula with \(u=x+1\) and \(r=2\). Thus
To check, differentiate the proposed answer:
This equals the original integrand.
When a Difference of Squares Leads to a Logarithm
Completing the square can reveal a difference rather than a sum. The resulting denominator has real zeros, so the original integrand is undefined at those points. The antiderivative must therefore be considered separately on intervals that avoid them.
Worked Example: A Difference-of-Squares Denominator
Evaluate \(\displaystyle \int \frac{dx}{x^2-4x-5}\) on intervals where the integrand is defined.
Complete the square and then express the result as a difference of squares:
Set \(u=x-2\), so \(du=dx\). Apply the difference-of-squares formula:
The excluded points are \(x=5\) and \(x=-1\), where the denominator is zero. Differentiate the result on any interval that avoids those points:
The derivative matches the integrand wherever it is defined.
Radicands: A Clue for Trigonometric Substitution
Completing the square is just as useful inside a square root. In particular, a translated expression of the form \(r^2-u^2\), where \(r>0\), suggests the substitution \(u=r\sin\theta\). Then \(r^2-u^2=r^2\cos^2\theta\), and the square root simplifies when \(\cos\theta\ge 0\). This is a trigonometric-substitution signal; the variable shift and the positive scale are essential to identifying it.
Worked Example: A Shifted Difference-of-Squares Radicand
Evaluate \(\displaystyle \int \sqrt{9-(x-1)^2}\,dx\) on the interval \(-2<x<4\).
The radicand is already in the form \(3^2-u^2\), with \(u=x-1\). Set \(u=3\sin\theta\). On \(-\frac{\pi}{2}<\theta<\frac{\pi}{2}\), \(\cos\theta>0\), so \(\sqrt{9-u^2}=3\cos\theta\). Also \(dx=du=3\cos\theta\,d\theta\). Therefore
Since \(\theta=\arcsin\left(\frac{x-1}{3}\right)\), \(\sin\theta=\frac{x-1}{3}\), and \(\cos\theta=\frac{\sqrt{9-(x-1)^2}}{3}\), substitute back:
Check by differentiation. Write \(u=x-1\). The derivative of the first term is \(\frac{9}{2\sqrt{9-u^2}}\). The derivative of the second is \(\frac{1}{2}\sqrt{9-u^2}-\frac{u^2}{2\sqrt{9-u^2}}\). Adding them gives
The derivative is the original integrand throughout the stated interval.
A Reliable Decision Process
Use the completed form to identify a pattern before committing to a method. The algebra does not guarantee that every integral becomes easy, but it can rule in or rule out common standard forms.
For \(ax^2+bx+c\), shift the variable by \(h=-\frac{b}{2a}\), so the squared term is \((x-h)^2\).
Rewrite the expression as a constant multiple of a square plus or minus a positive constant, if possible.
A denominator with a positive square plus a positive constant suggests an inverse tangent; a difference of squares suggests logarithms. A radicand \(r^2-u^2\) suggests trigonometric substitution.
Record where a denominator vanishes, and check whether the numerator contains a useful multiple of the denominator's derivative.
Differentiate the proposed antiderivative and compare it with the original integrand on its domain.
A Common Mistake: Losing the Scale
A frequent error is to recognize the right pattern but omit its scale factor. For example,
Differentiating the incorrect expression gives
which is three times the required integrand. The correct antiderivative includes a factor of \(\frac{1}{3}\):
Another sign error is to treat \(u^2-r^2\) as though it were \(u^2+r^2\). The former has real zeros and leads to logarithms, not the inverse-tangent formula. Factoring or differentiating the proposed answer is a quick way to catch either mistake.
Check Your Understanding
For each question, identify the useful completed form before selecting an integration pattern.
- Complete the square in \(x^2-8x+20\). Is the result a shifted sum or difference of squares?
- What standard antiderivative form is suggested by the denominator \((x-3)^2+16\)?
- Rewrite \(x^2+2x-8\) as a difference of squares centered at its vertex. Which two real values make the denominator zero?
- For the integral \(\displaystyle \int \frac{2x+2}{x^2+2x+5}\,dx\), how is the numerator related to the denominator's derivative?
- What substitution is suggested by the radicand \(25-(x+2)^2\), and what interval can be used to keep the resulting cosine nonnegative?