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

\int \frac{dx}{x^2 + 4x + 13}

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:

x^2 + 4x + 13 = (x^2 + 4x + 4) + 9 = (x + 2)^2 + 9 = (x+2)^2 + 3^2

Now set t = x + 2, so dt = dx, and the integral becomes

\int \frac{dt}{t^2 + 3^2} = \frac{1}{3}\tan^{-1}\!\left(\frac{t}{3}\right) + C = \frac{1}{3}\tan^{-1}\!\left(\frac{x+2}{3}\right) + C

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:

\int \frac{dx}{ax^2 + bx + c} = \frac{1}{a}\int \frac{dx}{x^2 + \frac{b}{a}x + \frac{c}{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:

x^2 + \frac{b}{a}x + \frac{c}{a} = \left(x + \frac{b}{2a}\right)^2 + \frac{c}{a} - \frac{b^2}{4a^2} = \left(x + \frac{b}{2a}\right)^2 + \frac{4ac - b^2}{4a^2}

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.

The dashed curve is $\frac{1}{\sqrt{3-2x-x^2}}$, defined on the interval $(-3, 1)$ where the expression under the root is positive. The solid red curve is the antiderivative $\sin^{-1}\!\left(\frac{x+1}{2}\right)$. The integrand has its minimum at $x = -1$ (the centre of the interval) and blows up at the endpoints — the same shape as $\frac{1}{\sqrt{a^2 - t^2}}$, just shifted.

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:

px + q = A(2ax + b) + B

Matching coefficients: 2aA = p gives A = \frac{p}{2a}. Then Ab + B = q gives B = q - \frac{pb}{2a}.

The integral splits:

\int \frac{px + q}{ax^2 + bx + c}\,dx = \frac{p}{2a}\int \frac{2ax + b}{ax^2 + bx + c}\,dx + \left(q - \frac{pb}{2a}\right)\int \frac{dx}{ax^2 + bx + c}

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:

\int \frac{3x+5}{x^2+6x+13}\,dx = \frac{3}{2}\int \frac{2x+6}{x^2+6x+13}\,dx - 4\int \frac{dx}{x^2+6x+13}

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:

-4\int \frac{dt}{t^2 + 2^2} = -4 \cdot \frac{1}{2}\tan^{-1}\!\left(\frac{t}{2}\right) = -2\tan^{-1}\!\left(\frac{x+3}{2}\right)

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).

\int \frac{px+q}{\sqrt{ax^2+bx+c}}\,dx = \frac{p}{2a}\int \frac{2ax+b}{\sqrt{ax^2+bx+c}}\,dx + B\int \frac{dx}{\sqrt{ax^2+bx+c}}

The first integral: set u = ax^2 + bx + c, du = (2ax + b)\,dx:

\frac{p}{2a}\int \frac{du}{\sqrt{u}} = \frac{p}{2a} \cdot 2\sqrt{u} = \frac{p}{a}\sqrt{ax^2 + bx + c}

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.

\int \frac{2x+1}{x^2+2x+5}\,dx = \int \frac{2x+2}{x^2+2x+5}\,dx - \int \frac{dx}{x^2+2x+5}

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.

\int \frac{du}{u} = \ln|u| = \ln(x^2 + 2x + 5)

(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:

\int \frac{dt}{t^2 + 2^2} = \frac{1}{2}\tan^{-1}\!\left(\frac{t}{2}\right) = \frac{1}{2}\tan^{-1}\!\left(\frac{x+1}{2}\right)

Why: this is Result 1 from Part 1 with a = 2.

Step 5. Combine.

\int \frac{2x+1}{x^2+2x+5}\,dx = \ln(x^2+2x+5) - \frac{1}{2}\tan^{-1}\!\left(\frac{x+1}{2}\right) + C

Result: \displaystyle\ln(x^2+2x+5) - \frac{1}{2}\tan^{-1}\!\left(\frac{x+1}{2}\right) + C.

The dashed curve is the integrand $\frac{2x+1}{x^2+2x+5}$. It crosses zero at $x = -1/2$ (where the numerator is zero) and approaches $0$ as $x \to \pm\infty$. The solid red curve is the antiderivative — a smooth blend of a logarithmic growth and an arctangent plateau.

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.

\int \frac{x+3}{\sqrt{x^2+6x+10}}\,dx = \frac{1}{2}\int \frac{2x+6}{\sqrt{x^2+6x+10}}\,dx

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.

= \frac{1}{2}\int \frac{du}{\sqrt{u}} = \frac{1}{2} \cdot 2\sqrt{u} = \sqrt{u}

Why: \int u^{-1/2}\,du = 2u^{1/2}.

Step 4. Substitute back.

= \sqrt{x^2 + 6x + 10} + C

Result: \displaystyle\sqrt{x^2 + 6x + 10} + C.

The dashed curve is the integrand $\frac{x+3}{\sqrt{x^2+6x+10}}$. It crosses zero at $x = -3$ and approaches $\pm 1$ as $x \to \pm\infty$. The solid red curve is $\sqrt{x^2+6x+10}$, which has its minimum value $1$ at $x = -3$ (since $x^2 + 6x + 10 = (x+3)^2 + 1 \geq 1$). The antiderivative grows like $|x|$ for large $|x|$ — the integral of a function that approaches $\pm 1$ should grow linearly.

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

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:

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:

\frac{px + q}{a(x-r_1)(x-r_2)} = \frac{A}{x-r_1} + \frac{B}{x-r_2}

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:

Knowing the discriminant before you start tells you what form the answer will take — a useful check on your algebra.

Where this leads next