Tutorials › Calculus II › Partial Fractions With Irreducible Quadratic Terms

Completing the Square Techniques · Tutorial 258 of 998

Partial Fractions With Irreducible Quadratic Terms

Decompose rational functions into irreducible quadratic terms, complete the square in each denominator, and verify the resulting antiderivatives.

Intermediate 9 min read

What You'll Learn

  • Recognize when a proper rational function has partial fractions with linear numerators over distinct irreducible quadratics
  • Set up and solve coefficient equations for a quadratic partial-fraction decomposition
  • Complete the square in each quadratic denominator, including one with a negative leading coefficient
  • Split a linear numerator into a multiple of the denominator’s derivative and a constant remainder
  • Apply and check the logarithmic and inverse-tangent antiderivative formulas

Why These Partial Fractions Need Two Kinds of Terms

A rational function can have a denominator that factors into irreducible quadratic polynomials. After partial-fraction decomposition, each such factor generally has a linear numerator. Integrating one term then requires two contributions: a logarithm from the part related to the denominator’s derivative, and an inverse tangent from the remaining constant part.

The key is to complete the square in each quadratic denominator. This puts the inverse-tangent contribution into a recognizable form. The sign of the quadratic’s leading coefficient matters: an irreducible quadratic with a negative leading coefficient is negative everywhere, not a positive square plus a positive constant. The formulas below handle either sign.

Definition: A real quadratic \(ax^2+bx+c\), with \(a\ne 0\), is irreducible over the reals if it has no real roots. Equivalently, its discriminant satisfies \(b^2-4ac<0\).

The Partial-Fraction Form

Suppose a proper rational function has a denominator that is a product of distinct irreducible real quadratics and has no linear factors. Its partial-fraction decomposition has the form

$$ \frac{P(x)}{\prod_{i=1}^{n}q_i(x)} = \sum_{i=1}^{n}\frac{A_i x+B_i}{q_i(x)}, \qquad q_i(x)=a_i x^2+b_i x+c_i. $$

Here each \(q_i\) is irreducible, each \(a_i\ne 0\), and the numerator over each quadratic has degree less than two. The constants \(A_i\) and \(B_i\) are determined by multiplying through by the common denominator and matching coefficients. If the original rational function is improper, polynomial division is needed before applying this proper-fraction form.

Once the decomposition is found, integrate term by term. The same calculation applies to each term, so first consider a single irreducible quadratic \(q(x)=ax^2+bx+c\) and a linear numerator \(Ax+B\).

Completing the Square and Splitting the Numerator

Completing the square gives

$$ q(x) = a\left[\left(x+\frac{b}{2a}\right)^2 +\frac{4ac-b^2}{4a^2}\right]. $$

Since \(b^2-4ac<0\), the quantity \(4ac-b^2\) is positive. Define

$$ h=-\frac{b}{2a}, \qquad d=\frac{4ac-b^2}{4a^2}>0. $$

Then \(q(x)=a((x-h)^2+d)\). The bracket is positive for every real \(x\), so \(q\) has the same sign everywhere as \(a\). In particular, if \(a<0\), the completed-square expression is negative everywhere.

