Advanced maths

Continuous convolution calculator for piecewise functions

Convolve two compactly supported piecewise polynomials exactly, returning rational interval boundaries, output polynomials and a query value.

Your numbers

One row per piece: lower, upper, c0, c1, ... for c0+c1·x+…. Use 1–5 nonoverlapping intervals within ±100, degree at most six. Fractions or decimals with at most six places; gaps and outside values are zero.
One row per piece: lower, upper, c0, c1, ... for c0+c1·x+…. Use 1–5 nonoverlapping intervals within ±100, degree at most six. Fractions or decimals with at most six places; gaps and outside values are zero.
A finite rational number or decimal with at most six decimal places.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

This calculator performs a continuous convolution integral on two finite piecewise-polynomial functions. Each row supplies an interval and its polynomial coefficients in ascending order. The functions are zero in gaps and beyond their entered pieces. The answer is another piecewise polynomial, expressed with exact rational coefficients and exact rational transition points. A query field evaluates that output at one chosen shift without replacing the integral by a sum over samples.

THE FORMULA(f*g)(t)=∫ f(u)g(t−u) du; each pair contributes over max(a,t−d) < u < min(b,t−c).

A worked example

Let both functions equal one between zero and one and zero elsewhere. At shift t=1/2, their overlapping interval in u is [0,1/2], so the convolution is 1/2. Across all shifts the output is t on [0,1], 2−t on [1,2] and zero outside [0,2]. Its peak is one and its integral is one, agreeing with the product of the two unit input integrals.

Good to know

Supports 1–5 nonoverlapping pieces per function, polynomial degree at most six, endpoints within ±100 and coefficient magnitudes at most 10⁶. Exact entries accept fractions or up to six decimal places. Internal rational-growth limits can reject very large expansions. Isolated endpoint values do not alter the integral. Delta distributions, infinite support, arbitrary transcendental expressions and discrete sequence convolution are outside this page’s input model.

A coefficient row describes a function on an interval, not a sample list

The row 0,1,0,1 means f(x)=x from zero to one: the first two numbers are endpoints, the next is the constant coefficient and the last multiplies x. It does not mean four observed signal samples. For the unit-ramp input convolved with a unit rectangle, the value at t=1/2 is the integral of u from zero to one half, which is 1/8. Replacing that row by a discrete list would answer a different question.

For the default rectangles the integration window grows until t=1 and then shrinks. Endpoint sums zero, one and two identify where the active limits can change. Longer or disconnected input supports create additional cuts, and some output intervals can have the zero polynomial. The table retains those intervals so the whole finite support envelope is inspectable, even when neighboring rows happen to simplify to the same expression.

At shift one half the reflected rectangle overlaps the first rectangle over half a unitShift t = 1/2−1/201/21Overlap = 1/2Output f*g012Peak = 1
The left panel shows f(u) supported on [0,1] and g(1/2−u) supported on [−1/2,1/2]. Their shared interval [0,1/2] has length 1/2. The right panel shows the full triangular output, with the same query marked on its rising branch.

The Fourier series coefficients calculator for a piecewise function instead repeats one declared interval and integrates against harmonic basis functions.

Use exact algebra and an integral check for different kinds of mistakes

The page expands the shifted polynomial g(t−u), integrates in u and substitutes the appropriate moving or fixed bounds. All of those operations use rational arithmetic. Entering 1/3 preserves that fraction; entering 0.333333 instead means exactly 333333/1000000. Exact output therefore describes the numbers you actually supplied, and does not recover a presumed fraction from rounded measurement data. A large rational answer can be correct while still being inconvenient to read.

Swapping the input functions must preserve the convolution. Translating the first input by a shift translates the output by the same shift. Multiplying one input by a constant scales every output piece. The integrated output also equals the product of the integrated inputs, which the engine checks exactly. That identity can catch an expansion mistake, but agreement alone would not prove that each local polynomial is right; the worked rectangle and ramp cases provide separate checks of the local shape.

A few questions, answered

Why do values at the shared endpoints not need a convention?

Changing finitely many ordinary function values changes no integral here. The output table gives continuous-convolution values at those boundaries; it does not introduce impulse distributions.

Can the output be negative?

Yes. Signed input polynomials can give a signed convolution. Only nonnegative inputs guarantee a nonnegative output; area-under-a-rectangle intuition should not be applied blindly to signed functions.

Find your calculator

Start typing to explore the library.