Integration of Rational Functions: Partial Fraction Decomposition

Integration of rational functions may seem difficult because of complicated numerators and denominators. However, the main idea of the method is quite simple: the original fraction is written as a sum of simpler fractions whose integrals are already known. To do this, you need to compare the degrees of the polynomials, factor the denominator, write the corresponding partial fractions, and determine their coefficients step by step.

Initial Step: Integration of Rational Functions and Degree Comparison

A rational function is the ratio of two polynomials:

\[ \frac{P(x)}{Q(x)}, \]

where \( P(x) \) is the polynomial in the numerator and \( Q(x) \) is the polynomial in the denominator. The denominator must not be equal to zero.

Therefore, we consider the antiderivative separately on each interval where the denominator is nonzero:

\[ Q(x)\ne 0. \]

Where should the integration process begin? First, you need to compare the degrees of the numerator and the denominator.

If the degree of the numerator is less than the degree of the denominator, the rational function is called proper:

\[ \deg P(x)<\deg Q(x). \]

A proper rational function can be decomposed directly into partial fractions.

If the degree of the numerator is greater than or equal to the degree of the denominator, the rational function is improper. In this case, the polynomial \( P(x) \) must first be divided by the polynomial \( Q(x) \):

\[ P(x)=Q(x)\cdot S(x)+R(x), \]

where \( S(x) \) is the quotient and \( R(x) \) is the remainder. The degree of the remainder must be less than the degree of the denominator:

\[ \deg R(x)<\deg Q(x). \]

After the division, the original fraction takes the form

\[ \frac{P(x)}{Q(x)} = S(x)+\frac{R(x)}{Q(x)}. \]

Accordingly, the original integral is written as the sum of two integrals:

\[ \int \frac{P(x)}{Q(x)}\,dx = \int S(x)\,dx + \int \frac{R(x)}{Q(x)}\,dx. \]

The first term is the integral of a polynomial. The second contains a proper rational function, so the partial fraction method can now be applied to it.

For example, an improper rational function can be rewritten as follows:

\[ \frac{x^2+2\cdot x+3}{x+1} = x+1+\frac{2}{x+1}. \]

Thus, comparing the degrees allows you to determine immediately whether polynomial division is required before proceeding with further transformations.

Denominator Factorization: Determining the Form of Partial Fractions

After obtaining a proper rational function, the denominator must be factored. This factorization determines the form of the partial fraction decomposition.

When working with real numbers, the polynomial \( Q(x) \) can be written in terms of linear factors and quadratic factors that have no real roots:

\[ Q(x) = a\cdot \prod_{i=1}^{r}(x-\alpha_i)^{m_i} \cdot \prod_{j=1}^{s}(x^2+p_j\cdot x+q_j)^{n_j}. \]

Here, the expressions \( x-\alpha_i \) are linear factors, and \( m_i \) is the multiplicity of the corresponding factor. The expressions

\[ x^2+p_j\cdot x+q_j \]

are quadratic factors that cannot be factored into linear factors over the real numbers.

For each such quadratic polynomial, the discriminant is negative:

\[ p_j^2-4\cdot q_j<0. \]

Why is factoring the denominator so important? Each factor corresponds to a specific partial fraction. If a factor is repeated, every power of that factor must be included in the decomposition.

After the denominator has been completely factored, the proper rational function can be written as a sum of partial fractions corresponding to all linear and irreducible quadratic factors. For a given factorization of the denominator, this representation is unique.

Therefore, the next step is to determine the form of the terms associated with each type of factor.

Linear Factors: Constructing Partial Fractions with Constant Numerators

Suppose the denominator contains a linear factor:

\[ x-\alpha. \]

It corresponds to a partial fraction with a constant numerator:

\[ \frac{A}{x-\alpha}. \]

Why is the numerator a constant? The degree of the numerator in a partial fraction must be less than the degree of the corresponding denominator factor. Since a linear factor has degree one, the numerator must have degree zero, which means it must be a number.

If the denominator contains several distinct linear factors, each factor corresponds to a separate partial fraction. For example:

