Polynomial multiplication calculator
Expand a product of polynomials without slips: (1 + 2x) times (3 + 4x) is 3 + 10x + 8x², and the degree of the product, 2, is the sum of the degrees. 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.
A polynomial multiplication calculator turns two coefficient lists into the expanded product of the corresponding polynomials. Enter p and q as arrays of numbers with the constant term first—so [1, 2] means 1 + 2x and [3, 4] means 3 + 4x—and the tool returns the product coefficients, human-readable polynomial strings, degrees of both factors and of the product, and step-by-step convolution notes. Homework checks, exam prep, coding kata expected values, and signal-processing demos all need the same discrete convolution without opening a computer-algebra system.
What coefficient lists mean and how the product is formed
A univariate polynomial is completely determined by its sequence of real coefficients once you fix the ordering convention. This tool uses the constant-term-first convention that dominates programming and numerical libraries: the array [a0, a1, a2, …, am] stands for a0 plus a1 times x plus a2 times x squared, up to am times x to the m. The second input uses the same convention.
Formal degree is the highest index whose absolute value is above a tiny epsilon, so a list that ends with numerical dust still reports the correct mathematical degree. The zero polynomial—every coefficient zero after rounding—is allowed as a factor or as a product, and its degree is reported as minus one by the usual algebra convention.
What you can do with it
Homework checks for expanding products
Students enter two coefficient lists from textbook problems and compare hand-expanded products, degrees, and readable polynomial strings against a deterministic result before submitting.
Signal and control demos with FIR convolution
Pipelines treat short FIR impulse responses as polynomials and multiply them to cascade filters, using the same coefficient product without a CAS dependency.
FAQ
How are coefficients ordered?
Constant term first: [a0, a1, a2] means a0 + a1·x + a2·x². The product uses the same low-to-high order.
What happens if either list is empty?
An empty array is missing data, not the zero polynomial.
Does the product drop trailing zeros?
The product array keeps the full convolution length (len(p)+len(q)−1). Formal degree ignores trailing near-zeros for the degree field and pretty-print string.
Can I multiply more than two polynomials?
Not in one call. Multiply pairwise: feed the product of the first pair as p for the next factor.
Is the polynomial multiplication calculator free?
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/polynomial-multiply \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"p":[1,2],"q":[3,4]}'const res = await fetch("https://api.kit.forhosting.com/algebra/polynomial-multiply", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"p": [
1,
2
],
"q": [
3,
4
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/polynomial-multiply",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"p": [
1,
2
],
"q": [
3,
4
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/polynomial-multiply", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"p":[1,2],"q":[3,4]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"p":[1,2],"q":[3,4]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/polynomial-multiply", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"p": [
1,
2
],
"q": [
3,
4
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.polynomial_multiply",
"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.
Limits
max_coeffs | 256 |
max_abs | 1000000000000 |
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
Empty lists are rejected with a clear invalid_input error instead of inventing a zero polynomial by silence.
What coefficient lists mean and how the product is formed
The algebraic product of two such polynomials is again a polynomial whose coefficient at degree k is the sum over i of a_i times b_{k−i} for every index pair that stays inside both arrays. That sum is exactly the discrete convolution of the two sequences, and its length is always len(p) plus len(q) minus one before you drop trailing zeros for display. What is not allowed is an empty coefficient array: empty is not a zero polynomial; it is missing data, and the API returns invalid_input so homework scripts and grading pipelines fail loudly instead of treating silence as zero.
How to call the API and what comes back
Send a JSON body with two required non-empty arrays of finite numbers: p (aliases poly1, a, left) and q (aliases poly2, b, right). Each array may hold at most two hundred fifty-six coefficients, and every absolute coefficient value must stay within one trillion so intermediate products remain finite in IEEE double precision on the Worker and in the browser. String numbers are accepted when they match a strict finite numeric pattern; JSON-encoded array strings are also accepted for clients that only send text fields. On success the response echoes rounded p and q, sets product to the full convolution coefficient list (constant first), degree_p, degree_q, and degree to the formal degrees of the factors and the product, p_str, q_str, and product_str to compact human-readable polynomials with sensible signs and omitted unit coefficients, formula to a short English description of coefficient convolution, message to a one-line degree summary, and steps to an ordered array of substitution lines you can assert in tests. Failed validation—missing fields, empty arrays, non-arrays, non-finite entries, lists longer than the published maximum, values outside absolute limits, or non-finite products—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
Keep coefficient magnitudes inside the published absolute range so pairwise products cannot overflow into a non-finite convolution term that the solver must reject. Classic classroom checks include (1 + x) times (1 + x) equals 1 + 2x + x squared, (2 + 3x) times (4 − x) equals 8 + 10x − 3x squared, and a constant times any polynomial scales every coefficient. Prefer this capability when you already have both coefficient vectors and only need the expanded product; if your source is a written expression, parse coefficients first. Round-trip checks are easy: recompute a few product[k] entries by hand from the convolution formula and confirm they match the published product array within the same twelve-decimal rounding. Prefer sending genuine JSON arrays rather than pre-formatted strings when you control the client. Pair those successes with an empty p or empty q to document the hard invalid_input path. This landing targets people searching for a polynomial multiplication calculator, multiply two polynomials by coefficients, or expand a product of polynomials online; it is not a multivariate multiplier, not a factorizer, and not a root finder. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send empty lists.
Integration use cases
Unit tests for student polynomial libraries
Generate known-good convolution cases plus deliberate empty-list rejections for coding kata expected values and continuous integration fixtures.