In short
Integrals with a quadratic ax^2 + bx + c in the denominator — or under a square root — reduce to the standard forms from Part 1 by completing the square. When the numerator is linear (px + q), you split it into two pieces: one that absorbs into the derivative of the denominator, and one that gives a standard form. The technique is mechanical and always works.
The five integrals from Part 1 all had pure x^2 + a^2 or x^2 - a^2 in the denominator. But real problems rarely hand you such clean expressions. You are far more likely to meet something like
where the quadratic has a non-zero linear term. The denominator is x^2 + 4x + 13, and it does not match any of the Part 1 forms directly.
Here is the key observation: every quadratic can be rewritten as a shifted square plus (or minus) a constant, by completing the square. For x^2 + 4x + 13:
Now set t = x + 2, so dt = dx, and the integral becomes
That is Part 1, Result 1, applied after a shift. The linear term in the quadratic is not an obstacle — it just moves the centre.
Type 1: \int \frac{dx}{ax^2 + bx + c}
The general recipe has three steps.
Step 1. Factor out the leading coefficient a:
Step 2. Complete the square on x^2 + \frac{b}{a}x + \frac{c}{a}. Half the coefficient of x is \frac{b}{2a}, so:
Step 3. Set t = x + \frac{b}{2a} and apply the appropriate Part 1 formula.
If 4ac - b^2 > 0 (the quadratic has no real roots), the completed form is t^2 + k^2 where k = \frac{\sqrt{4ac - b^2}}{2a}. Use Result 1: the answer involves \tan^{-1}.
If 4ac - b^2 < 0 (the quadratic has two real roots), the completed form is t^2 - k^2 where k = \frac{\sqrt{b^2 - 4ac}}{2a}. Use Result 2: the answer involves \ln.
If 4ac - b^2 = 0 (the quadratic has a repeated root), the denominator is a perfect square (x + b/2a)^2 and the integral is \int t^{-2}\,dt = -1/t + C.
A worked-through derivation
Take \int \frac{dx}{2x^2 + 8x + 10}.
Factor out 2: \frac{1}{2}\int \frac{dx}{x^2 + 4x + 5}.
Complete the square: x^2 + 4x + 5 = (x+2)^2 + 1.
Set t = x + 2: \frac{1}{2}\int \frac{dt}{t^2 + 1^2} = \frac{1}{2}\tan^{-1}(t) + C = \frac{1}{2}\tan^{-1}(x+2) + C.
Check: 4ac - b^2 = 4(2)(10) - 64 = 80 - 64 = 16 > 0, confirming no real roots and a \tan^{-1} answer.
Type 2: \int \frac{dx}{\sqrt{ax^2 + bx + c}}
The same strategy applies when the quadratic sits under a square root. Complete the square, shift, and apply the appropriate Part 1 formula involving a square root.
After completing the square, you get one of three forms under the root:
| Completed form | Part 1 formula | Result type |
|---|---|---|
| k^2 - t^2 | Result 3 | \sin^{-1} |
| t^2 + k^2 | Result 4 | \ln (or \sinh^{-1}) |
| t^2 - k^2 | Result 5 | \ln (or \cosh^{-1}) |
A worked-through derivation
Take \int \frac{dx}{\sqrt{3 - 2x - x^2}}.
Rewrite as \int \frac{dx}{\sqrt{-(x^2 + 2x - 3)}}. Complete the square inside: x^2 + 2x - 3 = (x+1)^2 - 4.
So 3 - 2x - x^2 = -(x+1)^2 + 4 = 4 - (x+1)^2 = 2^2 - (x+1)^2.
Set t = x + 1: \int \frac{dt}{\sqrt{4 - t^2}} = \sin^{-1}\!\left(\frac{t}{2}\right) + C = \sin^{-1}\!\left(\frac{x+1}{2}\right) + C.
Type 3: \int \frac{px + q}{ax^2 + bx + c}\,dx
When the numerator is linear rather than constant, the integral is no longer a direct application of Part 1. But it splits cleanly into two pieces.
The idea: write the numerator px + q as a multiple of the derivative of the denominator, plus a leftover constant.
The denominator is ax^2 + bx + c, whose derivative is 2ax + b. So write:
Matching coefficients: 2aA = p gives A = \frac{p}{2a}. Then Ab + B = q gives B = q - \frac{pb}{2a}.
The integral splits:
The first integral on the right is \frac{p}{2a}\ln|ax^2 + bx + c| + C_1, because the numerator is exactly the derivative of the denominator (a direct substitution u = ax^2 + bx + c).
The second integral is Type 1, which you already know how to handle.
A worked-through derivation
Take \int \frac{3x + 5}{x^2 + 6x + 13}\,dx.
The derivative of the denominator is 2x + 6. Write 3x + 5 = A(2x + 6) + B:
3x + 5 = 2Ax + 6A + B
Matching: 2A = 3 gives A = 3/2. Then 6A + B = 5 gives B = 5 - 9 = -4.
So 3x + 5 = \frac{3}{2}(2x + 6) - 4, and:
First part: \frac{3}{2}\ln|x^2 + 6x + 13|.
Second part: complete the square. x^2 + 6x + 13 = (x+3)^2 + 4. Set t = x + 3:
Final answer: \frac{3}{2}\ln(x^2 + 6x + 13) - 2\tan^{-1}\!\left(\frac{x+3}{2}\right) + C.
(The absolute value around the logarithm can be dropped because x^2 + 6x + 13 = (x+3)^2 + 4 > 0 for all x.)
Type 4: \int \frac{px + q}{\sqrt{ax^2 + bx + c}}\,dx
The same splitting trick works when the quadratic is under a square root.
Write px + q = A \cdot \frac{d}{dx}(ax^2 + bx + c) + B = A(2ax + b) + B, with the same A = p/(2a) and B = q - pb/(2a).
The first integral: set u = ax^2 + bx + c, du = (2ax + b)\,dx:
The second integral is Type 2 (complete the square and apply Part 1).
Worked examples
Example 1: Linear numerator over a quadratic denominator
Find \displaystyle\int \frac{2x + 1}{x^2 + 2x + 5}\,dx.
Step 1. Write the numerator as A \cdot (2x + 2) + B, since \frac{d}{dx}(x^2 + 2x + 5) = 2x + 2.
2x + 1 = A(2x + 2) + B. Matching: 2A = 2 gives A = 1, and 2A + B = 1 gives B = -1.
Why: this splitting separates the integral into a logarithmic part (where the numerator is the derivative of the denominator) and a standard \tan^{-1} part.
Step 2. Split the integral.
Why: the first integral will give a logarithm by direct substitution; the second will give \tan^{-1} after completing the square.
Step 3. First integral: set u = x^2 + 2x + 5, du = (2x+2)\,dx.
(The absolute value is unnecessary since x^2 + 2x + 5 = (x+1)^2 + 4 > 0 always.)
Step 4. Second integral: x^2 + 2x + 5 = (x+1)^2 + 4. Set t = x + 1:
Why: this is Result 1 from Part 1 with a = 2.
Step 5. Combine.
Result: \displaystyle\ln(x^2+2x+5) - \frac{1}{2}\tan^{-1}\!\left(\frac{x+1}{2}\right) + C.
Differentiation check: differentiating \ln(x^2+2x+5) gives \frac{2x+2}{x^2+2x+5}, and differentiating -\frac{1}{2}\tan^{-1}\!\left(\frac{x+1}{2}\right) gives -\frac{1}{2} \cdot \frac{1}{1+(x+1)^2/4} \cdot \frac{1}{2} = \frac{-1}{(x+1)^2 + 4} = \frac{-1}{x^2+2x+5}. Adding: \frac{2x+2-1}{x^2+2x+5} = \frac{2x+1}{x^2+2x+5}. Confirmed.
Example 2: Linear numerator over a square-root quadratic
Find \displaystyle\int \frac{x + 3}{\sqrt{x^2 + 6x + 10}}\,dx.
Step 1. The derivative of x^2 + 6x + 10 is 2x + 6 = 2(x+3). The numerator x + 3 is exactly half of this derivative.
Why: when the numerator is a constant multiple of the derivative of the expression under the root, the first part of the splitting gives the entire answer — the second part vanishes.
Step 2. Write x + 3 = \frac{1}{2}(2x + 6) + 0, so A = 1/2 and B = 0.
Why: since B = 0, there is no leftover constant term — the entire integral reduces to a single substitution.
Step 3. Set u = x^2 + 6x + 10, du = (2x+6)\,dx.
Why: \int u^{-1/2}\,du = 2u^{1/2}.
Step 4. Substitute back.
Result: \displaystyle\sqrt{x^2 + 6x + 10} + C.
Differentiation check: \frac{d}{dx}\sqrt{x^2+6x+10} = \frac{2x+6}{2\sqrt{x^2+6x+10}} = \frac{x+3}{\sqrt{x^2+6x+10}}. Confirmed.
Common confusions
-
"Completing the square only works when a = 1." It works for any a \neq 0. Factor out a first, then complete the square on the monic quadratic inside. The 1/a sits out front as a constant multiplier.
-
"The splitting trick only works when the denominator has no real roots." The splitting px + q = A \cdot (\text{derivative}) + B is pure algebra — it works regardless of the discriminant. What changes is whether the leftover integral (the B part) gives \tan^{-1} or \ln.
-
"I should use partial fractions instead of completing the square when b^2 - 4ac > 0." Both methods work. Partial fractions decompose \frac{1}{(x-r_1)(x-r_2)} and give \frac{1}{r_1 - r_2}\ln\left|\frac{x - r_1}{x - r_2}\right|, which is the same as what completing the square + Result 2 gives. Use whichever you find faster.
-
"I completed the square wrong and got a negative number where I expected a positive one." Check the sign of a. If a < 0, the quadratic opens downward, and after factoring out a (which is negative), the sign inside the completed square flips. For example, -x^2 + 4x - 3 = -(x^2 - 4x + 3) = -[(x-2)^2 - 1] = 1 - (x-2)^2.
Going deeper
If you came here to learn how to reduce quadratic-denominator integrals to the Part 1 forms, you have the complete method. What follows is for readers who want additional perspective.
Why the splitting works: a geometric view
The splitting px + q = A(2ax + b) + B is doing something geometrically meaningful. The derivative 2ax + b is the slope of the parabola y = ax^2 + bx + c at the point x. When you decompose the numerator into a multiple of this slope plus a constant, you are separating the integral into:
- A part that measures how fast the denominator is changing (the logarithmic piece), and
- A part that is independent of the denominator's rate of change (the arctangent piece).
The first piece always gives a logarithm (or a square root, under a radical), because the substitution u = ax^2 + bx + c directly converts it. The second piece is "what's left" — and that leftover is always a standard form from Part 1.
Connection to partial fractions
When ax^2 + bx + c has two distinct real roots r_1 and r_2, you can factor the denominator as a(x - r_1)(x - r_2) and use partial fractions:
This gives the integral as a sum of two logarithms. Completing the square + Result 2 gives the same answer in a different but equivalent form. The two approaches are algebraically identical — the difference is purely a matter of which steps you find more natural.
For the square-root case \int \frac{dx}{\sqrt{ax^2 + bx + c}}, partial fractions are not available (you cannot factor a square root), so completing the square is the only systematic path.
The role of the discriminant
The discriminant \Delta = b^2 - 4ac controls everything:
- \Delta < 0: the quadratic has no real roots, the completed square is a sum t^2 + k^2, and the integral produces \tan^{-1} (or \sin^{-1} under a root with negative leading coefficient).
- \Delta > 0: the quadratic has two real roots, the completed square is a difference t^2 - k^2, and the integral produces \ln (or \cosh^{-1}).
- \Delta = 0: the quadratic is a perfect square, and the integral reduces to a power of (x + b/2a).
Knowing the discriminant before you start tells you what form the answer will take — a useful check on your algebra.
Where this leads next
- Special Integrals - Part 1 — the five base formulas that all Part 2 integrals reduce to.
- Special Integrals - Part 3 — integrals where the square root of a quadratic is in the numerator, not the denominator.
- Integration by Parts — the next major technique, useful when substitution and standard forms are not enough.
- Partial Fractions — an alternative approach when the quadratic factors over the reals.