\[ \frac{2\cdot x+1}{(x-1)\cdot(x+2)} = \frac{A}{x-1} + \frac{B}{x+2}. \]

At this stage, the coefficients \( A \) and \( B \) have not yet been determined. First, you need to write the correct form of the decomposition.

If a linear factor is repeated, the situation changes slightly. Suppose the denominator contains

\[ (x-\alpha)^m. \]

Then partial fractions must be written for every power of this factor:

\[ \frac{A_1}{x-\alpha} + \frac{A_2}{(x-\alpha)^2} + \ldots + \frac{A_m}{(x-\alpha)^m}. \]

No intermediate powers may be omitted. For example, for a proper rational function with the denominator \( (x-1)^3 \), the decomposition has the following form:

\[ \frac{P(x)}{(x-1)^3} = \frac{A_1}{x-1} + \frac{A_2}{(x-1)^2} + \frac{A_3}{(x-1)^3}, \]

where

\[ \deg P(x)<3. \]

If the denominator contains two repeated linear factors, a separate group of terms is written for each one:

\[ \sum_{k=1}^{m}\frac{A_k}{(x-\alpha)^k} + \sum_{k=1}^{n}\frac{B_k}{(x-\beta)^k}. \]

Thus, each linear factor corresponds to partial fractions with constant numerators. The number of these fractions depends on the multiplicity of the factor.

Quadratic Factors: Constructing Partial Fractions with Linear Numerators

Now consider a quadratic factor that is irreducible over the real numbers:

\[ x^2+p\cdot x+q, \]

for which

\[ p^2-4\cdot q<0. \]

It corresponds to a partial fraction with a linear numerator:

\[ \frac{B\cdot x+C}{x^2+p\cdot x+q}. \]

Why does the variable \( x \) appear in the numerator? A quadratic factor has degree two, so the numerator can be a polynomial of degree no greater than one.

If the denominator contains both a quadratic factor and a linear factor, the decomposition may have the following form:

\[ \frac{P(x)}{(x^2+1)\cdot(x-2)} = \frac{A\cdot x+B}{x^2+1} + \frac{C}{x-2}, \]

where

\[ \deg P(x)<3. \]

Therefore, a linear numerator is written above a quadratic factor, while a constant numerator is written above a linear factor.

If the quadratic factor is repeated \( n \) times, all its powers must be included:

\[ \frac{B_1\cdot x+C_1}{x^2+p\cdot x+q} + \frac{B_2\cdot x+C_2}{(x^2+p\cdot x+q)^2} + \ldots + \frac{B_n\cdot x+C_n}{(x^2+p\cdot x+q)^n}. \]

A separate linear numerator is written for each power of the quadratic factor. Accordingly, the coefficients \( B_k \) and \( C_k \) are also determined separately.

Once all the factors of the denominator have been included, the form of the decomposition is fully known. The next step is to find the values of the unknown coefficients.

Determining the Coefficients: Constructing a Polynomial Identity

To determine the unknown coefficients, the partial fractions are brought to a common denominator. Since the denominators on the left-hand and right-hand sides are the same, their numerators must be identically equal:

\[ P(x)=\widetilde{P}(x). \]

This equality must hold not for just one particular value of \( x \), but for all admissible values of the variable. That is why the resulting equation is called a polynomial identity.

The unknown coefficients can be found in two main ways: by comparing the coefficients of the same powers of \( x \) or by substituting specially chosen values of the variable.

The first method involves expanding the right-hand side of the identity, combining like terms, and grouping them according to the powers of \( x \). Then the coefficients of the same powers of the variable are set equal. As a result, a system of linear equations for the unknown constants is obtained.

The second method involves substituting convenient values of \( x \). The roots of the linear factors in the denominator are usually chosen first. After such a substitution, some terms become zero, so certain coefficients can be found without solving the entire system.

However, substitution alone is not always sufficient. This happens when the denominator contains repeated factors or irreducible quadratic factors. In such cases, the two methods are combined: some coefficients are found by substitution, while the remaining ones are determined by comparing coefficients.

