Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Calculate the log of an elementary symmetric polynomial
ResourceFunction["LogSymmetricPolynomial"][k,{x1,…,xn}] gives the log of the elementary symmetric polynomial of degree k in the variables x1,…,xn. |
The log of the elementary symmetric polynomial of degree 3 in the 5 variables 0.1, 0.7, 0.2, 4, 6:
| In[1]:= | ![]() |
| Out[3]= |
Obtain the same result with SymmetricPolynomial:
| In[4]:= |
| Out[4]= |
SymmetricPolynomial does not work for k large:
| In[5]:= | ![]() |
| Out[8]= | ![]() |
LogSymmetricPolynomial still works for this case:
| In[9]:= |
| Out[9]= |
The log of a symmetric polynomial can also be computed directly using Vieta's formulas and numeric input:
| In[10]:= | ![]() |
This calculation gives the same result as LogSymmetricPolynomial, but can be notably slower:
| In[11]:= | ![]() |
| Out[14]= |
The variables xi should be positive:
| In[15]:= |
| Out[15]= |
The variables xi should be numeric:
| In[16]:= |
| Out[17]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License