Chapter 9
25 min read
Section 86 of 353

Partial Fractions Decomposition

The Indefinite Integral and Antiderivatives

Learning Objectives

By the end of this section, you will be able to:

  1. Understand why partial fractions decomposition is needed for integrating rational functions
  2. Identify whether a rational function is proper and perform polynomial long division when necessary
  3. Decompose rational functions with distinct linear factors, repeated linear factors, and irreducible quadratic factors
  4. Apply the cover-up method for efficient coefficient determination
  5. Integrate rational functions by decomposing into partial fractions first
  6. Connect partial fractions to applications in control systems, signal processing, and differential equations

The Big Picture: Why Partial Fractions?

"Partial fractions transforms a single complex fraction into a sum of simple fractions — making impossible integrals possible."

Consider the integral 3x+2(x1)(x+2)dx\int \frac{3x + 2}{(x-1)(x+2)} \, dx. There's no obvious substitution that works. The numerator isn't a derivative of the denominator. The integrand doesn't match any formula we know. What do we do?

The key insight is that we can break this single fraction into a sum of simpler fractions:

3x+2(x1)(x+2)=Ax1+Bx+2\frac{3x + 2}{(x-1)(x+2)} = \frac{A}{x-1} + \frac{B}{x+2}

Each of these simpler fractions is easy to integrate — they're just 1xr\frac{1}{x-r} type functions that give logarithms!

The Core Insight

Partial fractions decomposition reverses the process of combining fractions. Just as 12+13=56\frac{1}{2} + \frac{1}{3} = \frac{5}{6}, we can go backwards: 56=12+13\frac{5}{6} = \frac{1}{2} + \frac{1}{3}. For algebraic fractions, this "undoing" transforms complex integrals into sums of simple ones.

What Makes This Powerful?

Once decomposed, each partial fraction integrates using basic formulas:

  • Axrdx=Alnxr+C\int \frac{A}{x-r} \, dx = A \ln|x-r| + C
  • A(xr)ndx=A(1n)(xr)n1+C\int \frac{A}{(x-r)^n} \, dx = \frac{A}{(1-n)(x-r)^{n-1}} + C (for n1n \neq 1)
  • 1x2+a2dx=1aarctan(xa)+C\int \frac{1}{x^2 + a^2} \, dx = \frac{1}{a} \arctan\left(\frac{x}{a}\right) + C

Partial fractions is one of the most systematic and powerful techniques in integral calculus, with applications far beyond finding antiderivatives.


Historical Context

The method of partial fractions has roots in the early development of calculus and algebra in the 17th and 18th centuries.

Johann Bernoulli (1667–1748)

Johann Bernoulli, one of the founding figures of calculus, developed systematic methods for integrating rational functions. He recognized that factoring denominators and decomposing fractions could simplify otherwise intractable integrals.

Gottfried Leibniz (1646–1716)

Leibniz also contributed to the algebraic manipulation of fractions, and his notation for calculus made it natural to express decompositions symbolically. The systematic approach to partial fractions emerged as mathematicians needed techniques to solve the differential equations arising in physics.

Modern Applications

Today, partial fractions is fundamental in:

  • Control Systems Engineering: Inverse Laplace transforms of transfer functions
  • Signal Processing: Z-transform analysis of digital filters
  • Differential Equations: Solving linear ODEs with constant coefficients
  • Probability Theory: Computing probability generating functions

Proper vs Improper Rational Functions

Before applying partial fractions, we must ensure our rational function is proper.

Proper vs Improper Rational Functions

Proper

deg(P)<deg(Q)\deg(P) < \deg(Q)

Example: x+1x2+3x+2\frac{x+1}{x^2+3x+2} where deg(1) < deg(2)

Improper

deg(P)deg(Q)\deg(P) \geq \deg(Q)

Example: x3+2x2+1\frac{x^3+2}{x^2+1} where deg(3) > deg(2)

For improper rational functions, we must first perform polynomial long division to extract the polynomial part:

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