After all the unknown coefficients have been found, the decomposition should be checked. To do this, the resulting partial fractions are brought to a common denominator again. If the resulting numerator matches the original polynomial \( P(x) \), the decomposition is correct.

Thus, at this stage, the original rational function has already been written as a sum of partial fractions with known coefficients. All that remains is to integrate each resulting term.

Final Stage: Integration of Rational Functions Using Standard Formulas

After the coefficients have been determined, the integral of a rational function becomes a sum of standard integrals. Each term is evaluated separately.

For a linear factor, use the formula

\[ \int \frac{A}{x-\alpha}\,dx = A\cdot\ln|x-\alpha|+C. \]

The absolute value is needed in the logarithm because the expression \( x-\alpha \) may be positive or negative on different intervals of the domain.

If the linear factor has multiplicity \( k>1 \), we obtain

\[ \int \frac{A}{(x-\alpha)^k}\,dx = -\frac{A}{(k-1)\cdot(x-\alpha)^{k-1}}+C. \]

Therefore, integrating partial fractions with linear denominators gives logarithmic or power expressions.

For a fraction with an irreducible quadratic denominator, consider the integral

\[ \int \frac{B\cdot x+C}{x^2+p\cdot x+q}\,dx. \]

First, rewrite the numerator in terms of the derivative of the denominator. The derivative of the quadratic polynomial is

\[ 2\cdot x+p. \]

Therefore, the numerator is written as

\[ B\cdot x+C = \frac{B}{2}\cdot(2\cdot x+p) + \left(C-\frac{B\cdot p}{2}\right). \]

The original integral is then written as the sum of two integrals. The part whose numerator contains the derivative of the denominator gives a logarithmic expression.

For the other part, complete the square in the quadratic polynomial:

\[ x^2+p\cdot x+q = \left(x+\frac{p}{2}\right)^2 + q-\frac{p^2}{4}. \]

Since the discriminant is negative, the following inequality holds:

\[ q-\frac{p^2}{4}>0. \]

Therefore, the integral with a constant numerator and this type of denominator is expressed using the \( \arctan \) function.

Integrating fractions with repeated quadratic factors requires additional transformations and the use of reduction formulas.

Thus, the integration of rational functions consists of a sequence of transformations. First, an improper rational function is written as the sum of a polynomial and a proper rational function. Next, the denominator is factored, the corresponding partial fractions are written, and the unknown coefficients are determined. Finally, each resulting term is integrated using standard formulas.

Practical Part: Integration of Rational Functions Through Examples

The theoretical method becomes clearer when it is applied step by step to specific problems. In each example, we will first identify the type of rational function, then perform the required decomposition and determine the unknown coefficients. All transformations will be carried out on intervals where the denominator of the original rational function is nonzero.

Example 1. Evaluate the integral
\[ \int \frac{x^2+3\cdot x+5}{x+1}\,dx. \]

The degree of the numerator is two, while the degree of the denominator is one. Therefore, this is an improper rational function. We must first divide the polynomial in the numerator by the polynomial in the denominator.

Write the numerator as

\[ x^2+3\cdot x+5 = (x+1)\cdot(x+2)+3. \]

Therefore,

\[ \frac{x^2+3\cdot x+5}{x+1} = x+2+\frac{3}{x+1}. \]

Now write the original integral as a sum of simpler integrals:

\[ \int \frac{x^2+3\cdot x+5}{x+1}\,dx = \int \left( x+2+\frac{3}{x+1} \right) \,dx. \]

Each term can now be integrated separately:

\[ \begin{gathered} \int x\,dx = \frac{x^2}{2},\\[4pt] \int 2\,dx = 2\cdot x,\\[4pt] \int \frac{3}{x+1}\,dx = 3\cdot\ln|x+1|. \end{gathered} \]

Thus,

\[ \int \frac{x^2+3\cdot x+5}{x+1}\,dx = \frac{x^2}{2} + 2\cdot x + 3\cdot\ln|x+1| + C. \]

