Tutorials › Calculus II › Combining Linear and Quadratic Factors in One Integral

Completing the Square Techniques · Tutorial 259 of 998

Combining Linear and Quadratic Factors in One Integral

Combine partial fractions with the standard logarithmic and inverse-tangent antiderivatives to integrate rational functions containing both linear and irreducible quadratic factors.

Intermediate 10 min read

What You'll Learn

  • Identify when a rational function with mixed factors is ready for partial-fraction decomposition.
  • Match linear and quadratic numerators to their corresponding denominator factors.
  • Integrate a linear factor term using a logarithm.
  • Split a linear numerator over a quadratic into a logarithmic part and an inverse-tangent part.
  • Verify a mixed partial-fraction antiderivative by differentiation.
  • Avoid common coefficient and scaling errors in inverse-tangent terms.

Why Mixed Factors Require More Than One Antiderivative

A rational function may have a denominator that factors into both real linear factors and irreducible quadratic factors. Partial fractions separate the expression into simpler pieces, but those pieces do not all integrate in the same way: a linear denominator produces a logarithm, while an irreducible quadratic can produce both a logarithm and an inverse tangent.

The main task is therefore to keep the algebra and integration connected. Each partial fraction must have the correct numerator for its denominator, and the quadratic terms must be arranged so their numerators match the derivative of the quadratic or leave a constant remainder.

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

The Decomposition Pattern

For a proper rational function whose denominator is a product of distinct real linear factors and distinct irreducible quadratic factors, the partial-fraction form has a constant numerator over each linear factor and a linear numerator over each quadratic factor. “Proper” means the degree of the numerator is less than the degree of the denominator. If a rational function is not proper, polynomial division is needed first.

$$ \frac{P(x)}{(x-r_1)\cdots(x-r_m)Q_1(x)\cdots Q_n(x)} = \sum_{i=1}^{m}\frac{A_i}{x-r_i} + \sum_{j=1}^{n}\frac{B_jx+C_j}{Q_j(x)}. $$

