# Expressing a symmetric polynomial in terms of elementary symmetric polynomials using computer?

Are there any computer algebra systems with the functionality to allow me to enter in an explicit symmetric polynomial and have it return that polynomial in terms of the elementary symmetric polynomials? Can I do this in sage? How do I do it? Thank you.

-
ask.sagemath.org – Andrés E. Caicedo Feb 13 '12 at 18:56
I asked the same question here: ask.sagemath.org/question/32569/… – Giovanni Mascellani Feb 16 at 16:10

In Maple, it's

convert(..., elsymfun);

For example:

convert((x^2+y+z)(y^2+x+z)(z^2+x+y),elsymfun);

$$\left( x+y+z \right) ^{4}-3\, \left( x+y+z \right) ^{2} \left( xz+xy+ yz \right) -2\, \left( x+y+z \right) ^{2}xyz+ \left( x+y+z \right) \left( xz+xy+yz \right) ^{2}+ \left( x+y+z \right) \left( xz+xy+yz \right) +4\, \left( x+y+z \right) xyz- \left( xz+xy+yz \right) xyz+{x }^{2}{y}^{2}{z}^{2}-xyz$$

-

There is an algorithm (due to Gauss) that is so simple that it can be executed by hand (or easily programmed). It is a special case of Gröbner basis reduction techniques (the first known use of lexicographic order in term rewriting). For details and references see this post.

-

In Sage, if $p$ is the polynomial to convert

Sym = SymmetricFunction(QQ)
e = Sym.elementary()
f = Sym.from_polynomial(p)
e(f)
-
This does not really give you what is asked by OP: this expresses $p$ as the linear combination of what is called elementary function here: mathworld.wolfram.com/SymmetricPolynomial.html. Instead the OP asked (and I would like to know as well) to express $p$ as a polynomial in what is called elementary symmetric polynomials in the same article (a much smaller subset of the elementary functions, that does not generates the space of symmetric polynomials as a vector space, but it does as an algebra). – Giovanni Mascellani Feb 16 at 15:49

Mathematica is certainly able to do this, with judicious use of the functions SymmetricReduction[] and SymmetricPolynomial[]. (As already noted in the post linked to by Math Gems, Cox/Little/O'Shea have a description of the algorithm for performing such a reduction.)

To use the same example as Robert:

SymmetricReduction[(x^2 + y + z)(y^2 + x + z)(z^2 + x + y),
{x, y, z}, C /@ Range[3]] // First
C[1]^4+C[1] C[2]-3C[1]^2 C[2]+C[1] C[2]^2-C[3]+4C[1] C[3]-
2C[1]^2 C[3]-C[2] C[3]+C[3]^2

Here, C[1], C[2], C[3] stand-in for $\sigma_1, \sigma_2, \sigma_3$. The First[] is needed to return only the "symmetric part" of the multivariate polynomial, since SymmetricReduction[] is equipped to return both the symmetric part and the remainder of a multivariate polynomial.

If one wants an explicit expression involving only the variables, one can omit the third argument:

SymmetricReduction[(x^2 + y + z) (y^2 + x + z) (z^2 + x + y),
{x, y, z}] // First
-x y z + x^2 y^2 z^2 + 4 x y z (x + y + z) - 2 x y z (x + y + z)^2 +
(x + y + z)^4 - x y z(x y + x z + y z) + (x + y + z)(x y + x z + y z) -
3 (x + y + z)^2 (x y + x z + y z) + (x + y + z) (x y + x z + y z)^2
-