In this case, the main step was rewriting the improper rational function as the sum of a polynomial and a proper rational function.

Example 2. Evaluate the integral
\[ \int \frac{5\cdot x+1} {(x-1)\cdot(x+2)} \,dx. \]

The degree of the numerator is less than the degree of the denominator, so the rational function is proper. The denominator has already been factored into two distinct linear factors. Therefore, the original fraction should be written as

\[ \frac{5\cdot x+1} {(x-1)\cdot(x+2)} = \frac{A}{x-1} + \frac{B}{x+2}. \]

Bring the right-hand side to a common denominator:

\[ \frac{A}{x-1} + \frac{B}{x+2} = \frac{ A\cdot(x+2)+B\cdot(x-1) } {(x-1)\cdot(x+2)}. \]

Therefore, the numerators must be identically equal:

\[ 5\cdot x+1 = A\cdot(x+2)+B\cdot(x-1). \]

To find the coefficient \( A \) quickly, substitute \( x=1 \):

\[ \begin{gathered} 5\cdot1+1 = A\cdot(1+2),\\[4pt] 6=3\cdot A,\\[4pt] A=2. \end{gathered} \]

Now substitute \( x=-2 \). The term containing the coefficient \( A \) becomes zero:

\[ \begin{gathered} 5\cdot(-2)+1 = B\cdot(-2-1),\\[4pt] -9=-3\cdot B,\\[4pt] B=3. \end{gathered} \]

Therefore, the decomposition is

\[ \frac{5\cdot x+1} {(x-1)\cdot(x+2)} = \frac{2}{x-1} + \frac{3}{x+2}. \]

Now return to the integral:

\[ \int \frac{5\cdot x+1} {(x-1)\cdot(x+2)} \,dx = \int \left( \frac{2}{x-1} + \frac{3}{x+2} \right) \,dx. \]

Integrate each partial fraction:

\[ \begin{gathered} \int \frac{2}{x-1}\,dx = 2\cdot\ln|x-1|,\\[4pt] \int \frac{3}{x+2}\,dx = 3\cdot\ln|x+2|. \end{gathered} \]

Thus,

\[ \int \frac{5\cdot x+1} {(x-1)\cdot(x+2)} \,dx = 2\cdot\ln|x-1| + 3\cdot\ln|x+2| + C. \]

Distinct linear factors in the denominator correspond to separate partial fractions with constant numerators.

Example 3. Evaluate the integral
\[ \int \frac{4\cdot x} {(x-1)^2\cdot(x+1)} \,dx. \]

The rational function is proper. The denominator contains the repeated linear factor \( (x-1)^2 \) and another linear factor \( x+1 \).

For the repeated factor, both of its powers must be included. Therefore, write

\[ \frac{4\cdot x} {(x-1)^2\cdot(x+1)} = \frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{C}{x+1}. \]

Multiply both sides of the equation by the common denominator:

\[ 4\cdot x = A\cdot(x-1)\cdot(x+1) + B\cdot(x+1) + C\cdot(x-1)^2. \]

First, substitute \( x=1 \). The terms containing the coefficients \( A \) and \( C \) become zero:

\[ \begin{gathered} 4\cdot1 = B\cdot(1+1),\\[4pt] 4=2\cdot B,\\[4pt] B=2. \end{gathered} \]

Next, substitute \( x=-1 \):

\[ \begin{gathered} 4\cdot(-1) = C\cdot(-1-1)^2,\\[4pt] -4=4\cdot C,\\[4pt] C=-1. \end{gathered} \]

Since the coefficients \( B \) and \( C \) are already known, any convenient value of the variable can be used to find \( A \). Choose \( x=0 \), because it simplifies the calculations:

\[ 0 = A\cdot(-1)\cdot1 + 2\cdot1 – 1\cdot(-1)^2. \]

After simplification, we obtain

\[ \begin{gathered} 0=-A+2-1,\\[4pt] A=1. \end{gathered} \]

Therefore,