Here, the \(r_i\) are real numbers, each \(Q_j\) is irreducible over the reals, and the constants \(A_i,B_j,C_j\) are determined by algebra. The linear numerator \(B_jx+C_j\) is necessary: it is general enough to contain a multiple of \(Q_j'(x)\), as well as a constant remainder.

For a linear factor, the relevant antiderivative is \(\int \frac{A}{x-r}\,dx=A\ln|x-r|+C\), valid on any interval not containing \(r\). For a quadratic factor, the completed-square form leads to the logarithmic and inverse-tangent terms.

How a Quadratic Term Splits

Let \(Q(x)=ax^2+bx+c\) be irreducible over the reals, and let its numerator be \(Bx+C\). Since \(Q'(x)=2ax+b\), choose a multiple of \(Q'\) that has the same coefficient of \(x\) as the numerator. The leftover is a constant:

$$ Bx+C = \frac{B}{2a}Q'(x) + \left(C-\frac{Bb}{2a}\right). $$

Completing the square gives \(Q(x)=a\big((x-h)^2+k^2\big)\), where \(h=-\frac{b}{2a}\) and \(k=\frac{\sqrt{4ac-b^2}}{2|a|}>0\). Thus the first part integrates as a logarithm, and the constant remainder integrates as an inverse tangent.

Result: For an irreducible quadratic \(Q(x)=ax^2+bx+c\), with \(a\ne 0\), and constants \(B,C\), an antiderivative is $$ \int \frac{Bx+C}{Q(x)}\,dx = \frac{B}{2a}\ln|Q(x)| + \frac{C-\frac{Bb}{2a}}{ak} \arctan\!\left(\frac{x-h}{k}\right)+C_0, $$ where \(h=-\frac{b}{2a}\), \(k=\frac{\sqrt{4ac-b^2}}{2|a|}\), and \(C_0\) is an arbitrary constant.

Why the Quadratic Formula Works

The decomposition of the numerator is an identity, not a guess. To verify the integration result, differentiate its two terms. The derivative of the logarithmic term is \(\frac{B}{2a}\frac{Q'}{Q}\). Also, because \(Q=a((x-h)^2+k^2)\), the chain rule gives

$$ \frac{d}{dx}\left[\frac{1}{ak}\arctan\!\left(\frac{x-h}{k}\right)\right] = \frac{1}{a((x-h)^2+k^2)} = \frac{1}{Q(x)}. $$

Multiplying this derivative by the constant remainder \(C-\frac{Bb}{2a}\), and adding the logarithmic derivative, gives

$$ \frac{\frac{B}{2a}Q'(x)+C-\frac{Bb}{2a}}{Q(x)} = \frac{Bx+C}{Q(x)}. $$

The numerator equality follows from \(Q'(x)=2ax+b\). Therefore differentiation recovers the original quadratic fraction, which proves the formula on any interval where the integrand is defined.

Worked Examples

Worked Example: One Linear Factor and One Irreducible Quadratic

Evaluate \(\int \frac{2x^2+x+2}{(x-1)(x^2+4)}\,dx\). The quadratic \(x^2+4\) has no real roots, and the rational function is proper. The decomposition has the form

$$ \frac{2x^2+x+2}{(x-1)(x^2+4)} = \frac{A}{x-1}+\frac{Bx+C}{x^2+4}. $$

Use \(A=1\), \(B=1\), and \(C=2\). Combining the right-hand side over a common denominator gives numerator

$$ (x^2+4)+(x+2)(x-1) =x^2+4+x^2+x-2 =2x^2+x+2. $$

So the decomposition is correct. Integrating each term gives

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

For the middle term, \(x\) is half the derivative of \(x^2+4\). For the last term, \(x^2+4=4\big((x/2)^2+1\big)\). To check, differentiate the result:

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

The derivative matches the integrand. The antiderivative is valid on intervals that do not contain \(x=1\).

Worked Example: Two Linear Factors and One Irreducible Quadratic

Evaluate \(\int \frac{2x^3-4x^2-5x-5}{(x+1)(x-2)(x^2+1)}\,dx\). Use the decomposition

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

To verify it, combine the right-hand side over the common denominator. Its numerator is

$$ \begin{aligned} &(x-2)(x^2+1)-(x+1)(x^2+1)+(2x+1)(x+1)(x-2)\\ &=(x^3-2x^2+x-2)-(x^3+x^2+x+1)+(2x^3-x^2-5x-2)\\ &=2x^3-4x^2-5x-5. \end{aligned} $$

Now integrate the terms. In the quadratic fraction, \(2x\) is the derivative of \(x^2+1\), leaving the constant \(1\):

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

Differentiating gives \(\frac{1}{x+1}-\frac{1}{x-2}+\frac{2x+1}{x^2+1}\), which recombines to the original integrand by the numerator calculation above. The formula applies on intervals that exclude \(x=-1\) and \(x=2\).

Worked Example: A Shifted Irreducible Quadratic

Evaluate \(\int \frac{3x^2-9x+8}{(x-3)(x^2-2x+5)}\,dx\). The quadratic completes to \(x^2-2x+5=(x-1)^2+4\), so it is irreducible over the reals. First decompose:

$$ \frac{3x^2-9x+8}{(x-3)(x^2-2x+5)} = \frac{1}{x-3}+\frac{2x-1}{x^2-2x+5}. $$

Indeed, the numerator on the right after combining is

$$ (x^2-2x+5)+(2x-1)(x-3) =x^2-2x+5+2x^2-7x+3 =3x^2-9x+8. $$

For the quadratic term, the derivative of \(x^2-2x+5\) is \(2x-2\), so \(2x-1=(2x-2)+1\). Therefore,

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

The full antiderivative is

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

For a check, differentiating the quadratic terms gives \(\frac{2x-2}{x^2-2x+5}+\frac{1}{(x-1)^2+4}=\frac{2x-1}{x^2-2x+5}\). Adding \(\frac{1}{x-3}\) returns the partial-fraction decomposition, which has already been verified to equal the integrand.

A Common Scaling Error

A frequent mistake is to integrate \(\frac{1}{(x-1)^2+4}\) as \(\arctan(x-1)\). Differentiating that proposed answer gives \(\frac{1}{1+(x-1)^2}\), which is not the original integrand. The \(4\) changes the scale inside the inverse tangent and contributes a factor outside it.

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

because differentiating the right-hand side gives \(\frac{1}{(x-1)^2+4}\). A reliable check is to differentiate every inverse-tangent term before accepting the result.

Putting the Method Together

For a mixed rational integral, the workflow is systematic. The decomposition handles the algebraic structure of the denominator; the shape of each numerator then identifies the appropriate antiderivative.

1
Check the rational function.
If it is not proper, use polynomial division before decomposing it.
2
Write the partial-fraction form.
Use a constant numerator for each real linear factor and a linear numerator for each irreducible quadratic factor.
3
Determine the coefficients.
Combine the fractions or use other valid algebraic methods, then verify the resulting numerator identity.
4
Integrate each term.
Use logarithms for linear denominators; split each quadratic numerator into a multiple of the denominator's derivative plus a constant.
5
Check the result.
Differentiate the proposed antiderivative and confirm that it equals the original rational function.

Mixed-factor integrals are useful practice because they combine partial-fraction algebra with two standard antiderivative forms. The key is not to treat every term alike: linear factors lead to logarithms, while irreducible quadratics may require both a logarithm and an inverse tangent. Keep track of the intervals where the integrand is defined, and include absolute values in logarithms of real linear factors.

Check Your Understanding

Use the decomposition and integration ideas above to answer these questions.

  1. What numerator form is used over an irreducible quadratic factor, and why is a constant numerator generally insufficient?
  2. For \(Q(x)=x^2+6x+13\), complete the square and identify the shift and positive scale in its inverse-tangent form.
  3. Explain how you would split a linear numerator over an irreducible quadratic into a derivative term and a constant remainder.
  4. What restriction on \(x\) is required when integrating a term with denominator \(x-4\)?
  5. How can differentiation reveal an incorrect scale in an inverse-tangent antiderivative?

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