On this page
Multiplying two polynomials the school way means multiplying every coefficient of one by every coefficient of the other. Two polynomials with n coefficients each need n² of those small products, so doubling the size quadruples the work. The fast Fourier transform (FFT) does the same job in about n log n steps, and the same idea lets computers multiply numbers with millions of digits quickly.
How does FFT polynomial multiplication work?
The method rests on a fact you meet in Class 11 algebra: a polynomial of degree less than n is fixed by its values at n distinct points. That is the idea behind Lagrange interpolation through any set of points. So there are two ways to hold a polynomial: its list of coefficients, or its values at enough points.
In value form, multiplication is easy: if A(2) = 5 and B(2) = 7, then C = AB has C(2) = 35, with no cross terms.
The FFT method has three steps:
Evaluate: compute A and B at the n complex nth roots of unity, the solutions of zⁿ = 1.
Multiply pointwise: C(ω) = A(ω) × B(ω) at each root ω.
Interpolate: turn the n values of C back into coefficients with the inverse transform.
Pick n at least the number of coefficients in the product, usually a power of 2; if n is too small, high powers wrap around onto low ones.
A worked example: (1 + 2x)(3 + x) with the 4th roots of unity
The product has degree 2, so it has 3 coefficients. Take n = 4 and the 4th roots of unity 1, i, −1 and −i.
Evaluate A(x) = 1 + 2x and B(x) = 3 + x at each root, then multiply:
At 1: A = 3, B = 4, so C = 12.
At i: A = 1 + 2i, B = 3 + i, so C = 3 + 7i + 2i² = 1 + 7i.
At −1: A = −1, B = 2, so C = −2.
At −i: A = 1 − 2i, B = 3 − i, so C = 1 − 7i.
Now interpolate. With ω = i, the inverse transform gives each coefficient as cₖ = ¼ × the sum over j of C(ωʲ) × ω^(−jk):
c₀ = ¼(12 + (1 + 7i) − 2 + (1 − 7i)) = ¼ × 12 = 3
c₁ = ¼(12 + (1 + 7i)(−i) + 2 + (1 − 7i)(i)) = ¼(12 + 7 − i + 2 + 7 + i) = 7
c₂ = ¼(12 − (1 + 7i) − 2 − (1 − 7i)) = ¼ × 8 = 2
c₃ = ¼(12 + (1 + 7i)(i) + 2 + (1 − 7i)(−i)) = ¼(12 − 7 + i + 2 − 7 − i) = 0
So (1 + 2x)(3 + x) = 3 + 7x + 2x², which you can confirm by expanding. The imaginary parts cancel exactly, as they must when the coefficients are real; the same cancellation powers the roots of unity filter for binomial sums.
Why does evaluating at roots of unity take only O(n log n)?
Evaluating at n arbitrary points costs about n² operations, no better than multiplying directly. Roots of unity are special because they come in pairs ω and −ω whose squares are equal.
Split any polynomial into even and odd powers: A(x) = E(x²) + x × O(x²). For A = 1 + 2x, E = 1 and O = 2. Then:
A(ω) = E(ω²) + ω × O(ω²)
A(−ω) = E(ω²) − ω × O(ω²)
The squares of 1, i, −1 and −i are 1, −1, 1 and −1: only two distinct points, and they are the 2nd roots of unity. So one evaluation at n points becomes two evaluations at n/2 points, plus about n additions and multiplications to combine them. Halving again and again gives log₂ n levels with about n work each. For n = 1,024, n log₂ n is 10,240 while n² is 1,048,576.
James Cooley and John Tukey published this halving algorithm in Mathematics of Computation in 1965. The inverse transform reuses the same trick with ω replaced by 1/ω and a final division by n, which is the ¼ in our example. In matrix language, the same transform diagonalises circulant matrices and turns convolution into multiplication.
How does the FFT multiply huge integers?
An integer is a polynomial evaluated at its base. 21 = 1 + 2 × 10 and 13 = 3 + 10, so 21 × 13 is our product at x = 10: 3 + 70 + 200 = 273. For big numbers, write each as a polynomial in some base, multiply the polynomials with an FFT, then evaluate at the base, carrying any coefficient that exceeds it.
Arnold Schönhage and Volker Strassen built a fast large-integer algorithm on this idea in a 1971 paper in the journal Computing. The GNU Multiple Precision library (GMP) uses a Fermat-style FFT multiplication following Schönhage and Strassen at large sizes, and its manual puts the crossover for full products somewhere between 3,000 and 10,000 limbs, where a limb is one machine word.
In 2021, David Harvey and Joris van der Hoeven published an algorithm that multiplies two n-bit integers in O(n log n) bit operations, confirming a conjecture Schönhage and Strassen made in 1971.
How can you practise FFT multiplication by hand?
Try (1 + x + x²)². The product has 5 coefficients, so you need n = 8, and the 8th roots of unity include (1 + i)/√2.
Draw the n roots on the unit circle and mark where each square lands; you will see the halving.
Check every result at x = 1.
If roots of unity or interpolation still feel shaky, the Fermi Concept Library covers every concept in physics, chemistry, biology, mathematics and computing. When a hand calculation goes wrong, the Fermi Problem Library has a step-by-step solver that explains the reasoning, so you can see which step slipped.
Work the 4-point example once more on paper, then try n = 8 before you write any code.



