1
$\begingroup$

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<k} x_j^4 x_k^4 = \frac{(\sum_j x_j^4)^2 - \sum_jx_j^8}{2}$$

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<k} (x_j^2x_k^6+x_j^6x_k^2)=\left(\sum_j x_j^2\right)\left(\sum_k x_k^6\right)-\sum_j x_j^8$$

How can I tell Mathematica to perform this replacements?

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

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.