Tutorials › Calculus II › Integrating Linear Numerators Over Quadratics

Improper Rational Functions · Tutorial 219 of 998

Integrating Linear Numerators Over Quadratics

Use the denominator’s derivative and a completed square to integrate linear numerators over irreducible quadratic denominators.

Intermediate 9 min read

What You'll Learn

  • Identify when a real quadratic is irreducible and has no real zeros.
  • Split a linear numerator using the derivative of its quadratic denominator.
  • Derive the logarithmic and arctangent terms in the antiderivative.
  • Apply the formula to quadratics with positive or negative leading coefficients.
  • Detect and correct common scaling errors in the arctangent term.

Why the Numerator and Denominator Fit Together

A rational term with a linear numerator over an irreducible quadratic has a useful structure: the derivative of the denominator is itself linear. Part of the numerator can therefore be integrated by the logarithm rule. What remains is a constant divided by the quadratic, which leads to an arctangent after completing the square.

This method is useful when integrating terms such as \((mx+n)/(ax^2+bx+c)\), where the quadratic has no real roots. It produces a compact formula, but the coefficient of the arctangent depends on the quadratic’s scale. Keeping track of that scale is essential.

Definition: A real quadratic \(q(x)=ax^2+bx+c\), with \(a\ne 0\), is irreducible over the real numbers if it cannot be factored into real linear factors. Equivalently, its discriminant satisfies \(b^2-4ac<0\).

For such a quadratic, \(4ac-b^2>0\). Its denominator never vanishes on the real line, so the rational function is defined for every real \(x\). We will use the positive number \(S=\sqrt{4ac-b^2}\) to keep the formula readable.

Separate the Derivative Part

Let \(m,n,a,b,c\) be real constants, with \(a\ne 0\) and \(b^2-4ac<0\). The denominator and its derivative are

$$ q(x)=ax^2+bx+c, \qquad q'(x)=2ax+b. $$

Because \(q'\) is linear, we can express any linear numerator \(mx+n\) as a multiple of \(q'\) plus a constant. Matching the coefficient of \(x\) determines that multiple; subtracting it leaves the constant remainder.

$$ mx+n = \frac{m}{2a}(2ax+b) + \left(n-\frac{mb}{2a}\right). $$

