Why Complete the Square After Decomposition?
Partial-fraction decomposition can turn a rational function into a sum of terms with simpler denominators. When those denominators are distinct irreducible quadratics, each term can be integrated separately. Completing the square then reveals two familiar contributions: a logarithm from the part of the numerator proportional to the shifted variable, and an inverse tangent from the remaining constant part.
The main task is to handle every quadratic consistently. A shift that works for one denominator will generally not work for another, and the constant left over in the numerator must be recalculated after each shift. Once each term is in the correct form, the antiderivatives are added.
The Formula for One Quadratic Term
Consider a quadratic denominator \(ax^2+bx+c\) with \(a>0\) and \(b^2-4ac<0\). The negative discriminant means it has no real roots. Define
Since \(b^2-4ac<0\), we have \(d>0\), and completing the square gives
For a linear numerator \(Ax+B\), write \(Ax+B=A(x-h)+(Ah+B)\). This expresses the numerator in terms of the same shifted variable \(x-h\) that appears in the completed square. The resulting integral is
Here \(C\) is an arbitrary constant. This formula applies when the denominator is an irreducible quadratic with positive leading coefficient and the numerator has degree at most one. If the leading coefficient is not positive, the denominator can first be multiplied by \(-1\) and the numerator adjusted accordingly.
Why the Formula Works
The formula follows by separating the two numerator parts and differentiating the proposed antiderivative. Put \(u=x-h\). Then the integrand becomes
The part containing \(Au\) is integrated by recognizing that the derivative of \(u^2+d^2\) is \(2u\). The constant part uses the derivative of \(\arctan(u/d)\). In full,
For the second term, the chain rule gives \(\frac{d}{dx}\arctan(u/d)=d/(u^2+d^2)\), which accounts for the factor \(1/d\) in the antiderivative. Combining the two derivative terms recovers the rewritten integrand exactly.
Worked Example: Two Quadratic Terms from a Rational Function
Worked Example: Two Quadratic Terms from a Rational Function
Integrate the rational function below. Its partial-fraction decomposition is shown as a sum, and the numerator of the combined fraction is included so the decomposition can be checked.
To verify the decomposition, combine the fractions. The numerator is
For the first denominator, complete the square and shift the numerator together with it:
Therefore, the first integral is
For the second denominator, use a different shift:
It follows that
Adding both results gives an antiderivative of the original rational function:
Check by differentiating. The first two terms give \(\frac{2(x+1)+4}{(x+1)^2+4}=\frac{2x+6}{x^2+2x+5}\). The next two give \(\frac{3(x-2)+7}{(x-2)^2+4}=\frac{3x+1}{x^2-4x+8}\). Their sum is the displayed partial-fraction decomposition, so the derivative agrees with the integrand.
Worked Example: Combining Three Distinct Quadratics
Worked Example: Combining Three Distinct Quadratics
Integrate the following sum of three distinct quadratic terms. The decomposition is already displayed, so the calculation focuses on completing each square and combining the results.
For the first term, \(x^2+4x+8=(x+2)^2+4\). With \(u=x+2\), the numerator is \(2x+4=2u\). Thus
For the second term, \(x^2-2x+2=(x-1)^2+1\). Put \(v=x-1\), so \(3x-1=3v+2\). Then
For the third term, \(x^2+6x+13=(x+3)^2+4\). Put \(w=x+3\), so \(4x+5=4w-7\). Separating the two numerator parts gives
Combining the three antiderivatives yields
Check by differentiation. The derivative of the first logarithm is \(2(x+2)/((x+2)^2+4)\), matching the first fraction. The derivative of the second logarithm and its inverse tangent together is \((3(x-1)+2)/((x-1)^2+1)=(3x-1)/(x^2-2x+2)\). The last logarithm and inverse tangent differentiate to \((4(x+3)-7)/((x+3)^2+4)=(4x+5)/(x^2+6x+13)\). Thus \(F'(x)\) is the original sum.
Worked Example: Quadratics with Nonunit Leading Coefficients
Worked Example: Quadratics with Nonunit Leading Coefficients
Integrate a sum in which the quadratic denominators do not have leading coefficient \(1\):
First complete the square in each denominator, keeping its leading coefficient visible:
For the first fraction, let \(u=x+1\). Then \(6x+9=6u+3\), and the fraction becomes \(\frac{3u+3/2}{u^2+4}\). Hence
For the second fraction, let \(v=x-1\). Then \(5x-2=5v+3\), so the fraction is \(\frac{(5/3)v+1}{v^2+4}\). Therefore
The combined antiderivative is the sum of these two expressions. To check it, differentiate the first pair of terms: their derivatives add to \(\bigl(3(x+1)+3/2\bigr)/((x+1)^2+4)\), which equals the original first fraction after dividing its numerator and denominator by \(2\). For the second pair, the derivatives add to \(\bigl((5/3)(x-1)+1\bigr)/((x-1)^2+4)\), which equals the original second fraction after dividing its numerator and denominator by \(3\). The derivative of the combined result is therefore the given integrand.
A Common Scaling Pitfall
The inverse-tangent term must include the scale created by the constant in the completed square. For example, with \(u=x+2\),
A common incorrect calculation is to write this integral as \(\arctan(u/2)+C\), omitting the factor \(1/2\). Differentiating that incorrect result gives
which is twice the required integrand. The correction is the factor \(1/2\), since
More generally, the antiderivative of \(1/(u^2+d^2)\), for \(d>0\), is \((1/d)\arctan(u/d)+C\). Checking this derivative is a reliable way to catch a missing scale factor.
A Reliable Sequence of Steps
Use the given partial-fraction sum and treat each distinct denominator on its own.
Record the shift and the positive constant left in the denominator.
Express it as a multiple of the shifted variable plus a constant.
The shifted-variable part gives a logarithm; the constant part gives an inverse tangent. Add all terms and differentiate to check.
This method matters because rational functions with several irreducible quadratic factors often yield antiderivatives containing several different logarithms and inverse tangents. The structure of each contribution is determined locally by that factor and its numerator. Keeping the shifts and constants paired prevents one denominator’s completed square from being mistakenly used for another.
Check Your Understanding
For each question, identify the completed-square form and keep track of the numerator after making the shift.
- Complete the square in \(x^2-6x+13\), then rewrite \(2x+5\) using the shifted variable.
- Which part of a numerator of the form \(Au+K\) produces a logarithm, and which produces an inverse tangent when the denominator is \(u^2+d^2\)?
- Find the antiderivative of \((2x+3)/(x^2+2x+5)\).
- Why must the antiderivative of \(1/(u^2+9)\) contain a factor of \(1/3\) multiplying \(\arctan(u/3)\)?
- After integrating a sum of three distinct quadratic terms, what derivative check confirms that the combined result is correct?