where S(x)S(x) is a polynomial (the quotient) and deg(R)<deg(Q)\deg(R) < \deg(Q) (R is the remainder).

Example: Making an Improper Fraction Proper

Problem: Decompose x3+2x2+x+3x2+x\frac{x^3 + 2x^2 + x + 3}{x^2 + x}

Step 1: Check degrees. Numerator has degree 3, denominator has degree 2. This is improper.

Step 2: Perform polynomial long division.

x^3 + 2x^2 + x + 3 divided by x^2 + x gives:
Quotient: x + 1
Remainder: 3

Step 3: Write as sum.

x3+2x2+x+3x2+x=x+1+3x2+x\frac{x^3 + 2x^2 + x + 3}{x^2 + x} = x + 1 + \frac{3}{x^2 + x}

Now 3x2+x=3x(x+1)\frac{3}{x^2 + x} = \frac{3}{x(x+1)} is proper and can be decomposed.


The Partial Fractions Theorem

The Fundamental Theorem of Algebra guarantees that every polynomial with real coefficients can be factored into linear and irreducible quadratic factors. This leads to our decomposition rules.

Partial Fractions Decomposition Theorem

Every proper rational function P(x)Q(x)\frac{P(x)}{Q(x)} with Q(x)Q(x) factored into linear and irreducible quadratic factors can be written as a sum of partial fractions.

The form of decomposition depends on the factors in the denominator:

Factor TypeForm in DecompositionExample
Distinct linear (x - r)A/(x - r)1/((x-1)(x+2)) → A/(x-1) + B/(x+2)
Repeated linear (x - r)^nA₁/(x-r) + A₂/(x-r)² + ... + Aₙ/(x-r)^n1/(x+1)² → A/(x+1) + B/(x+1)²
Irreducible quadratic (x² + bx + c)(Ax + B)/(x² + bx + c)1/(x(x²+1)) → A/x + (Bx+C)/(x²+1)
Repeated quadratic (x² + bx + c)^nSum of (Aₖx + Bₖ)/(x² + bx + c)^kSimilar to repeated linear

Case 1: Distinct Linear Factors

The simplest and most common case: when the denominator factors into distinct (non-repeating) linear factors.

The Setup

If Q(x)=(xr1)(xr2)(xrn)Q(x) = (x - r_1)(x - r_2) \cdots (x - r_n)where all roots rir_i are distinct, then:

P(x)Q(x)=A1xr1+A2xr2++Anxrn\frac{P(x)}{Q(x)} = \frac{A_1}{x - r_1} + \frac{A_2}{x - r_2} + \cdots + \frac{A_n}{x - r_n}

Finding the Constants

Method 1: Multiply and Compare Coefficients

  1. Multiply both sides by the common denominator Q(x)Q(x)
  2. Expand the right side
  3. Compare coefficients of like powers of xx
  4. Solve the system of equations

Method 2: Strategic Substitution

  1. Multiply both sides by Q(x)Q(x)
  2. Substitute x=rix = r_i to isolate each AiA_i

Worked Example

Decompose: 5x4x2x2\frac{5x - 4}{x^2 - x - 2}

Step 1: Factor the denominator.

x2x2=(x2)(x+1)x^2 - x - 2 = (x-2)(x+1)

Step 2: Set up the decomposition.

5x4(x2)(x+1)=Ax2+Bx+1\frac{5x - 4}{(x-2)(x+1)} = \frac{A}{x-2} + \frac{B}{x+1}

Step 3: Multiply by (x2)(x+1)(x-2)(x+1).

5x4=A(x+1)+B(x2)5x - 4 = A(x+1) + B(x-2)

Step 4: Substitute x=2x = 2.

5(2)4=A(3)+B(0)    6=3A    A=25(2) - 4 = A(3) + B(0) \implies 6 = 3A \implies A = 2

Step 5: Substitute x=1x = -1.

5(1)4=A(0)+B(3)    9=3B    B=35(-1) - 4 = A(0) + B(-3) \implies -9 = -3B \implies B = 3

Result:

5x4x2x2=2x2+3x+1\frac{5x - 4}{x^2 - x - 2} = \frac{2}{x-2} + \frac{3}{x+1}

Integration:

5x4x2x2dx=2lnx2+3lnx+1+C\int \frac{5x - 4}{x^2 - x - 2} \, dx = 2\ln|x-2| + 3\ln|x+1| + C

Interactive: Visualizing Partial Fractions

Explore how the original rational function equals the sum of its partial fractions. Toggle the decomposition view to see the individual terms:

Interactive Partial Fractions Decomposition
Example Type:
-4-2024-4-2024Original f(x)A/(x-1)B/(x+2)

Distinct Linear Factors

The original rational function is decomposed into simpler fractions that can be integrated individually.

Original: (3x + 2)/((x-1)(x+2))
= (5/3)/(x-1) + (-2/3)/(x+2)

Resulting Integral

Each partial fraction leads to a straightforward integral:

(5/3)ln|x-1| - (2/3)ln|x+2| + C

Step-by-Step Process

  1. Factor the denominator completely into linear and irreducible quadratic factors
  2. Set up the decomposition with unknown constants A, B, C, etc.
  3. Multiply both sides by the common denominator to clear fractions
  4. Solve for constants using strategic substitution or comparing coefficients
  5. Integrate each term separately using basic integration formulas

Case 2: Repeated Linear Factors

When a linear factor appears multiple times, we need multiple terms in the decomposition — one for each power up to the multiplicity.

The Rule

If (xr)n(x - r)^n is a factor of Q(x)Q(x), then the decomposition includes:

A1xr+A2(xr)2++An(xr)n\frac{A_1}{x - r} + \frac{A_2}{(x - r)^2} + \cdots + \frac{A_n}{(x - r)^n}

Why Multiple Terms?

With repeated factors, a single term Axr\frac{A}{x-r} doesn't provide enough freedom to match all the coefficients in the original numerator. Each power adds another constant to solve for.

Worked Example

Decompose: x2+4x+1(x1)(x+1)2\frac{x^2 + 4x + 1}{(x-1)(x+1)^2}

Setup: The factor (x+1)(x+1) appears with multiplicity 2.

x2+4x+1(x1)(x+1)2=Ax1+Bx+1+C(x+1)2\frac{x^2 + 4x + 1}{(x-1)(x+1)^2} = \frac{A}{x-1} + \frac{B}{x+1} + \frac{C}{(x+1)^2}

Multiply through:

x2+4x+1=A(x+1)2+B(x1)(x+1)+C(x1)x^2 + 4x + 1 = A(x+1)^2 + B(x-1)(x+1) + C(x-1)

Strategic substitution:

  • x=1x = 1: 6=4A    A=3/26 = 4A \implies A = 3/2
  • x=1x = -1: 2=2C    C=1-2 = -2C \implies C = 1
  • x=0x = 0: 1=ABC=3/2B1    B=1/21 = A - B - C = 3/2 - B - 1 \implies B = -1/2
=3/2x11/2x+1+1(x+1)2= \frac{3/2}{x-1} - \frac{1/2}{x+1} + \frac{1}{(x+1)^2}

Integration:

=32lnx112lnx+11x+1+C= \frac{3}{2}\ln|x-1| - \frac{1}{2}\ln|x+1| - \frac{1}{x+1} + C

Case 3: Irreducible Quadratic Factors

When the denominator contains a quadratic that cannot be factored over the real numbers (e.g., x2+1x^2 + 1, x2+x+1x^2 + x + 1), we need a linear numerator.

The Rule

For an irreducible quadratic factor ax2+bx+cax^2 + bx + c:

Ax+Bax2+bx+c\frac{Ax + B}{ax^2 + bx + c}

Why a linear numerator? A quadratic factor represents two complex conjugate roots. A single constant wouldn't provide enough degrees of freedom to match the original rational function.

Recognizing Irreducible Quadratics

A quadratic ax2+bx+cax^2 + bx + c is irreducible over the reals if b24ac<0b^2 - 4ac < 0. Common examples: x2+1x^2 + 1, x2+4x^2 + 4, x2+x+1x^2 + x + 1.