Write \(R=n-\frac{mb}{2a}\) for the remainder. Dividing by \(q(x)\) separates the integrand into two terms: \(\frac{m}{2a}\frac{q'(x)}{q(x)}\) and \(\frac{R}{q(x)}\). The first integrates to a logarithm. To integrate the second, complete the square in the quadratic.

Deriving the General Formula

Set \(S=\sqrt{4ac-b^2}>0\). Completing the square, or expanding the right-hand side, gives

$$ q(x) = \frac{(2ax+b)^2+S^2}{4a}. $$

In the remaining integral, substitute \(u=2ax+b\). Then \(du=2a\,dx\). Using the standard antiderivative of \(1/(u^2+S^2)\) yields the following result.

Theorem: If \(a\ne 0\) and \(b^2-4ac<0\), then, for real constants \(m\) and \(n\),
$$ \int \frac{mx+n}{ax^2+bx+c}\,dx = \frac{m}{2a}\ln|ax^2+bx+c| + \frac{2n-\frac{mb}{a}}{\sqrt{4ac-b^2}} \arctan\!\left( \frac{2ax+b}{\sqrt{4ac-b^2}} \right) +C. $$

Here \(C\) is an arbitrary constant. Since the quadratic has no real zeros, it has a constant sign. The absolute value in the logarithm makes the formula valid whether that sign is positive or negative.

For clarity, the same result can be written using the remainder \(R=n-\frac{mb}{2a}\): the arctangent coefficient is \(2R/S\). The two forms agree because \(2R=2n-\frac{mb}{a}\).

1
Match the derivative.
Write \(mx+n=\frac{m}{2a}q'(x)+R\), where \(R=n-\frac{mb}{2a}\).
2
Integrate the derivative term.
Use \(\int q'(x)/q(x)\,dx=\ln|q(x)|+C\), since \(q(x)\ne0\) for every real \(x\).
3
Complete the square for the remainder.
Use \(q(x)=((2ax+b)^2+S^2)/(4a)\) and \(u=2ax+b\) to obtain the arctangent term.

Why the Formula Works

The argument establishes the formula directly. First, the numerator identity gives

$$ \frac{mx+n}{q(x)} = \frac{m}{2a}\frac{q'(x)}{q(x)} + \frac{R}{q(x)}. $$

Because \(q\) is nonzero on the real line, the derivative of \(\ln|q(x)|\) is \(q'(x)/q(x)\). For the other term, the completed-square identity and substitution \(u=2ax+b\) give

$$ \int \frac{dx}{q(x)} = \int \frac{2\,du}{u^2+S^2} = \frac{2}{S}\arctan\!\left(\frac{u}{S}\right)+C = \frac{2}{S}\arctan\!\left(\frac{2ax+b}{S}\right)+C. $$

Multiplying this last result by \(R\) produces the arctangent term \(2R/S\). Together, the two integrated parts give the stated expression. This also explains why both the constant remainder and the positive square root \(S\) matter: the former sets the arctangent’s size, and the latter sets its scale.

Worked Examples

Worked Example: A Positive-Leading Quadratic

Evaluate \(\int \frac{3x+8}{x^2+4x+13}\,dx\). Here \(a=1\), \(b=4\), \(c=13\), \(m=3\), and \(n=8\). The discriminant is \(4^2-4(1)(13)=16-52=-36<0\), so the quadratic is irreducible, and \(S=\sqrt{4(1)(13)-4^2}=\sqrt{36}=6\).

The denominator derivative is \(2x+4\). Split the numerator:

$$ 3x+8 = \frac{3}{2}(2x+4)+2, $$

since \(\frac{3}{2}(2x+4)=3x+6\), leaving remainder \(2\). Thus

$$ \int \frac{3x+8}{x^2+4x+13}\,dx = \frac{3}{2}\ln|x^2+4x+13| + \frac{2(2)}{6} \arctan\!\left(\frac{2x+4}{6}\right)+C. $$

Since \(x^2+4x+13=(x+2)^2+9>0\), the absolute value may be omitted. Simplifying gives \(\frac{3}{2}\ln(x^2+4x+13)+\frac{2}{3}\arctan((x+2)/3)+C\).

Check: Differentiating the logarithmic term gives \((3x+6)/(x^2+4x+13)\). Differentiating the arctangent term gives \(2/((x+2)^2+9)=2/(x^2+4x+13)\). Their sum is \((3x+8)/(x^2+4x+13)\), as required.

Worked Example: A Leading Coefficient Other Than One

Evaluate \(\int \frac{5x+1}{2x^2-4x+5}\,dx\). In this case \(a=2\), \(b=-4\), \(c=5\), \(m=5\), and \(n=1\). The discriminant is \((-4)^2-4(2)(5)=16-40=-24<0\), and \(S=\sqrt{4(2)(5)-(-4)^2}=\sqrt{24}=2\sqrt{6}\).

The derivative of the denominator is \(4x-4\). The numerator split is

$$ 5x+1 = \frac{5}{4}(4x-4)+6, $$

because \(\frac{5}{4}(4x-4)=5x-5\), and adding \(6\) gives \(5x+1\). The integral is therefore

$$ \frac{5}{4}\ln|2x^2-4x+5| + \frac{12}{2\sqrt{6}} \arctan\!\left(\frac{4x-4}{2\sqrt{6}}\right)+C = \frac{5}{4}\ln(2x^2-4x+5) + \sqrt{6}\arctan\!\left(\frac{2x-2}{\sqrt{6}}\right)+C. $$

The denominator is positive: \(2x^2-4x+5=2(x-1)^2+3\). Check: The logarithm differentiates to \((5x-5)/(2x^2-4x+5)\). For the arctangent, set \(z=(2x-2)/\sqrt{6}\); then \(z'=2/\sqrt{6}\), so its derivative is \(2/(1+z^2)=12/((2x-2)^2+6)=6/(2x^2-4x+5)\). Adding gives the original numerator \(5x+1\) over the denominator.

Worked Example: A Negative-Leading Quadratic

Evaluate \(\int \frac{2x+7}{-x^2+2x-5}\,dx\). Here \(a=-1\), \(b=2\), \(c=-5\), \(m=2\), and \(n=7\). The discriminant is \(2^2-4(-1)(-5)=4-20=-16<0\), and \(S=\sqrt{4(-1)(-5)-2^2}=\sqrt{16}=4\).

The derivative of the denominator is \(-2x+2\). The numerator splits as

$$ 2x+7 = -1(-2x+2)+9. $$

Thus \(m/(2a)=-1\) and the constant remainder is \(9\). The antiderivative is

$$ -\ln|-x^2+2x-5| + \frac{18}{4}\arctan\!\left(\frac{-2x+2}{4}\right)+C = -\ln|-x^2+2x-5| + \frac{9}{2}\arctan\!\left(\frac{1-x}{2}\right)+C. $$

The quadratic equals \(-((x-1)^2+4)\), so it is negative everywhere. Check: The derivative of the logarithmic term is \(-(-2x+2)/(-x^2+2x-5)=(2x-2)/(-x^2+2x-5)\). The arctangent term differentiates to \(-9/((x-1)^2+4)=9/(-x^2+2x-5)\). Together these are \((2x+7)/(-x^2+2x-5)\), the original integrand.

A Common Scaling Mistake

In the first example, completing the square gives \(x^2+4x+13=(x+2)^2+9\). The correct remainder integral is

$$ \int \frac{dx}{(x+2)^2+9} = \frac{1}{3}\arctan\!\left(\frac{x+2}{3}\right)+C. $$

A common error is to omit the factor \(1/3\) and write just \(\arctan((x+2)/3)\). That is incorrect: differentiating the proposed expression gives \(3/((x+2)^2+9)\), three times the desired integrand. With the factor \(1/3\), the derivative is \(1/((x+2)^2+9)\). In the full example the remainder is \(2\), so its contribution is \(\frac{2}{3}\arctan((x+2)/3)\), not \(2\arctan((x+2)/3)\).

Key check: After finding an antiderivative, differentiate its arctangent term separately. The chain rule must reproduce the constant remainder divided by the original quadratic.

When to Use This Method

Use this formula when the denominator is a single irreducible real quadratic and the numerator has degree at most one. If the numerator is not visibly a multiple of the denominator’s derivative plus a constant, solve for the two coefficients by matching powers of \(x\). The identity used here makes that split explicit.

The method requires \(a\ne0\) and \(b^2-4ac<0\). If the quadratic has real roots, it is not an irreducible quadratic of this type, and the arctangent formula derived here does not apply in this form. For the stated conditions, \(S\) is real and positive, the denominator has no real zeros, and both terms of the antiderivative are defined throughout the real line.

As a final check on any calculation, differentiate the proposed result and combine its terms over the original denominator. The numerator must return exactly to \(mx+n\); this catches errors in either the derivative-matching coefficient or the arctangent scale.

Check Your Understanding

Use the derivative split and the completed-square form to answer these questions.

  1. For \(q(x)=3x^2+6x+8\), find \(S=\sqrt{4ac-b^2}\), and state why \(q\) has no real zeros.
  2. Write \(4x+7\) as a multiple of the derivative of \(x^2-2x+5\) plus a constant.
  3. In the general formula, what is the constant remainder \(R\) in terms of \(m,n,a,\) and \(b\)?
  4. Why is the logarithm written as \(\ln|q(x)|\) when the leading coefficient \(a\) may be negative?
  5. For \(\int dx/((x-1)^2+16)\), what coefficient must multiply \(\arctan((x-1)/4)\)?

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon