# Symmetric polynomials in Maple?

## Main Question or Discussion Point

Does anyone know if it possible to generate elementary symmetric polynomials in Maple (I am using version 12), and if so, how?

I have scoured all the help files, and indeed the whole internet, but the only thing I have found is a reference to a command "symmpoly", which was apparently included in earlier versions, but does not seem to be available now.

Why would they delete this capability? Surely there must be a way to do this...any help much appreciated!

## Answers and Replies

symmpoly is not what you want. It was introduced in 4.0, and removed in 4.3. Currently that feature is PolynomialTools[IsSelfReciprocal] ... since "self-reciprocal" is a better term than "symmetric" to describe polynomials like 2*x^3-4*x^2-4*x+2 . But it is not about elementary symmetric functions.

Why didn't they include it? I don't know. Maybe because it is easy to do yourself...

(-1)^k*coeff(expand((X-a)*(X-b)*(X-c)*(X-d)),X,4-k):

for example

(-1)^3*coeff(expand((X-a)*(X-b)*(X-c)*(X-d)),X,4-3);
b c d + a c d + a b d + a b c

Thanks for the reply. I disagree it is easier to do it yourself than use a pre-programmed routine! However you're right that it is easy...I was just being lazy. In the end I gave up looking and did it like this (for elementary symmetric polynomials in the variables yi)

symmpoly:=proc(m,n);
S:={};
for i from 1 to m do
S:=S union {y};
od;
for k from 1 to n do
Tk:=choose(S,k);
s[k]:=sum(product(Tk[j],j=1..k),i=1..nops(Tk));
od;
end proc;

A bit more complicated than your version! I hadn't thought of utilizing the neat factorization.

Anyway, this was a good lesson for me: often it is much quicker to do something for yourself than to search for a quick a fix on google...

LCKurtz
Homework Helper
Gold Member
Here's mine

P := proc (n, k)

(-1)^(n+k)*coeff(collect(expand(product(x-a, i = 1 .. n)), x), x, k)

end proc;

This gives the symmetric polynomials for degree n, k = 0 .. n-1