Worked Example

Decompose: 2x+3x(x2+1)\frac{2x + 3}{x(x^2 + 1)}

Setup: The factor x2+1x^2 + 1 is irreducible.

2x+3x(x2+1)=Ax+Bx+Cx2+1\frac{2x + 3}{x(x^2 + 1)} = \frac{A}{x} + \frac{Bx + C}{x^2 + 1}

Multiply through:

2x+3=A(x2+1)+(Bx+C)x2x + 3 = A(x^2 + 1) + (Bx + C)x

Expand and collect terms:

2x+3=Ax2+A+Bx2+Cx=(A+B)x2+Cx+A2x + 3 = Ax^2 + A + Bx^2 + Cx = (A + B)x^2 + Cx + A

Compare coefficients:

  • x2x^2: A+B=0A + B = 0
  • x1x^1: C=2C = 2
  • x0x^0: A=3A = 3

So A=3A = 3, B=3B = -3, C=2C = 2.

2x+3x(x2+1)=3x+3x+2x2+1\frac{2x + 3}{x(x^2 + 1)} = \frac{3}{x} + \frac{-3x + 2}{x^2 + 1}

Integration: Split the second term.

3x+2x2+1dx=322xx2+1dx+21x2+1dx\int \frac{-3x + 2}{x^2 + 1} \, dx = -\frac{3}{2}\int \frac{2x}{x^2 + 1} \, dx + 2\int \frac{1}{x^2 + 1} \, dx
=3lnx32ln(x2+1)+2arctan(x)+C= 3\ln|x| - \frac{3}{2}\ln(x^2 + 1) + 2\arctan(x) + C

Interactive: Step-by-Step Decomposition

Walk through a complete decomposition process step by step:

Step-by-Step Decomposition
Step 1 of 7

Step 1: Start with the Rational Function

We want to decompose this rational function into simpler partial fractions.

(3x + 2) / ((x - 1)(x + 2))

The denominator is already factored into two distinct linear factors: (x - 1) and (x + 2). The degree of the numerator (1) is less than the degree of the denominator (2), so we can proceed.


The Cover-Up Method (Heaviside Method)

For distinct linear factors, the cover-up method provides a lightning-fast way to find coefficients without writing out the full algebra.

The Cover-Up Method

To find AiA_i for the factor (xri)(x - r_i):

Ai=P(x)Q(x)/(xri)x=riA_i = \left.\frac{P(x)}{Q(x) / (x - r_i)}\right|_{x = r_i}

"Cover up" the factor (xri)(x - r_i) in the denominator and evaluate at x=rix = r_i.

Example: Cover-Up in Action

Find the partial fractions of: x+5(x2)(x+3)\frac{x + 5}{(x - 2)(x + 3)}

For A (cover up (x - 2), set x = 2):

A=2+52+3=75A = \frac{2 + 5}{2 + 3} = \frac{7}{5}

For B (cover up (x + 3), set x = -3):

B=3+532=25=25B = \frac{-3 + 5}{-3 - 2} = \frac{2}{-5} = -\frac{2}{5}
x+5(x2)(x+3)=7/5x22/5x+3\frac{x + 5}{(x - 2)(x + 3)} = \frac{7/5}{x - 2} - \frac{2/5}{x + 3}

Why This Works

The cover-up method is equivalent to strategic substitution. When we set x=rix = r_i, all terms except the one with (xri)(x - r_i) vanish, leaving only AiA_i times the remaining factors.


Worked Examples

Example 1: Three Distinct Linear Factors

Integrate: 1x3xdx\int \frac{1}{x^3 - x} \, dx

Factor: x3x=x(x21)=x(x1)(x+1)x^3 - x = x(x^2 - 1) = x(x-1)(x+1)

Setup:

1x(x1)(x+1)=Ax+Bx1+Cx+1\frac{1}{x(x-1)(x+1)} = \frac{A}{x} + \frac{B}{x-1} + \frac{C}{x+1}

