Partial fraction decomposition
Split a rational function into simple pieces ready to integrate: 1 over (x − 1)(x − 2) becomes −1/(x − 1) + 1/(x − 2). Repeated and irreducible quadratic factors are handled too. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
Partial fraction decomposition rewrites a proper rational function N of x over D of x as a sum of simpler rational pieces whose denominators are powers of the real linear and irreducible quadratic factors of D. That sum is the standard setup for integrating rational functions by hand, for Laplace inverse transforms in engineering, and for clearing nested denominators in symbolic algebra pipelines. This capability takes the numerator as an ascending-degree coefficient array and the denominator as an explicit factor list—each factor either linear a x plus b raised to a power, or irreducible quadratic a x squared plus b x plus c raised to a power—and returns every undetermined coefficient, a structured term list, and a printable decomposition string.
How partial fractions work with linear and quadratic factors
Start from a proper rational N of x over D of x, meaning the degree of N is strictly less than the degree of D after the denominator is expanded from its factors. Over the real numbers every non-constant polynomial factors into linear pieces a x plus b and irreducible quadratic pieces a x squared plus b x plus c with non-positive discriminant.
The classical ansatz writes one constant numerator A sub k for each power of a linear factor and a linear numerator B sub k times x plus C sub k for each power of a quadratic factor, collecting every power from one up through the full multiplicity of that factor. Multiply both sides by D to clear denominators; the left side is N and the right side becomes a linear combination of known polynomials whose coefficients are exactly the unknown A, B, and C values.
Equating coefficients of like powers of x produces a square linear system whose size equals the degree of D. Quadratic factors must stay irreducible; if the discriminant is positive you should split them into real linears before calling this tool, because the real partial-fraction form does not keep a reducible quadratic intact.
Multiplicities are supported up to a small classroom-safe bound so repeated factors such as open parenthesis x minus one close parenthesis squared appear as A over x minus one plus B over open parenthesis x minus one close parenthesis squared.
What you send and what you get back
Send factors as a non-empty array of objects. A linear factor uses kind linear together with coefficients a and b for a x plus b and an optional integer power between one and eight that defaults to one. A quadratic factor uses kind quadratic together with a, b, and c for a x squared plus b x plus c, the same optional power, and must satisfy b squared minus four a c less than or equal to zero so the quadratic is irreducible over the reals.
Classic checks include one over open parenthesis x minus one close parenthesis times open parenthesis x minus two close parenthesis equaling negative one over x minus one plus one over x minus two, and numerators with a repeated linear factor or an irreducible x squared plus one block. Wire the free browser form for homework and quick sanity checks, then call the identical contract from scripts when you need bulk generation of answer keys.
Where partial fraction decomposition shows up in real work
Secondary-school and college calculus courses assign partial-fraction drills before every rational integration unit, and instructors need a trusted oracle that returns every A, B, and C with stable ordering for auto-graders and worksheet keys. Computer-algebra teaching tools and contest problem generators manufacture rational integrands from random factor lists and must reject improper inputs instead of silently dropping a polynomial quotient. Engineering notebooks that clear multi-factor transfer functions before Bode or residue analysis benefit from the same structured term list the classroom uses.
If you later need polynomial long division for improper fractions, full symbolic factoring of an unfactored expanded denominator, complex-factor partial fractions, or automatic antiderivatives of each term, treat those as separate search intents and landings rather than overloading this proper real partial-fraction page.
What you can do with it
Calculus homework and answer keys
Generate every partial term for textbook proper rationals with linear and quadratic factors so teachers and auto-graders share one ground truth before integration drills.
Laplace inverse and residues
Decompose rational Laplace images into simple and repeated poles plus irreducible quadratic blocks for inverse transforms and residue tables.
Transfer-function cleanup
Rewrite multi-factor rational transfer functions as a sum of elementary pieces for hand analysis, Bode sketches, or export into symbolic notebooks.
FAQ
What is a proper rational function here?
One whose numerator degree is strictly less than the expanded denominator degree.
Which factor kinds are supported?
Linear factors (a*x + b)^power and irreducible quadratic factors (a*x² + b*x + c)^power with discriminant ≤ 0. Reducible quadratics must be split into real linears before calling the tool.
How are numerator coefficients ordered?
Ascending degree: [c0, c1, c2] means c0 + c1*x + c2*x². That matches many numerical libraries and keeps the linear system indexing simple.
Does it handle repeated factors?
Yes. Set power (or multiplicity) on a factor. A linear factor of power m produces m constant numerators A1…Am; a quadratic of power m produces m linear numerators (Bk x + Ck).
What does it cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/partial-fractions \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"numerator":[1],"factors":[{"kind":"linear","a":1,"b":-1,"power":1},{"kind":"linear","a":1,"b":-2,"power":1}]}'const res = await fetch("https://api.kit.forhosting.com/algebra/partial-fractions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"numerator": [
1
],
"factors": [
{
"kind": "linear",
"a": 1,
"b": -1,
"power": 1
},
{
"kind": "linear",
"a": 1,
"b": -2,
"power": 1
}
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/partial-fractions",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"numerator": [
1
],
"factors": [
{
"kind": "linear",
"a": 1,
"b": -1,
"power": 1
},
{
"kind": "linear",
"a": 1,
"b": -2,
"power": 1
}
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/partial-fractions", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"numerator":[1],"factors":[{"kind":"linear","a":1,"b":-1,"power":1},{"kind":"linear","a":1,"b":-2,"power":1}]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"numerator":[1],"factors":[{"kind":"linear","a":1,"b":-1,"power":1},{"kind":"linear","a":1,"b":-2,"power":1}]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/partial-fractions", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"numerator": [
1
],
"factors": [
{
"kind": "linear",
"a": 1,
"b": -1,
"power": 1
},
{
"kind": "linear",
"a": 1,
"b": -2,
"power": 1
}
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.partial_fractions",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Only proper rationals are accepted: if the numerator degree is not strictly below the denominator degree, the request fails with a clear validation error so you can divide polynomials first.
How partial fractions work with linear and quadratic factors
Gaussian elimination with partial pivoting solves that system in deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift, so identical inputs always yield identical JSON.
What you send and what you get back
Send numerator as a non-empty JSON array of finite numbers in ascending degree order so that the array c zero, c one, c two means c zero plus c one times x plus c two times x squared and so on. Missing fields, non-numeric strings, NaN, Infinity, empty arrays, zero leading a on a factor, reducible quadratics, and improper rationals all fail with invalid_input and are not charged. On success the response echoes cleaned numerator and expanded denominator coefficients, both degrees, a proper flag set to true, a factors summary with display strings, a terms array where each linear term carries coefficient and each quadratic term carries num_linear and num_const, a human-readable decomposition sum, and method equal to undetermined_coefficients. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where partial fraction decomposition shows up in real work
Differential equations and control courses invert Laplace transforms by decomposing rational images into simple poles and quadratic denominators; a deterministic API keeps homework bots and notebook demos aligned. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.