Quartic equation from roots calculator
The quartic equation from roots calculator turns four real roots into one monic fourth-degree polynomial.
Run — free
Enter distinct or repeated values, and it expands the corresponding factors into standard form, returning coefficients in descending-power order as well as a readable equation. This is useful when a problem gives the zeros but asks for the polynomial, when you need to check a factorization, or when software expects a coefficient array rather than root notation. The calculation is deterministic and runs without an external algebra service.
Turn four roots into linear factors
A number r is a root of a polynomial when substituting r for x makes the polynomial equal zero. The factor theorem connects that statement to a linear factor: a root r corresponds to the factor (x - r). This calculator applies that rule to all four supplied values, forming (x - r1)(x - r2)(x - r3)(x - r4). Negative roots naturally produce addition inside a factor, because subtracting a negative value becomes plus. A zero root contributes the factor x. Repeated values are retained, so roots such as 2, 2, -1, and 0 create a polynomial in which 2 has multiplicity two. The result is monic, meaning its leading coefficient is 1. Four linear factors therefore always produce an x^4 term, even if several lower coefficients cancel. Supply the roots as actual JSON numbers, not expressions or symbolic constants. Exactly four finite real numbers are required, which keeps the operation focused on ordinary numeric quartics and makes validation unambiguous.
How the expansion and coefficients are computed
The calculator expands the factors by deterministic coefficient convolution. It begins with the constant polynomial 1. For each root r, it multiplies the current coefficient list by x - r: every existing coefficient contributes once to the next higher-power position and once, multiplied by -r, to the following position. After four passes, the resulting list is [a, b, c, d, e] for ax^4 + bx^3 + cx^2 + dx + e. Because the constructed polynomial is monic, a is always 1. The remaining values also match the elementary symmetric sums: b is the negative sum of the roots, c is the sum of all pairwise products, d is the negative sum of all triple products, and e is the product of all four roots. The response includes both an ordered coefficients array and named standard-form fields. It also includes factor notation, a formatted expression, and an equation ending in zero, making the same calculation convenient for code, worksheets, and visual checking.
Read the result and verify your quartic
Use the coefficients array when passing the polynomial to numerical software: its order is always x^4, x^3, x^2, x, then the constant term. Use standard_form when named fields are clearer, or copy the equation for a written solution. A quick verification is to substitute each original root into the expanded expression; every substitution should produce zero, apart from the tiny rounding effects that can occur with decimal inputs in binary floating-point arithmetic. You can also compare structural clues. The constant term equals the product of the four roots, while the x^3 coefficient is the negative of their sum. If one root is zero, the constant term must be zero. If roots occur as opposite pairs, odd-power terms may cancel. The endpoint performs no equation solving because the roots are already known; its purpose is the reverse operation, constructing and expanding the unique monic quartic associated with those four roots. API requests are priced at $0.002 per item, with one set of four roots counted as one item.
What you can do with it
Create an equation from assigned zeros
Convert four roots from an algebra exercise into the monic quartic equation requested in standard form.
Check a hand expansion
Compare a manually expanded product of four linear factors with a deterministic coefficient list and formatted equation.
Prepare solver input
Turn root-based data into the descending-order coefficient array expected by many numeric and plotting tools.
FAQ
Does the order of the roots matter?
No. Multiplication is commutative, so rearranging the same four roots produces the same coefficient values.
Can roots be repeated?
Yes. Enter the repeated value once for each occurrence; the resulting linear factor has the corresponding multiplicity.
Can I enter negative, zero, or decimal roots?
Yes. Each root may be any finite real number within the published input limit, including negative values, zero, and decimals.
Why is the leading coefficient always 1?
The calculator multiplies factors of the form (x - r), each with leading coefficient 1, so it constructs the unique monic quartic for the roots.
What does one calculation cost?
One API calculation costs $0.002. A request containing exactly four roots counts as one item.
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/quartic-from-roots \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"roots":[1,2,3,4]}'const res = await fetch("https://api.kit.forhosting.com/algebra/quartic-from-roots", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"roots": [
1,
2,
3,
4
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/quartic-from-roots",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"roots": [
1,
2,
3,
4
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/quartic-from-roots", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"roots":[1,2,3,4]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"roots":[1,2,3,4]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/quartic-from-roots", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"roots": [
1,
2,
3,
4
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.quartic_from_roots",
"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. |