\[ \frac{4\cdot x} {(x-1)^2\cdot(x+1)} = \frac{1}{x-1} + \frac{2}{(x-1)^2} – \frac{1}{x+1}. \]

Now integrate the resulting sum:

\[ \int \frac{4\cdot x} {(x-1)^2\cdot(x+1)} \,dx = \int \left( \frac{1}{x-1} + \frac{2}{(x-1)^2} – \frac{1}{x+1} \right) \,dx. \]

The first and third integrals give logarithms:

\[ \begin{gathered} \int \frac{1}{x-1}\,dx = \ln|x-1|,\\[4pt] \int \frac{1}{x+1}\,dx = \ln|x+1|. \end{gathered} \]

For the second term, use the power rule:

\[ \int \frac{2}{(x-1)^2}\,dx = 2\cdot \int (x-1)^{-2}\,dx = -\frac{2}{x-1}. \]

Thus,

\[ \int \frac{4\cdot x} {(x-1)^2\cdot(x+1)} \,dx = \ln|x-1| – \frac{2}{x-1} – \ln|x+1| + C. \]

A repeated factor corresponds to two different terms: one with the denominator \( x-1 \) and another with the denominator \( (x-1)^2 \).

Example 4. Evaluate the integral
\[ \int \frac{3\cdot x+4} {x^2+2\cdot x+5} \,dx. \]

The denominator is a quadratic polynomial. Let us check whether it can be factored into linear factors over the real numbers:

\[ D = 2^2-4\cdot1\cdot5 = 4-20 = -16. \]

The discriminant is negative, so the denominator has no real roots. In this case, the numerator should be rewritten in terms of the derivative of the denominator.

The derivative of the denominator is

