Replace series with restrictions

I am trying to implement a code where I have the following problem: Consider I have the following series, which I can express as follows: $$\sum_{j

I want to express it in such a way because I have the values for $$\sum_j x_j^4$$ and $$\sum_j x_j^8$$.

Of course, I have similar cases like: $$\sum_{j

How can I tell Mathematica to perform this replacements?

• Your second example is not true. – Carl Woll Jun 13 at 14:23
• I believe it is true now. – Alonso Perez Lona Jun 13 at 14:25

It looks like you want to rewrite a generic symmetric polynomial in terms of power sum polynomials. The definition of a power sum polynomial is:

$$p_n = \sum _i x_i^n$$

To do this, I will use the function SymmetricReduction, which works with elementary symmetric polynomials, whose definition is:

$$e_n = \sum _{i_1, i_2, ..., i_n} x_{i_1} x_{i_2} ... x_{i_n}$$

Now, one can define the elementary symmetric polynomials in terms of the power sum polynomials using the Newton-Girard formulas:

e[0] = 1;
e[n_] := Expand[Sum[p[n-k] e[k](-1)^(k+n+1), {k, 0, n-1}]]/n


For example:

e[3]


1/3 (p[1]^3/2 - 3/2 p[1] p[2] + p[3])

We can now use SymmetricReduction. SymmetricReduction needs to use explicit polynomials, that is, the dimensions of the indices have to be specified. I will use a dimension of 4 for your sums. Then, the first example, rewritten using $$z_i = x_i^4$$

SymmetricReduction[
Sum[z[i] z[j], {i, 4}, {j, i-1}],
Array[z, 4],
Array[e, 4]
] //First //Simplify


1/2 (p[1]^2 - p[2])

Since the power sum polynomial p[1] is $$\sum _i x_i^4$$ and p[2] is $$\sum _i x_i^8$$, this agrees with the desired result.

The second example, rewritten using $$z_i = x_i^2$$:

SymmetricReduction[
Sum[z[i] z[j]^3 + z[j] z[i]^3,{i,4}, {j,i-1}],
Array[z, 4],
Array[e, 4]
] //First //Simplify


p[1] p[3] - p[4]

In this case we have p[1] being equivalent to $$\sum _i x_i^2$$, p[3] being equivalent to $$\sum _i x_i^6$$ and p[4] being equivalent to $$\sum _i x_i^8$$, reproducing the desired result.

• What do you mean by "dimensions of the indices"? – Alonso Perez Lona Jun 13 at 17:24
• @AlonsoPerezLona What is the maximum value of the indices $j$ and $k$? – Carl Woll Jun 13 at 17:27
• Oh, I see. Thank you. – Alonso Perez Lona Jun 13 at 17:37