How this calculation works
Rewrite a symmetric rational polynomial using the elementary symmetric polynomials. The calculation first checks invariance under variable swaps, then eliminates leading monomials with products of the elementary generators. Exact reconstruction connects the compact answer to the original terms.
e_k=Σ_(i1<⋯<ik) x_i1⋯x_ik. If leading exponents are λ1≥⋯≥λn, subtract c e1^(λ1−λ2) e2^(λ2−λ3)⋯en^λn.A worked example
For x²+y²+z², e1=x+y+z and e2=xy+xz+yz. Expanding e1² gives x²+y²+z²+2xy+2xz+2yz, so the rewrite is e1²−2e2 and substitution leaves zero remainder.
Good to know
Rational polynomial in2–4 named-by-position variables; nonnegative integer exponents, total degree≤10. Exact adjacent-swap symmetry check; bounded200000 term multiplication and5000 rewrite steps. Reject nonsymmetric inputs rather than returning an unexplained symmetric part.
Reference: SymPy official implementation and symmetrize contract (opens in a new tab) ↗
Symmetry means invariance under every permutation
A polynomial is symmetric when permuting its variables leaves its coefficients unchanged. The tool verifies adjacent transpositions, which generate the full symmetric group, so these finite checks establish invariance under every permutation.
Variable positions remain distinct during this check. Equal numeric values substituted for two variables can conceal a nonsymmetric expression; symmetry is a polynomial identity, not an observation that happens to hold at one chosen point.
Compare this with the Schur function product calculator with Littlewood Richardson coefficients. Existing Schur multiplication explicitly excludes general symmetric-basis conversion.
The elementary generators
For n variables, e1 is their sum, e2 is the sum of pairwise products, and en is their full product. Every symmetric polynomial over Q has a unique polynomial expression in e1 through en.
The generators carry different original-variable degrees: ek has degree k. A compact expression such as e1²−2e2 is homogeneous of weighted degree two even though its ordinary degree as a polynomial in the e symbols is not uniform.
A constructive elimination rule
Order monomials lexicographically. The leading exponent tuple of a symmetric polynomial is weakly decreasing, say λ1≥⋯≥λn. The product e1^(λ1−λ2)⋯en^λn has exactly that leading monomial with coefficient one.
Subtract the leading coefficient times this product and repeat. Each step removes the current leading term, giving a constructive proof of the rewrite rather than guessing from sample values. Exact coefficient arithmetic keeps cancellation reliable.
Checking the reconstructed identity
Substitute the explicit elementary polynomials back into the output and expand. The difference from the original polynomial must have zero coefficients everywhere, which is stronger than matching at a collection of numeric points.
The research kernel cancels this remainder during elimination and exposes it as a certificate. An app integration may additionally display the generator definitions so readers can verify the identity by hand without learning the internal term-map representation.
The sum of three squares example
Expanding (x+y+z)² gives the three squares plus twice every pair product. Subtracting 2(xy+xz+yz) leaves exactly x²+y²+z², so the answer is e1²−2e2.
The coefficient two is essential: using e1²−e2 would retain one copy of every pair product. This small example provides both a default input and an easily checked demonstration of why elementary generators encode cross terms.
When a polynomial fails the symmetry check
For example x²+y is not invariant under exchanging x and y. It has no exact expression purely in e1 and e2, so the correct output is a clear nonsymmetry error.
Some computer algebra functions return a symmetric part plus a remainder for general polynomials. This page intentionally solves the narrower identity problem and rejects nonsymmetric input rather than presenting a partial decomposition as a completed rewrite.
Bounds, uniqueness and related bases
The limit of four variables and degree ten keeps sparse products and coefficient growth manageable. A term or step cap raises an unsupported-input error; it never authorizes dropping terms or rounding small rational coefficients to zero.
SymPy symmetrize supplies an independent reconstruction check for the fixtures. Schur, monomial and power-sum bases are useful elsewhere, but this page fixes elementary generators and does not imply a general converter between every symmetric-function basis.
A few questions, answered
Can every polynomial be rewritten using only e1 through en?
Only symmetric polynomials. A nonsymmetric polynomial requires additional information or a remainder.
Is the expression unique?
Yes, as a polynomial in the elementary generators over Q for the fixed number of variables.
Why is the output degree sometimes smaller?
The generators have weights: ek has original-variable degree k. Weighted degree preserves the original polynomial degree.
Can I test symmetry by evaluating at random points?
Numeric sampling can find counterexamples but is not an exact identity proof. This tool compares rational coefficients under generating swaps.