Cover-up method:

  • A=1(01)(0+1)=1(1)(1)=1A = \frac{1}{(0-1)(0+1)} = \frac{1}{(-1)(1)} = -1
  • B=11(1+1)=12B = \frac{1}{1(1+1)} = \frac{1}{2}
  • C=1(1)(11)=12C = \frac{1}{(-1)(-1-1)} = \frac{1}{2}
1x3xdx=lnx+12lnx1+12lnx+1+C\int \frac{1}{x^3 - x} \, dx = -\ln|x| + \frac{1}{2}\ln|x-1| + \frac{1}{2}\ln|x+1| + C

This can be simplified using logarithm properties:

=12ln(x1)(x+1)x2+C=12lnx21x2+C= \frac{1}{2}\ln\left|\frac{(x-1)(x+1)}{x^2}\right| + C = \frac{1}{2}\ln\left|\frac{x^2 - 1}{x^2}\right| + C

Example 2: Mixed Factor Types

Integrate: x2+1x(x2+4)dx\int \frac{x^2 + 1}{x(x^2 + 4)} \, dx

Setup: x2+4x^2 + 4 is irreducible.

x2+1x(x2+4)=Ax+Bx+Cx2+4\frac{x^2 + 1}{x(x^2 + 4)} = \frac{A}{x} + \frac{Bx + C}{x^2 + 4}

Multiply through and compare:

x2+1=A(x2+4)+(Bx+C)x=(A+B)x2+Cx+4Ax^2 + 1 = A(x^2 + 4) + (Bx + C)x = (A + B)x^2 + Cx + 4A
  • x2x^2: A+B=1A + B = 1
  • x1x^1: C=0C = 0
  • x0x^0: 4A=1    A=1/44A = 1 \implies A = 1/4

So B=3/4B = 3/4.

=1/4x+3x/4x2+4= \frac{1/4}{x} + \frac{3x/4}{x^2 + 4}

Integrate:

=14lnx+38ln(x2+4)+C= \frac{1}{4}\ln|x| + \frac{3}{8}\ln(x^2 + 4) + C

Real-World Applications

Partial fractions is not just an integration technique — it's a fundamental tool in engineering and applied mathematics.

Control Systems: Inverse Laplace Transforms

In control theory, system behavior is often described by transfer functions in the Laplace domain:

H(s)=1s2+3s+2=1(s+1)(s+2)H(s) = \frac{1}{s^2 + 3s + 2} = \frac{1}{(s+1)(s+2)}

Decomposing gives 1s+11s+2\frac{1}{s+1} - \frac{1}{s+2}, leading to the time-domain response h(t)=ete2th(t) = e^{-t} - e^{-2t}.

Signal Processing: Z-Transforms

Digital filter analysis uses the Z-transform. Partial fractions decomposition enables finding the inverse Z-transform:

H(z)=zz20.5z0.5=z(z1)(z+0.5)H(z) = \frac{z}{z^2 - 0.5z - 0.5} = \frac{z}{(z-1)(z+0.5)}

Decomposition reveals the system's modes and determines stability (poles inside the unit circle = stable).

Differential Equations

When solving linear ODEs with constant coefficients using Laplace transforms, partial fractions converts the algebraic solution back to the time domain:

y+3y+2y=ety'' + 3y' + 2y = e^{-t}

Laplace transform gives a rational function in ss. Partial fractions + inverse transform yields y(t)y(t).

Probability Generating Functions

In probability theory, generating functions often yield rational expressions. Partial fractions helps extract probabilities:

G(z)=p1qz=p+pqz+pq2z2+G(z) = \frac{p}{1 - qz} = p + pqz + pq^2z^2 + \cdots

More complex generating functions require partial fractions for analysis.


Machine Learning Connection

While partial fractions may seem distant from machine learning, the underlying principles connect to several ML concepts.

Transfer Functions in Recurrent Networks

Recurrent neural networks (RNNs) can be analyzed using Z-transforms and linear systems theory. The hidden state update:

ht=Wht1+Uxth_t = Wh_{t-1} + Ux_t

