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

Solution 1:

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 $$

Solution 2:

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.

Solution 3:

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

Solution 4:

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

Sym = SymmetricFunction(QQ)
e = Sym.elementary()
f = Sym.from_polynomial(p)
e(f)