\[ (x^2+2\cdot x+5)' = 2\cdot x+2. \]

Write the numerator as

\[ 3\cdot x+4 = \frac{3}{2}\cdot(2\cdot x+2)+1. \]

Then the original integral becomes

\[ \int \frac{3\cdot x+4} {x^2+2\cdot x+5} \,dx = \frac{3}{2}\cdot \int \frac{2\cdot x+2} {x^2+2\cdot x+5} \,dx + \int \frac{1} {x^2+2\cdot x+5} \,dx. \]

The first integral immediately gives a logarithm:

\[ \frac{3}{2}\cdot \int \frac{2\cdot x+2} {x^2+2\cdot x+5} \,dx = \frac{3}{2}\cdot \ln(x^2+2\cdot x+5). \]

To evaluate the second integral, complete the square in the quadratic polynomial:

\[ x^2+2\cdot x+5 = (x+1)^2+4. \]

Therefore,

\[ \int \frac{1} {x^2+2\cdot x+5} \,dx = \int \frac{1} {(x+1)^2+2^2} \,dx. \]

Apply the standard arctangent formula:

\[ \int \frac{1} {(x+1)^2+2^2} \,dx = \frac{1}{2}\cdot \arctan\left(\frac{x+1}{2}\right). \]

Thus,

\[ \int \frac{3\cdot x+4} {x^2+2\cdot x+5} \,dx = \frac{3}{2}\cdot \ln(x^2+2\cdot x+5) + \frac{1}{2}\cdot \arctan\left(\frac{x+1}{2}\right) + C. \]

The absolute value is not needed in the logarithm here because

\[ x^2+2\cdot x+5 = (x+1)^2+4>0 \]

for all real values of \( x \).

Integrating a fraction with an irreducible quadratic denominator gives a logarithm and an arctangent when the numerator is separated into a part related to the derivative of the denominator and a constant part.

Example 5. Evaluate the integral
\[ \int \frac{3\cdot x^2+x-2} {(x-1)\cdot(x^2+1)} \,dx. \]

The denominator contains the linear factor \( x-1 \) and the irreducible quadratic factor \( x^2+1 \). Therefore, the decomposition must include a partial fraction with a constant numerator and a fraction with a linear numerator:

\[ \frac{3\cdot x^2+x-2} {(x-1)\cdot(x^2+1)} = \frac{A}{x-1} + \frac{B\cdot x+C}{x^2+1}. \]

Multiply both sides of the equation by the common denominator:

\[ 3\cdot x^2+x-2 = A\cdot(x^2+1) + (B\cdot x+C)\cdot(x-1). \]

First, substitute \( x=1 \):

\[ \begin{gathered} 3\cdot1^2+1-2 = A\cdot(1^2+1),\\[4pt] 2=2\cdot A,\\[4pt] A=1. \end{gathered} \]

To find the remaining coefficients, expand the expressions on the right-hand side:

\[ A\cdot(x^2+1) + (B\cdot x+C)\cdot(x-1) = A\cdot x^2+A + B\cdot x^2-B\cdot x + C\cdot x-C. \]

Group the terms according to the powers of \( x \):

\[ 3\cdot x^2+x-2 = (A+B)\cdot x^2 + (C-B)\cdot x + A-C. \]

Now compare the coefficients:

\[ \begin{gathered} A+B=3,\\[4pt] C-B=1,\\[4pt] A-C=-2. \end{gathered} \]

Since \( A=1 \), the first equation gives

\[ \begin{gathered} 1+B=3,\\[4pt] B=2. \end{gathered} \]

From the third equation, we obtain

\[ \begin{gathered} 1-C=-2,\\[4pt] C=3. \end{gathered} \]

The second equation is also satisfied:

\[ 3-2=1. \]

Therefore, the decomposition is

\[ \frac{3\cdot x^2+x-2} {(x-1)\cdot(x^2+1)} = \frac{1}{x-1} + \frac{2\cdot x+3}{x^2+1}. \]

Separate the second fraction into two terms:

\[ \frac{2\cdot x+3}{x^2+1} = \frac{2\cdot x}{x^2+1} + \frac{3}{x^2+1}. \]

Then

\[ \int \frac{3\cdot x^2+x-2} {(x-1)\cdot(x^2+1)} \,dx = \int \frac{1}{x-1}\,dx + \int \frac{2\cdot x}{x^2+1}\,dx + \int \frac{3}{x^2+1}\,dx. \]

The first integral is

\[ \int \frac{1}{x-1}\,dx = \ln|x-1|. \]

In the second integral, the numerator is the derivative of the denominator:

\[ \int \frac{2\cdot x}{x^2+1}\,dx = \ln(x^2+1). \]

For the third integral, use the standard formula:

\[ \int \frac{3}{x^2+1}\,dx = 3\cdot\arctan(x). \]

Thus,

\[ \int \frac{3\cdot x^2+x-2} {(x-1)\cdot(x^2+1)} \,dx = \ln|x-1| + \ln(x^2+1) + 3\cdot\arctan(x) + C. \]

This example combines two different types of factors in one decomposition. The linear factor gives a logarithm with an absolute value, while the quadratic factor gives a logarithm and an arctangent.

Next Step in Integral Calculus: Topics to Explore

Now that you have studied the partial fraction method, where should you go next? The following topics will introduce you to other important types of integrals and methods for evaluating them.

  1. Integrals of Trigonometric Functions: Basic Methods β€” This article will explain how to integrate powers and products of trigonometric functions using identities and algebraic transformations.
  2. Integrals Involving Radicals: Common Substitutions β€” This material will show how to choose suitable substitutions for expressions containing radicals and reduce them to simpler standard integrals.
  3. Definite Integral: Geometric Meaning and Properties β€” This article will explain the connection between the definite integral and area, as well as its main properties and calculation rules.

Integration of Rational Functions: From Flowchart to Code

Do you enjoy programming? Then try implementing the algorithm shown in the flowchart using your favorite programming language. The program should check whether the input data are valid, find the coefficients of the partial fraction decomposition, and evaluate the antiderivative at a given point. Pascal, Python, JavaScript, or C++β€”the choice is yours. This way, you will see how a sequence of mathematical transformations can be turned into clear and understandable code.

Flowchart of the algorithm for the integration of rational functions using partial fraction decomposition and evaluating the antiderivative