In the Z-domain, this becomes a rational function. Analyzing poles (via partial fractions) reveals stability and memory properties.

Rational Function Approximation

Some neural network architectures use rational functions as activation functions or approximators:

  • Padé Approximants: Rational function approximations of exponentials and other functions
  • Rational Neural Networks: Networks that learn rational function transformations

Symbolic Regression

In interpretable ML, symbolic regression finds closed-form expressions for data. Partial fractions helps simplify discovered rational functions into interpretable components.

Control-Theoretic Perspectives on Learning

Gradient descent can be analyzed as a dynamical system. The learning rate and loss landscape create a "transfer function" whose properties (stability, convergence rate) can be studied using classical control theory tools including partial fractions.


Python Implementation

Here's how to perform partial fractions decomposition and integration computationally:

Partial Fractions: Symbolic and Numerical
🐍partial_fractions.py
12SymPy apart() Function

The apart() function performs partial fraction decomposition automatically. It factors the denominator and finds the coefficients for each term.

36Irreducible Quadratic Handling

SymPy correctly handles irreducible quadratic factors like (x^2+1) by using linear numerators (Ax+B) instead of just constants.

58Integration After Decomposition

After decomposition, each partial fraction term integrates to a simple logarithm or arctangent, making the entire integral tractable.

86Inverse Laplace Transform

Partial fractions are essential for finding inverse Laplace transforms. Each simple fraction corresponds to an exponential or oscillatory time-domain response.

116Poles and Stability

The poles of a transfer function (roots of the denominator) determine system stability. Negative real parts mean decaying responses, hence stability.

145Z-Transform Analysis

For discrete-time systems, partial fractions help analyze digital filters. Stability requires all poles to be inside the unit circle |z| < 1.