The derivative of \(q\) is \(q'(x)=2ax+b\). Write the numerator as a multiple of this derivative plus a constant:

$$ Ax+B = \frac{A}{2a}(2ax+b) + \left(B-\frac{Ab}{2a}\right). $$

This split is useful because the first part integrates to a logarithm. The constant part is integrated using the completed square.

Formula: For \(q(x)=ax^2+bx+c\) irreducible over the reals, set \(h=-b/(2a)\) and \(d=(4ac-b^2)/(4a^2)>0\). Then
$$ \int \frac{Ax+B}{q(x)}\,dx = \frac{A}{2a}\ln|q(x)| + \frac{B-\frac{Ab}{2a}}{a\sqrt d} \arctan\left(\frac{x-h}{\sqrt d}\right)+C. $$

The absolute value in the logarithm is necessary when \(q(x)<0\). There are no real zeros of \(q\), so this antiderivative is defined throughout the real line.

Why the Formula Works

The numerator split and the completed square give a direct derivation. Let \(\mu=B-\frac{Ab}{2a}\). Then

$$ \frac{Ax+B}{q(x)} = \frac{A}{2a}\frac{q'(x)}{q(x)} + \frac{\mu}{a((x-h)^2+d)}. $$

The first quotient has antiderivative \(\frac{A}{2a}\ln|q(x)|\), because the derivative of \(\ln|q(x)|\) is \(q'(x)/q(x)\) wherever \(q(x)\ne0\). For the second quotient, the substitution \(u=(x-h)/\sqrt d\) gives \(dx=\sqrt d\,du\), and therefore

$$ \int \frac{dx}{a((x-h)^2+d)} = \frac{1}{a\sqrt d}\int\frac{du}{1+u^2} = \frac{1}{a\sqrt d}\arctan u+C. $$

Substituting back gives the stated formula. This derivation also explains why the sign of \(a\) must be retained in the inverse-tangent coefficient.

Worked Examples

Worked Example: Decompose and Integrate Two Quadratic Terms

Evaluate

$$ \int \frac{x^3+4x^2+7x+13}{(x^2+1)(x^2+4)}\,dx. $$

Both denominator factors are irreducible over the reals. Set up the partial fractions with linear numerators:

$$ \frac{x^3+4x^2+7x+13}{(x^2+1)(x^2+4)} = \frac{Ax+B}{x^2+1}+\frac{Cx+D}{x^2+4}. $$

Multiplying by \((x^2+1)(x^2+4)\) gives

$$ x^3+4x^2+7x+13 = (Ax+B)(x^2+4)+(Cx+D)(x^2+1). $$

Expanding the right side and matching coefficients yields \(A+C=1\), \(B+D=4\), \(4A+C=7\), and \(4B+D=13\). Subtracting the first equation from the third gives \(3A=6\), so \(A=2\) and \(C=-1\). Subtracting the second equation from the fourth gives \(3B=9\), so \(B=3\) and \(D=1\). Thus

$$ \frac{x^3+4x^2+7x+13}{(x^2+1)(x^2+4)} = \frac{2x+3}{x^2+1}+\frac{-x+1}{x^2+4}. $$

Integrate the first term by separating \(2x\), the derivative of \(x^2+1\), from the constant \(3\):

$$ \int\frac{2x+3}{x^2+1}\,dx = \ln(x^2+1)+3\arctan x. $$

For the second term, \(-x\) is \(-\frac12\) times the derivative of \(x^2+4\). Also, \(\int dx/(x^2+4)=\frac12\arctan(x/2)\). Therefore

$$ \int\frac{-x+1}{x^2+4}\,dx = -\frac12\ln(x^2+4)+\frac12\arctan\left(\frac{x}{2}\right). $$

Combining the results gives

$$ \ln(x^2+1)+3\arctan x -\frac12\ln(x^2+4) +\frac12\arctan\left(\frac{x}{2}\right)+C. $$

Check by differentiation: the derivative is \(\frac{2x+3}{x^2+1}+\frac{-x+1}{x^2+4}\). Combining those fractions gives numerator \((2x+3)(x^2+4)+(-x+1)(x^2+1)=x^3+4x^2+7x+13\) over the original denominator, as required.

Worked Example: Complete the Square in a Shifted Quadratic

Evaluate

$$ \int \frac{5x+1}{2x^2-4x+5}\,dx. $$

Complete the square, keeping the leading coefficient outside the bracket:

$$ 2x^2-4x+5 = 2\bigl((x-1)^2+\tfrac32\bigr). $$

The denominator’s derivative is \(4x-4\), and the numerator splits as \(5x+1=\frac54(4x-4)+6\). Thus

$$ \int\frac{5x+1}{2x^2-4x+5}\,dx = \frac54\ln(2x^2-4x+5) +6\int\frac{dx}{2((x-1)^2+\frac32)}. $$

For the remaining integral, the completed-square formula gives

$$ \int\frac{dx}{2((x-1)^2+\frac32)} = \frac{1}{\sqrt6} \arctan\left(\sqrt{\frac23}(x-1)\right). $$

Therefore an antiderivative is

$$ \frac54\ln(2x^2-4x+5) +\sqrt6\arctan\left(\sqrt{\frac23}(x-1)\right)+C. $$

To check, differentiate the logarithmic term to obtain \((5x-5)/(2x^2-4x+5)\). Differentiating the inverse-tangent term gives \(6/(2x^2-4x+5)\). Their sum is \((5x+1)/(2x^2-4x+5)\), the original integrand.

Worked Example: Integrate an Irreducible Quadratic with Negative Leading Coefficient

Evaluate

$$ \int\frac{3x+1}{-2x^2+4x-5}\,dx. $$

The discriminant is \(4^2-4(-2)(-5)=16-40=-24<0\), so the quadratic is irreducible. Completing the square gives

$$ -2x^2+4x-5 = -2\bigl((x-1)^2+\tfrac32\bigr). $$

The denominator is negative for every real \(x\). Its derivative is \(-4x+4\), and \(3x+1=-\frac34(-4x+4)+4\). Hence

$$ \int\frac{3x+1}{-2x^2+4x-5}\,dx = -\frac34\ln|-2x^2+4x-5| + 4\int\frac{dx}{-2((x-1)^2+\frac32)}. $$

The remaining integral equals \(-\frac{1}{\sqrt6}\arctan(\sqrt{2/3}(x-1))\). Thus the antiderivative is

$$ -\frac34\ln|-2x^2+4x-5| -\frac{4}{\sqrt6}\arctan\left(\sqrt{\frac23}(x-1)\right)+C. $$

For the check, the derivative of the logarithmic term is \((3x-3)/(-2x^2+4x-5)\). The derivative of the inverse-tangent term is \(4/(-2x^2+4x-5)\). Their sum is the original integrand. The absolute value in the logarithm is valid and necessary because its argument is always negative.

A Common Sign Mistake

A common error is to assume that every irreducible quadratic can be written as a positive constant times a square plus a positive constant. For example, \(-x^2-1\) is irreducible, but it is \(-(x^2+1)\), not a positive square plus a positive constant. Dropping the negative factor changes the sign of the integrand and gives the wrong inverse-tangent contribution.

Takeaway: Complete the square while preserving the original leading coefficient. The bracket \((x-h)^2+d\) has \(d>0\), but the whole quadratic \(a((x-h)^2+d)\) has the sign of \(a\).

Using the Method Reliably

For a rational function with distinct irreducible quadratic factors, first obtain the partial-fraction decomposition, then integrate each term on its own. In each term, identify the derivative of the denominator, subtract the matching multiple from the numerator, and complete the square in the denominator. This separates the logarithmic and inverse-tangent parts without guessing.

Keep the logarithmic absolute value when the quadratic can be negative, and retain the sign of the leading coefficient in the inverse-tangent coefficient. Finally, differentiate the proposed antiderivative or recombine the partial fractions to check it. These checks catch both coefficient errors in the decomposition and sign errors in the integration.

Check Your Understanding

Use the completed-square form and numerator split to answer the following.

  1. For \(x^2+6x+13\), find \(h\) and \(d\) in the form \((x-h)^2+d\).
  2. For \(q(x)=3x^2+6x+5\), write \(1/q(x)\) in completed-square form and state whether \(q\) is positive or negative.
  3. In \((4x+7)/(2x^2+4x+5)\), express the numerator as a multiple of the denominator’s derivative plus a constant.
  4. Why is an absolute value used in \(\ln|q(x)|\) when integrating \(q'(x)/q(x)\)?
  5. Explain why replacing a negative-leading irreducible quadratic by its positive version without adjusting the numerator changes the integral.

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