ForHosting KIT · Math

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
Use it from WebAPIEmailTelegramApp soon

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.

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.

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.

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.

POSThttps://api.kit.forhosting.com/algebra/polynomial-multiply

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.

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]}'
{
  "p": [
    1,
    2
  ],
  "q": [
    3,
    4
  ]
}
{
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_coeffs256
max_abs1000000000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

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.

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.

Read the full KIT documentation →