185 lines without explanation
1import numpy as np
2from scipy import integrate
3import sympy as sp
4
5def partial_fractions_symbolic():
6    """
7    Use SymPy to perform partial fraction decomposition.
8    This demonstrates the algebraic process computer algebra systems use.
9    """
10    x = sp.Symbol('x')
11
12    # Example 1: Distinct linear factors
13    expr1 = (3*x + 2) / ((x - 1) * (x + 2))
14    decomposed1 = sp.apart(expr1, x)
15
16    print("Partial Fraction Decomposition Examples")
17    print("=" * 55)
18    print(f"\n1. Distinct Linear Factors:")
19    print(f"   Original: {expr1}")
20    print(f"   Decomposed: {decomposed1}")
21
22    # Example 2: Repeated linear factor
23    expr2 = (x**2 + 2*x + 3) / ((x - 1) * (x + 1)**2)
24    decomposed2 = sp.apart(expr2, x)
25
26    print(f"\n2. Repeated Linear Factor:")
27    print(f"   Original: {expr2}")
28    print(f"   Decomposed: {decomposed2}")
29
30    # Example 3: Irreducible quadratic
31    expr3 = (2*x + 3) / (x * (x**2 + 1))
32    decomposed3 = sp.apart(expr3, x)
33
34    print(f"\n3. Irreducible Quadratic Factor:")
35    print(f"   Original: {expr3}")
36    print(f"   Decomposed: {decomposed3}")
37
38    return decomposed1, decomposed2, decomposed3
39
40def integrate_with_partial_fractions():
41    """
42    Integrate rational functions using partial fractions decomposition.
43    Shows how decomposition simplifies integration.
44    """
45    x = sp.Symbol('x')
46
47    # Integral of (3x + 2) / ((x-1)(x+2))
48    integrand = (3*x + 2) / ((x - 1) * (x + 2))
49
50    # First decompose
51    decomposed = sp.apart(integrand, x)
52
53    # Integrate the decomposed form
54    antiderivative = sp.integrate(decomposed, x)
55
56    print("\n" + "=" * 55)
57    print("Integration Using Partial Fractions")
58    print("=" * 55)
59    print(f"\nIntegrand: {integrand}")
60    print(f"Decomposed: {decomposed}")
61    print(f"Antiderivative: {antiderivative}")
62
63    # Numerical verification over [2, 5]
64    numerical_result, _ = integrate.quad(
65        lambda t: float(integrand.subs(x, t)), 2, 5
66    )
67
68    # Evaluate symbolic result at bounds
69    F_5 = float(antiderivative.subs(x, 5))
70    F_2 = float(antiderivative.subs(x, 2))
71    symbolic_result = F_5 - F_2
72
73    print(f"\nDefinite integral from 2 to 5:")
74    print(f"  Numerical:  {numerical_result:.10f}")
75    print(f"  Symbolic:   {symbolic_result:.10f}")
76    print(f"  Error:      {abs(numerical_result - symbolic_result):.2e}")
77
78    return antiderivative
79
80def laplace_transform_pf():
81    """
82    Partial fractions in Laplace transforms for control systems.
83    Used to find inverse Laplace transforms.
84    """
85    s = sp.Symbol('s')
86    t = sp.Symbol('t', positive=True)
87
88    print("\n" + "=" * 55)
89    print("Partial Fractions in Laplace Transforms")
90    print("=" * 55)
91
92    # Transfer function: H(s) = 1 / (s^2 + 3s + 2)
93    H = 1 / (s**2 + 3*s + 2)
94
95    print(f"\nTransfer function: H(s) = {H}")
96
97    # Factor denominator: s^2 + 3s + 2 = (s+1)(s+2)
98    H_factored = 1 / ((s + 1) * (s + 2))
99
100    # Partial fraction decomposition
101    H_decomposed = sp.apart(H, s)
102    print(f"Decomposed: H(s) = {H_decomposed}")
103
104    # Inverse Laplace transform
105    # L^{-1}[1/(s+a)] = e^(-at)
106    h_t = sp.inverse_laplace_transform(H, s, t)
107    print(f"Impulse response: h(t) = {h_t}")
108
109    # This is fundamental in control systems engineering
110    print("\nThis technique is essential for:")
111    print("  - Finding step and impulse responses")
112    print("  - Stability analysis")
113    print("  - Controller design")
114
115    return h_t
116
117def transfer_function_analysis():
118    """
119    Analyze a second-order system using partial fractions.
120    Shows poles, residues, and time-domain response.
121    """
122    print("\n" + "=" * 55)
123    print("Transfer Function Analysis via Partial Fractions")
124    print("=" * 55)
125
126    s = sp.Symbol('s')
127
128    # Second-order system: H(s) = 2/(s^2 + 5s + 6)
129    H = 2 / (s**2 + 5*s + 6)
130
131    # Find poles (roots of denominator)
132    denom = s**2 + 5*s + 6
133    poles = sp.solve(denom, s)
134    print(f"\nTransfer function: H(s) = {H}")
135    print(f"Poles: {poles}")
136
137    # Partial fractions decomposition
138    pf = sp.apart(H, s)
139    print(f"Partial fractions: {pf}")
140
141    # Each term corresponds to a mode of the system
142    # The poles determine stability: all poles negative = stable
143    print(f"\nStability: All poles have negative real parts")
144    print(f"System is STABLE")
145
146    return pf
147
148def signal_processing_example():
149    """
150    Partial fractions in discrete-time signal processing.
151    Used for z-transform analysis of digital filters.
152    """
153    z = sp.Symbol('z')
154
155    print("\n" + "=" * 55)
156    print("Z-Transform and Digital Filter Analysis")
157    print("=" * 55)
158
159    # Digital filter transfer function
160    # H(z) = z / (z^2 - 1.5z + 0.5)
161    H = z / (z**2 - 1.5*z + 0.5)
162
163    print(f"\nDigital filter: H(z) = {H}")
164
165    # Factor: z^2 - 1.5z + 0.5 = (z - 0.5)(z - 1)
166    H_factored = z / ((z - 0.5) * (z - 1))
167
168    # Partial fractions
169    H_pf = sp.apart(H, z)
170    print(f"Partial fractions: {H_pf}")
171
172    # Find poles
173    poles = sp.solve(z**2 - 1.5*z + 0.5, z)
174    print(f"Poles: {poles}")
175
176    # For stability, all poles must be inside unit circle
177    pole_magnitudes = [abs(complex(p)) for p in poles]
178    print(f"Pole magnitudes: {pole_magnitudes}")
179
180    stable = all(m < 1 for m in pole_magnitudes)
181    print(f"\nStability: {'STABLE' if stable else 'UNSTABLE'}")
182    print("(All poles must have magnitude < 1 for stability)")
183
184    return H_pf
185
186# Run all demonstrations
187partial_fractions_symbolic()
188integrate_with_partial_fractions()
189laplace_transform_pf()
190transfer_function_analysis()
191signal_processing_example()

