# Symmetric function of the roots of a polynomial

First, I'm a beginner.

I can compute the sum of roots with the follwing:

Roots[x^7 + 5 x^6 + x^5 + x + 1 == 0, x]
Plus @@ (x /. {ToRules[%]}) // Simplify


Of course I get, except the sign, the coefficient of x^6.

Now, is there a way to compute more elaborate symmetric functions, for example the sum of xi/xj for all i,j ?

• f[k_] := Root[Function[x, x^7 + 5 x^6 + x^5 + x + 1], k]; Sum[f[i]/f[j], {i, 7}, {j, 7}] ? – Szabolcs May 18 '14 at 19:48
• Also take a look at Outer. – Szabolcs May 18 '14 at 19:50
• Thanks. In some way, it works, but Mma does not seem to be able to simplify this (well, at least with Simplify). Is there a way to resort directly to polynomial coefficients? I know how to do that by hand, but I wonder if there is an easy way to automate this. – user10957 May 18 '14 at 19:58
• I don't understand what you mean by "resort directly to polynomial coefficients". Do you just not want to see Root objects? BTW take a look at RootSum too. – Szabolcs May 18 '14 at 20:07
• I'm not really interested by root objects, but by the actual result. Any symmetric polynomial (or rational function) of the roots can be computed from the elementary symmetric polynomials, hence from the polynomial coefficients. For example, the sum in your first comment has value exactly 5 (you can check with N), but Simplify does not work. So my question is: is there a way to simplify such symmetric rational functions in Mathematica? – user10957 May 18 '14 at 20:37

## 2 Answers

It is not clear if this is what you were asking, but it might help: from the link to https://en.wikipedia.org/wiki/Elementary_symmetric_polynomial we extract

Product[\[Lambda]+Subscript[x, k],{k,7}]==Sum[\[Lambda]^k ee[7-k,7],{k,0,7}]


with

 ee[k_,n_]:=SymmetricPolynomial[k, Thread[Subscript[x, Range[n]]]]


Now, with your definitions:

(x/.{ToRules[Roots[x^7+5 x^6+x^5+x+1==0,x]]})//Simplify ;
ru = Thread[Thread[Subscript[x, Range]] -> %];
Sum[\[Lambda]^k ee[7 - k, 7], {k, 0, 7}]/. ru // FullSimplify


returns (* -1+[Lambda]+[Lambda]^5-5 [Lambda]^6+[Lambda]^7 *)

The mathematics of this are obviously clear to you, maybe you had not yet located the function 'SymmetricPolynomial'?

• I admit I have yet to learn most of Mathematica. Though I have already found many equivalents of what I did with Maxima, it's just the beginning! :-) – user10957 May 20 '14 at 6:11

You might compute the defining polynomial for the root quotients directly. Since you are interested in root quotients x/y, call the result z and we have x-y*z as a new polynomial relation. Now use iterated resultants to eliminate x and y.

res =
Resultant[Resultant[x^7 + 5 x^6 + x^5 + x + 1, x - y*z, x],
y^7 + 5 y^6 + y^5 + y + 1, y]

(* Out= 1 - 5 z + z^2 - 2525 z^5 + 60994 z^6 - 70555 z^7 +
12038 z^8 - 261 z^9 + 930 z^10 - 50760 z^11 - 167510 z^12 +
224509 z^13 - 5732 z^14 + 7071 z^15 + 36884 z^16 + 26408 z^17 +
391806 z^18 - 417131 z^19 - 55251 z^20 - 42118 z^21 + 80948 z^22 -
122338 z^23 - 498110 z^24 + 498110 z^25 + 122338 z^26 - 80948 z^27 +
42118 z^28 + 55251 z^29 + 417131 z^30 - 391806 z^31 - 26408 z^32 -
36884 z^33 - 7071 z^34 + 5732 z^35 - 224509 z^36 + 167510 z^37 +
50760 z^38 - 930 z^39 + 261 z^40 - 12038 z^41 + 70555 z^42 -
60994 z^43 + 2525 z^44 - z^47 + 5 z^48 - z^49 *)