Partial Fraction Calculator
Decompose a rational function into partial fractions, with every algebra step shown.
Solves (ax + b) / ((x + r₁)(x + r₂)) = A/(x + r₁) + B/(x + r₂). The two roots must be different.
Works for distinct linear factors. Repeated factors or irreducible quadratics need a different decomposition form.
Integrating a rational function like (3x + 5)/((x + 1)(x + 4)) looks intimidating until you split it into simpler pieces. Partial fraction decomposition rewrites one complicated fraction as a sum of easy ones — and once split, each piece integrates to a plain logarithm.
The Partial Fraction Calculator above performs the decomposition for distinct linear factors. Enter the numerator coefficients and the two denominator roots, and it returns the constants A and B with every algebra step shown.
This guide explains the method from the ground up: setting up the form, matching coefficients, solving for the constants, and checking the answer.
What Does the Partial Fraction Calculator Do?
The calculator decomposes (ax + b)/((x + r1)(x + r2)) into A/(x + r1) + B/(x + r2). You enter a, b, and the two roots r1 and r2; it returns the values of A and B.
The headline result shows the finished decomposition in readable form. Below it, five numbered steps walk through the algebra: multiplying through, collecting terms, matching coefficients, solving, and verifying.
The tool handles the distinct-linear-factor case — the most common one in calculus courses. The two roots must be different; equal roots need a repeated-factor form this calculator does not cover.
How to Use the Partial Fraction Calculator
Enter the numerator's coefficient a (the number multiplying x) and the constant b. If the numerator is just a constant, enter 0 for a — for example, 7/((x + 1)(x + 4)) means a = 0 and b = 7.
Enter the two roots r1 and r2 as they appear inside the factors. For (x + 1)(x + 4), the roots are 1 and 4; for (x − 2)(x + 5), the roots are −2 and 5.
Press Calculate. The decomposition and the five solution steps appear in the result panel. Press Reset to decompose another function.
Why Decomposition Is Useful
A rational function with a factored denominator is hard to integrate directly, but its partial fraction pieces are easy. Each term A/(x + r) integrates to A·ln|x + r| — a result you can write down immediately.
The same splitting simplifies inverse Laplace transforms in engineering, where each simple fraction corresponds to a known exponential in the time domain. Partial fractions are the bridge between a messy rational function and a table of standard forms.
Even for algebra alone, the decomposition reveals structure: the constants A and B are the "weights" of each factor's contribution, and they often have physical meaning in the application.
Setting Up the Decomposition Form
Every partial fraction problem starts by writing the template with unknown constants. For distinct linear factors, each factor gets its own constant over it:
(ax + b)/((x + r1)(x + r2)) = A/(x + r1) + B/(x + r2)
The form is dictated by the denominator's factorization. Distinct linear factors give one constant each — no x terms in the numerators, no squared denominators. Getting the template right is half the battle.
Clearing Denominators
Multiply both sides by the full denominator (x + r1)(x + r2). The fractions collapse and you get a polynomial identity:
A(x + r2) + B(x + r1) = ax + b
This must hold for every x, which is the key insight: it is not one equation but infinitely many, one per x value. That is why we can extract two separate conditions from it.
The calculator shows this as Step 1, with your numbers substituted in so you can see the concrete equation rather than the abstract form.
Matching Coefficients
Expand the left side and collect the x terms and the constant terms separately:
(A + B)x + (Ar2 + Br1) = ax + b
Two polynomials are equal for all x only if their coefficients match term by term. That gives a system of two equations:
A + B = a and Ar2 + Br1 = b
This "match coefficients" move converts one polynomial identity into a solvable linear system. It works because x and the constant term are independent — neither can compensate for the other.
Solving for A and B
Solve the two-by-two system. From the first equation, A = a − B; substituting into the second gives B(r1 − r2) = b − a·r2, so:
B = (b − a·r2) / (r1 − r2), then A = a − B
The division by (r1 − r2) is exactly why the roots must differ — equal roots would mean dividing by zero, which signals that the repeated-factor template is needed instead.
The calculator performs this solve in Step 4 and reports both constants to six decimal places, which is exact for the integer and simple-fraction cases students meet most.
Worked Example: (3x + 5)/((x + 1)(x + 4))
First: set up the form: (3x + 5)/((x + 1)(x + 4)) = A/(x + 1) + B/(x + 4). Here a = 3, b = 5, r1 = 1, r2 = 4.
Then: clear denominators: A(x + 4) + B(x + 1) = 3x + 5. Collect: (A + B)x + (4A + B) = 3x + 5.
Then: match coefficients: A + B = 3 and 4A + B = 5. Subtracting gives 3A = 2, so A = 2/3, and B = 3 − 2/3 = 7/3.
Result: 2/3/(x + 1) + 7/3/(x + 4). Check: the pieces recombine to exactly 3x + 5.
Worked Example: A Constant Numerator, 7/((x + 1)(x + 4))
First: the form is the same, with a = 0 and b = 7: A/(x + 1) + B/(x + 4).
Then: (A + B)x + (4A + B) = 0x + 7, so A + B = 0 and 4A + B = 7.
Then: subtracting gives 3A = 7, so A = 7/3 and B = −7/3.
Result: 7/3/(x + 1) − 7/3/(x + 4). The constants are opposites — a pattern that always appears when the numerator is constant and the roots are symmetric in this way.
Worked Example: With a Negative Root, (2x − 1)/((x − 2)(x + 5))
First: read the roots carefully — (x − 2) means r1 = −2, and (x + 5) means r2 = 5. Here a = 2, b = −1.
Then: A + B = 2 and A·5 + B·(−2) = −1, i.e. 5A − 2B = −1.
Then: from A = 2 − B, substitute: 5(2 − B) − 2B = −1, so 10 − 7B = −1, giving B = 11/7 and A = 3/7.
Result: 3/7/(x − 2) + 11/7/(x + 5). The most common error here is misreading the sign of the root — always rewrite (x − 2) as (x + (−2)) mentally.
Checking Your Answer
Verification is easy and worth doing: recombine the pieces over the common denominator and confirm the numerator matches. A + B must equal a, and Ar2 + Br1 must equal b — two quick arithmetic checks.
The calculator performs both checks automatically in Step 5 and reports whether the pieces recombine exactly. If a check fails, the usual culprit is a mistyped root, not the method.
For hand work, there is an even faster check: substitute x = −r1 into the cleared equation. The B term vanishes, leaving A(r2 − r1) = a(−r1) + b — one equation, one unknown, instant verification of A.
Common Partial Fraction Mistakes
The number one mistake is misreading root signs. In (x − 3), the root is −3, not 3 — the factor is (x + (−3)). Every sign error downstream traces back to this moment.
Another classic error is using this template for repeated factors. If the denominator is (x + 1)², the correct form is A/(x + 1) + B/(x + 1)² — the single-constant form cannot represent it.
Students also forget that the numerator's degree must be lower than the denominator's. If it is not, do polynomial long division first and decompose only the proper remainder fraction.
What Comes After Decomposition
In calculus, each term integrates immediately: ∫ A/(x + r) dx = A·ln|x + r| + C. A problem that looked impossible becomes two logarithms added together.
In differential equations, partial fractions split the Laplace transform of a solution into pieces that each invert to a simple exponential. Engineers use this so routinely that the decomposition step becomes invisible.
The deeper lesson is a general strategy: when a complicated object resists direct attack, split it into simple pieces, solve each piece, and reassemble. Partial fractions are most students' first encounter with that idea.
How to Interpret Your Result Correctly
The headline decomposition is the answer — the original fraction rewritten as a sum. Read it as an identity: the two sides are equal for every x where the denominator is nonzero.
The five steps are the audit trail. Step 3's two equations are the heart of the method; if you understand why matching coefficients is legal, you understand partial fractions.
Watch the decimal places on messy roots. Six decimals are shown, but the exact values are fractions — for hand-written work, keep the fractions rather than the decimals.
Where Partial Fractions Are Useful
Calculus courses use them for integrating rational functions — the single most common application, and the reason the technique is taught. Any integral of a proper rational function with a factorable denominator yields to this method.
Control theory and signal processing use them to invert Laplace and z-transforms, turning transfer functions into time-domain responses. Chemistry uses the same algebra in partial molar quantities and kinetics derivations.
Even numerical computing benefits: evaluating a sum of simple fractions is often more stable than evaluating the original rational function near its poles.
Frequently Asked Questions
1. What is the Partial Fraction Calculator?
It decomposes a rational function (ax + b)/((x + r1)(x + r2)) into A/(x + r1) + B/(x + r2) for distinct linear factors. It returns the constants A and B with all five algebra steps shown.
2. What is partial fraction decomposition?
It rewrites a complicated rational expression as a sum of simpler fractions. The classic use is integration: each piece A/(x + r) integrates to A·ln|x + r|, which is easy to write down.
3. How do I set up the decomposition form?
Give each distinct linear factor its own constant: (ax + b)/((x + r1)(x + r2)) = A/(x + r1) + B/(x + r2). The denominator's factorization dictates the template.
4. How are A and B actually found?
Clear denominators to get A(x + r2) + B(x + r1) = ax + b, match coefficients to get A + B = a and Ar2 + Br1 = b, then solve the two equations. The calculator shows each move.
5. Why must the roots be different?
Because solving divides by (r1 − r2). Equal roots make that zero, which signals that the repeated-factor template A/(x + r) + B/(x + r)² is needed instead.
6. What if the numerator is just a constant?
Enter 0 for a. The method works identically — for 7/((x + 1)(x + 4)), you get A = 7/3 and B = −7/3.
7. How do I read the root from (x − 2)?
The factor (x − 2) is (x + (−2)), so the root is −2. Misreading this sign is the most common error in partial fraction problems.
8. What if the numerator's degree is not lower than the denominator's?
Do polynomial long division first, then decompose only the proper fraction remainder. The calculator assumes a proper fraction with a linear numerator.
9. How do I check my answer?
Recombine the pieces over the common denominator and confirm the numerator matches: verify A + B = a and Ar2 + Br1 = b. The calculator runs both checks in Step 5.
10. What about repeated factors like (x + 1)²?
They need an expanded template: A/(x + 1) + B/(x + 1)². This calculator covers only distinct linear factors, so use the repeated-factor form for those cases.
11. What about irreducible quadratics?
A factor like (x² + 1) gets a linear numerator: (Ax + B)/(x² + 1). That is a different template from the one this calculator implements.
12. Why is this useful for integration?
Because ∫ A/(x + r) dx = A·ln|x + r| + C is immediate. Decomposition converts an intimidating rational integrand into a sum of logarithms.
13. Is there a shortcut for finding A and B?
Yes — the cover-up (Heaviside) method: to find A, cover (x + r1) in the original fraction and substitute x = −r1. It gives each constant in one step for distinct linear factors.
14. Can the constants be fractions or negatives?
Absolutely. A = 2/3 and B = 7/3 in the worked example, and negative constants are common — for instance, B = −7/3 with a constant numerator. The calculator shows exact decimal values.
15. Where else are partial fractions used?
In Laplace transform inversion for differential equations, in control theory and signal processing, and in chemistry kinetics. Anywhere a rational function needs splitting into simple, recognizable pieces.