Common Mistakes to Avoid

Mistake 1: Forgetting to Check if the Fraction is Proper

Before decomposing, ensure deg(P)<deg(Q)\deg(P) < \deg(Q). If not, perform polynomial long division first.

Wrong: Trying to decompose x3x21\frac{x^3}{x^2 - 1} directly.

Right: First divide to get x+xx21x + \frac{x}{x^2 - 1}, then decompose the proper part.

Mistake 2: Wrong Form for Irreducible Quadratics

For irreducible quadratic factors, the numerator must be linear (Ax + B), not just a constant A.

Wrong: 1x(x2+1)=Ax+Bx2+1\frac{1}{x(x^2+1)} = \frac{A}{x} + \frac{B}{x^2+1}

Right: 1x(x2+1)=Ax+Bx+Cx2+1\frac{1}{x(x^2+1)} = \frac{A}{x} + \frac{Bx + C}{x^2+1}

Mistake 3: Missing Terms for Repeated Factors

For (xr)n(x - r)^n, you need n separate terms.

Wrong: 1(x+1)2=A(x+1)2\frac{1}{(x+1)^2} = \frac{A}{(x+1)^2}

Right: 1(x+1)2=Ax+1+B(x+1)2\frac{1}{(x+1)^2} = \frac{A}{x+1} + \frac{B}{(x+1)^2}

Mistake 4: Arithmetic Errors in Cover-Up

When using cover-up, be careful with signs and evaluate precisely.

For x+5(x2)(x+3)\frac{x+5}{(x-2)(x+3)} at x=3x = -3: numerator is 3+5=2-3 + 5 = 2, remaining denominator is 32=5-3 - 2 = -5, so B=2/(5)=2/5B = 2/(-5) = -2/5.

Mistake 5: Forgetting the Absolute Value in Logarithms

1xrdx=lnxr+C\int \frac{1}{x-r} dx = \ln|x-r| + C

The absolute value is essential for the domain of the logarithm whenx<rx < r.


Test Your Understanding

Test Your Understanding
Question 1 of 8Score: 0/0

What is the partial fraction form for 1/((x-1)(x+1))?


Summary

Partial fractions decomposition is a powerful technique that transforms complex rational function integrals into sums of simple, solvable integrals.

Key Decomposition Forms

Factor TypeDecomposition FormIntegration Result
(x - r)A/(x - r)A ln|x - r|
(x - r)^nA₁/(x-r) + ... + Aₙ/(x-r)^nLogs and power terms
x² + a² (irreducible)(Ax + B)/(x² + a²)Logs and arctangent

Key Takeaways

  1. Check properness first: Use polynomial division ifdeg(P)deg(Q)\deg(P) \geq \deg(Q)
  2. Factor completely: The denominator must be fully factored into linear and irreducible quadratic terms
  3. Use the correct form: Match the decomposition template to each factor type
  4. Cover-up for speed: Use the Heaviside method for distinct linear factors
  5. Integrate each term: Simple fractions yield logarithms, arctangents, and power functions
  6. Applications abound: Control systems, signal processing, differential equations all rely on this technique
The Core Principle:
"Break complex fractions into simple pieces — each piece integrates easily, and the sum gives your answer."
Coming Next: In Trigonometric Substitution, we'll learn how to transform integrals involving square roots into trigonometric integrals using strategic substitutions.
Loading comments...