Re: Collecting Positive and Negative Terms

• To: mathgroup at smc.vnet.net
• Subject: [mg112313] Re: Collecting Positive and Negative Terms
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Thu, 9 Sep 2010 04:21:41 -0400 (EDT)

```myExpression = -2 a b^5 c^3 - 5 a b^4 c^4 - 2 a b^3 c^5 -
8 a b^4 c^3 \[Alpha] - 17 a b^3 c^4 \[Alpha] -
5 a b^2 c^5 \[Alpha] - 12 a b^3 c^3 \[Alpha]^2 -
21 a b^2 c^4 \[Alpha]^2 - 4 a b c^5 \[Alpha]^2 -
8 a b^2 c^3 \[Alpha]^3 - 11 a b c^4 \[Alpha]^3 -
2 a b c^3 \[Alpha]^4 - 2 a c^4 \[Alpha]^4 - 4 a b^4 c^3 \[Beta] -
4 a b^3 c^4 \[Beta] - 5 a b^4 c^2 \[Alpha] \[Beta] -
27 a b^3 c^3 \[Alpha] \[Beta] - 15 a b^2 c^4 \[Alpha] \[Beta] -
15 a b^3 c^2 \[Alpha]^2 \[Beta] -
50 a b^2 c^3 \[Alpha]^2 \[Beta] - 16 a b c^4 \[Alpha]^2 \[Beta] -
15 a b^2 c^2 \[Alpha]^3 \[Beta] - 35 a b c^3 \[Alpha]^3 \[Beta] -
5 a c^4 \[Alpha]^3 \[Beta] - 5 a b c^2 \[Alpha]^4 \[Beta] -
8 a c^3 \[Alpha]^4 \[Beta] - 2 a b^3 c^3 \[Beta]^2 -
10 a b^3 c^2 \[Alpha] \[Beta]^2 -
15 a b^2 c^3 \[Alpha] \[Beta]^2 - 4 a b^3 c \[Alpha]^2 \[Beta]^2 -
37 a b^2 c^2 \[Alpha]^2 \[Beta]^2 -
24 a b c^3 \[Alpha]^2 \[Beta]^2 - 8 a b^2 c \[Alpha]^3 \[Beta]^2 -
39 a b c^2 \[Alpha]^3 \[Beta]^2 - 10 a c^3 \[Alpha]^3 \[Beta]^2 -
4 a b c \[Alpha]^4 \[Beta]^2 - 12 a c^2 \[Alpha]^4 \[Beta]^2 -
5 a b^2 c^2 \[Alpha] \[Beta]^3 - 8 a b^2 c \[Alpha]^2 \[Beta]^3 -
16 a b c^2 \[Alpha]^2 \[Beta]^3 - 17 a b c \[Alpha]^3 \[Beta]^3 -
10 a c^2 \[Alpha]^3 \[Beta]^3 - 8 a c \[Alpha]^4 \[Beta]^3 -
4 a b c \[Alpha]^2 \[Beta]^4 - 2 a b \[Alpha]^3 \[Beta]^4 -
5 a c \[Alpha]^3 \[Beta]^4 - 2 a \[Alpha]^4 \[Beta]^4 +
8 a^2 b^4 c^3 Subscript[k, 1] + 8 a^2 b^3 c^4 Subscript[k, 1] +
20 a^2 b^3 c^3 \[Alpha] Subscript[k, 1] +
16 a^2 b^2 c^4 \[Alpha] Subscript[k, 1] +
16 a^2 b^2 c^3 \[Alpha]^2 Subscript[k, 1] +
10 a^2 b c^4 \[Alpha]^2 Subscript[k, 1] +
4 a^2 b c^3 \[Alpha]^3 Subscript[k, 1] +
2 a^2 c^4 \[Alpha]^3 Subscript[k, 1] +
8 a^2 b^3 c^3 \[Beta] Subscript[k, 1] +
16 a^2 b^3 c^2 \[Alpha] \[Beta] Subscript[k, 1] +
32 a^2 b^2 c^3 \[Alpha] \[Beta] Subscript[k, 1] +
26 a^2 b^2 c^2 \[Alpha]^2 \[Beta] Subscript[k, 1] +
30 a^2 b c^3 \[Alpha]^2 \[Beta] Subscript[k, 1] +
10 a^2 b c^2 \[Alpha]^3 \[Beta] Subscript[k, 1] +
8 a^2 c^3 \[Alpha]^3 \[Beta] Subscript[k, 1] +
16 a^2 b^2 c^2 \[Alpha] \[Beta]^2 Subscript[k, 1] +
10 a^2 b^2 c \[Alpha]^2 \[Beta]^2 Subscript[k, 1] +
30 a^2 b c^2 \[Alpha]^2 \[Beta]^2 Subscript[k, 1] +
8 a^2 b c \[Alpha]^3 \[Beta]^2 Subscript[k, 1] +
12 a^2 c^2 \[Alpha]^3 \[Beta]^2 Subscript[k, 1] +
10 a^2 b c \[Alpha]^2 \[Beta]^3 Subscript[k, 1] +
2 a^2 b \[Alpha]^3 \[Beta]^3 Subscript[k, 1] +
8 a^2 c \[Alpha]^3 \[Beta]^3 Subscript[k, 1] +
2 a^2 \[Alpha]^3 \[Beta]^4 Subscript[k, 1] +
a b^3 c^4 \[Gamma] Subscript[k, 2] +
2 a b^2 c^4 \[Alpha] \[Gamma] Subscript[k, 2] +
a b c^4 \[Alpha]^2 \[Gamma] Subscript[k, 2] +
4 a b^3 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[k, 2] +
6 a b^2 c^3 \[Alpha] \[Beta] \[Gamma] Subscript[k, 2] +
10 a b^2 c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 2] +
8 a b c^3 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 2] +
8 a b c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[k, 2] +
2 a c^3 \[Alpha]^3 \[Beta] \[Gamma] Subscript[k, 2] +
2 a c^2 \[Alpha]^4 \[Beta] \[Gamma] Subscript[k, 2] +
4 a b^2 c^2 \[Alpha] \[Beta]^2 \[Gamma] Subscript[k, 2] +
6 a b^2 c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 2] +
13 a b c^2 \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 2] +
10 a b c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[k, 2] +
6 a c^2 \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[k, 2] +
4 a c \[Alpha]^4 \[Beta]^2 \[Gamma] Subscript[k, 2] +
6 a b c \[Alpha]^2 \[Beta]^3 \[Gamma] Subscript[k, 2] +
2 a b \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[k, 2] +
6 a c \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[k, 2] +
2 a \[Alpha]^4 \[Beta]^3 \[Gamma] Subscript[k, 2] +
2 a \[Alpha]^3 \[Beta]^4 \[Gamma] Subscript[k, 2] -
4 a^2 b^3 c^3 \[Gamma] Subscript[k, 1] Subscript[k, 2] -
6 a^2 b^2 c^3 \[Alpha] \[Gamma] Subscript[k, 1] Subscript[k, 2] -
2 a^2 b c^3 \[Alpha]^2 \[Gamma] Subscript[k, 1] Subscript[k, 2] -
10 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[k, 1] Subscript[
k, 2] - 10 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 1]
Subscript[k, 2] -
2 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[k, 1] Subscript[k,
2] - 8 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 1]
Subscript[k, 2] -
4 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[k, 1] Subscript[k,
2] - 2 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[k, 1]
Subscript[k, 2] - 2 a b c \[Alpha]^2 \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(k\), \(2\), \(2\)] +
16 a^2 b^4 c^3 Subscript[S, 1, 0] +
16 a^2 b^3 c^4 Subscript[S, 1, 0] +
40 a^2 b^3 c^3 \[Alpha] Subscript[S, 1, 0] +
32 a^2 b^2 c^4 \[Alpha] Subscript[S, 1, 0] +
32 a^2 b^2 c^3 \[Alpha]^2 Subscript[S, 1, 0] +
20 a^2 b c^4 \[Alpha]^2 Subscript[S, 1, 0] +
8 a^2 b c^3 \[Alpha]^3 Subscript[S, 1, 0] +
4 a^2 c^4 \[Alpha]^3 Subscript[S, 1, 0] +
16 a^2 b^3 c^3 \[Beta] Subscript[S, 1, 0] +
32 a^2 b^3 c^2 \[Alpha] \[Beta] Subscript[S, 1, 0] +
64 a^2 b^2 c^3 \[Alpha] \[Beta] Subscript[S, 1, 0] +
52 a^2 b^2 c^2 \[Alpha]^2 \[Beta] Subscript[S, 1, 0] +
60 a^2 b c^3 \[Alpha]^2 \[Beta] Subscript[S, 1, 0] +
20 a^2 b c^2 \[Alpha]^3 \[Beta] Subscript[S, 1, 0] +
16 a^2 c^3 \[Alpha]^3 \[Beta] Subscript[S, 1, 0] +
32 a^2 b^2 c^2 \[Alpha] \[Beta]^2 Subscript[S, 1, 0] +
20 a^2 b^2 c \[Alpha]^2 \[Beta]^2 Subscript[S, 1, 0] +
60 a^2 b c^2 \[Alpha]^2 \[Beta]^2 Subscript[S, 1, 0] +
16 a^2 b c \[Alpha]^3 \[Beta]^2 Subscript[S, 1, 0] +
24 a^2 c^2 \[Alpha]^3 \[Beta]^2 Subscript[S, 1, 0] +
20 a^2 b c \[Alpha]^2 \[Beta]^3 Subscript[S, 1, 0] +
4 a^2 b \[Alpha]^3 \[Beta]^3 Subscript[S, 1, 0] +
16 a^2 c \[Alpha]^3 \[Beta]^3 Subscript[S, 1, 0] +
4 a^2 \[Alpha]^3 \[Beta]^4 Subscript[S, 1, 0] -
2 a b^3 c^4 \[Gamma] Subscript[S, 1, 0] -
4 a b^2 c^4 \[Alpha] \[Gamma] Subscript[S, 1, 0] -
2 a b c^4 \[Alpha]^2 \[Gamma] Subscript[S, 1, 0] -
8 a b^3 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0] -
12 a b^2 c^3 \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0] -
20 a b^2 c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0] -
16 a b c^3 \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0] -
16 a b c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[S, 1, 0] -
4 a c^3 \[Alpha]^3 \[Beta] \[Gamma] Subscript[S, 1, 0] -
4 a c^2 \[Alpha]^4 \[Beta] \[Gamma] Subscript[S, 1, 0] -
8 a b^2 c^2 \[Alpha] \[Beta]^2 \[Gamma] Subscript[S, 1, 0] -
12 a b^2 c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] -
26 a b c^2 \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] -
20 a b c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] -
12 a c^2 \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] -
8 a c \[Alpha]^4 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] -
12 a b c \[Alpha]^2 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] -
4 a b \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] -
12 a c \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] -
4 a \[Alpha]^4 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] -
4 a \[Alpha]^3 \[Beta]^4 \[Gamma] Subscript[S, 1, 0] +
8 a^2 b^3 c^3 \[Gamma] Subscript[k, 1] Subscript[S, 1, 0] +
12 a^2 b^2 c^3 \[Alpha] \[Gamma] Subscript[k, 1] Subscript[S, 1,
0] + 4 a^2 b c^3 \[Alpha]^2 \[Gamma] Subscript[k, 1] Subscript[S,
1, 0] + 20 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[k, 1]
Subscript[S, 1, 0] +
20 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 1] Subscript[
S, 1, 0] +
4 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[k, 1] Subscript[S,
1, 0] + 16 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 1]
Subscript[S, 1, 0] +
8 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[k, 1] Subscript[S,
1, 0] + 4 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[k, 1]
Subscript[S, 1, 0] -
8 a^2 b^3 c^3 \[Gamma] Subscript[k, 2] Subscript[S, 1, 0] -
12 a^2 b^2 c^3 \[Alpha] \[Gamma] Subscript[k, 2] Subscript[S, 1,
0] - 4 a^2 b c^3 \[Alpha]^2 \[Gamma] Subscript[k, 2] Subscript[S,
1, 0] - 20 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[k, 2]
Subscript[S, 1, 0] -
20 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 2] Subscript[
S, 1, 0] -
4 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[k, 2] Subscript[S,
1, 0] - 16 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 2]
Subscript[S, 1, 0] -
8 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[k, 2] Subscript[S,
1, 0] - 4 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[k, 2]
Subscript[S, 1, 0] +
4 a b^2 c^2 \[Alpha] \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] +
4 a b c^2 \[Alpha]^2 \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] +
8 a b c \[Alpha]^2 \[Beta]^2 \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] +
4 a c \[Alpha]^3 \[Beta]^2 \[Gamma]^2 Subscript[k, 2] Subscript[S,
1, 0] + 4 a \[Alpha]^3 \[Beta]^3 \[Gamma]^2 Subscript[k, 2]
Subscript[S, 1, 0] + 16 a^2 b^3 c^3 \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
24 a^2 b^2 c^3 \[Alpha] \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
8 a^2 b c^3 \[Alpha]^2 \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
40 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
40 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
8 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
32 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
16 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] +
8 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] -
4 a b^2 c^2 \[Alpha] \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] -
4 a b c^2 \[Alpha]^2 \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] -
8 a b c \[Alpha]^2 \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] -
4 a c \[Alpha]^3 \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] -
4 a \[Alpha]^3 \[Beta]^3 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] -
16 a^2 b^4 c^3 Subscript[S, 1, tot] -
16 a^2 b^3 c^4 Subscript[S, 1, tot] -
40 a^2 b^3 c^3 \[Alpha] Subscript[S, 1, tot] -
32 a^2 b^2 c^4 \[Alpha] Subscript[S, 1, tot] -
32 a^2 b^2 c^3 \[Alpha]^2 Subscript[S, 1, tot] -
20 a^2 b c^4 \[Alpha]^2 Subscript[S, 1, tot] -
8 a^2 b c^3 \[Alpha]^3 Subscript[S, 1, tot] -
4 a^2 c^4 \[Alpha]^3 Subscript[S, 1, tot] -
16 a^2 b^3 c^3 \[Beta] Subscript[S, 1, tot] -
32 a^2 b^3 c^2 \[Alpha] \[Beta] Subscript[S, 1, tot] -
64 a^2 b^2 c^3 \[Alpha] \[Beta] Subscript[S, 1, tot] -
52 a^2 b^2 c^2 \[Alpha]^2 \[Beta] Subscript[S, 1, tot] -
60 a^2 b c^3 \[Alpha]^2 \[Beta] Subscript[S, 1, tot] -
20 a^2 b c^2 \[Alpha]^3 \[Beta] Subscript[S, 1, tot] -
16 a^2 c^3 \[Alpha]^3 \[Beta] Subscript[S, 1, tot] -
32 a^2 b^2 c^2 \[Alpha] \[Beta]^2 Subscript[S, 1, tot] -
20 a^2 b^2 c \[Alpha]^2 \[Beta]^2 Subscript[S, 1, tot] -
60 a^2 b c^2 \[Alpha]^2 \[Beta]^2 Subscript[S, 1, tot] -
16 a^2 b c \[Alpha]^3 \[Beta]^2 Subscript[S, 1, tot] -
24 a^2 c^2 \[Alpha]^3 \[Beta]^2 Subscript[S, 1, tot] -
20 a^2 b c \[Alpha]^2 \[Beta]^3 Subscript[S, 1, tot] -
4 a^2 b \[Alpha]^3 \[Beta]^3 Subscript[S, 1, tot] -
16 a^2 c \[Alpha]^3 \[Beta]^3 Subscript[S, 1, tot] -
4 a^2 \[Alpha]^3 \[Beta]^4 Subscript[S, 1, tot] +
8 a^2 b^3 c^3 \[Gamma] Subscript[k, 2] Subscript[S, 1, tot] +
12 a^2 b^2 c^3 \[Alpha] \[Gamma] Subscript[k, 2] Subscript[S, 1,
tot] + 4 a^2 b c^3 \[Alpha]^2 \[Gamma] Subscript[k, 2] Subscript[
S, 1, tot] +
20 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[k, 2] Subscript[
S, 1, tot] +
20 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 2] Subscript[
S, 1, tot] +
4 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[k, 2] Subscript[S,
1, tot] +
16 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 2] Subscript[
S, 1, tot] +
8 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[k, 2] Subscript[S,
1, tot] +
4 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[k, 2] Subscript[S, 1,
tot] - 16 a^2 b^3 c^3 \[Gamma] Subscript[S, 1, 0] Subscript[S, 1,
tot] - 24 a^2 b^2 c^3 \[Alpha] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, tot] -
8 a^2 b c^3 \[Alpha]^2 \[Gamma] Subscript[S, 1, 0] Subscript[S, 1,
tot] - 40 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, tot] -
40 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, tot] -
8 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[
S, 1, tot] -
32 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, tot] -
16 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, tot] -
8 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] Subscript[S,
1, tot] + 16 a^3 b^4 c^2 Subscript[S, 1, 1] Subscript[S, 2, 0] +
32 a^3 b^3 c^3 Subscript[S, 1, 1] Subscript[S, 2, 0] +
16 a^3 b^2 c^4 Subscript[S, 1, 1] Subscript[S, 2, 0] +
24 a^3 b^3 c^2 \[Alpha] Subscript[S, 1, 1] Subscript[S, 2, 0] +
40 a^3 b^2 c^3 \[Alpha] Subscript[S, 1, 1] Subscript[S, 2, 0] +
16 a^3 b c^4 \[Alpha] Subscript[S, 1, 1] Subscript[S, 2, 0] +
8 a^3 b^2 c^2 \[Alpha]^2 Subscript[S, 1, 1] Subscript[S, 2, 0] +
12 a^3 b c^3 \[Alpha]^2 Subscript[S, 1, 1] Subscript[S, 2, 0] +
4 a^3 c^4 \[Alpha]^2 Subscript[S, 1, 1] Subscript[S, 2, 0] +
32 a^3 b^3 c^2 \[Beta] Subscript[S, 1, 1] Subscript[S, 2, 0] +
32 a^3 b^2 c^3 \[Beta] Subscript[S, 1, 1] Subscript[S, 2, 0] +
16 a^3 b^3 c \[Alpha] \[Beta] Subscript[S, 1, 1] Subscript[S, 2,
0] + 72 a^3 b^2 c^2 \[Alpha] \[Beta] Subscript[S, 1, 1] Subscript[
S, 2, 0] +
48 a^3 b c^3 \[Alpha] \[Beta] Subscript[S, 1, 1] Subscript[S, 2,
0] + 12 a^3 b^2 c \[Alpha]^2 \[Beta] Subscript[S, 1, 1] Subscript[
S, 2, 0] +
32 a^3 b c^2 \[Alpha]^2 \[Beta] Subscript[S, 1, 1] Subscript[S, 2,
0] + 16 a^3 c^3 \[Alpha]^2 \[Beta] Subscript[S, 1, 1] Subscript[S,
2, 0] +
16 a^3 b^2 c^2 \[Beta]^2 Subscript[S, 1, 1] Subscript[S, 2, 0] +
32 a^3 b^2 c \[Alpha] \[Beta]^2 Subscript[S, 1, 1] Subscript[S, 2,
0] + 48 a^3 b c^2 \[Alpha] \[Beta]^2 Subscript[S, 1, 1] Subscript[
S, 2, 0] +
4 a^3 b^2 \[Alpha]^2 \[Beta]^2 Subscript[S, 1, 1] Subscript[S, 2,
0] + 28 a^3 b c \[Alpha]^2 \[Beta]^2 Subscript[S, 1, 1] Subscript[
S, 2, 0] +
24 a^3 c^2 \[Alpha]^2 \[Beta]^2 Subscript[S, 1, 1] Subscript[S, 2,
0] + 16 a^3 b c \[Alpha] \[Beta]^3 Subscript[S, 1, 1] Subscript[S,
2, 0] +
8 a^3 b \[Alpha]^2 \[Beta]^3 Subscript[S, 1, 1] Subscript[S, 2,
0] + 16 a^3 c \[Alpha]^2 \[Beta]^3 Subscript[S, 1, 1] Subscript[S,
2, 0] +
4 a^3 \[Alpha]^2 \[Beta]^4 Subscript[S, 1, 1] Subscript[S, 2, 0] -
8 a^3 b^3 c^2 \[Gamma] Subscript[k, 2] Subscript[S, 1, 1]
Subscript[S, 2, 0] -
8 a^3 b^2 c^3 \[Gamma] Subscript[k, 2] Subscript[S, 1, 1]
Subscript[S, 2, 0] -
4 a^3 b^2 c^2 \[Alpha] \[Gamma] Subscript[k, 2] Subscript[S, 1, 1]
Subscript[S, 2, 0] -
4 a^3 b c^3 \[Alpha] \[Gamma] Subscript[k, 2] Subscript[S, 1, 1]
Subscript[S, 2, 0] -
8 a^3 b^2 c^2 \[Beta] \[Gamma] Subscript[k, 2] Subscript[S, 1, 1]
Subscript[S, 2, 0] -
12 a^3 b^2 c \[Alpha] \[Beta] \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
16 a^3 b c^2 \[Alpha] \[Beta] \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
4 a^3 b c \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
4 a^3 c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
12 a^3 b c \[Alpha] \[Beta]^2 \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
4 a^3 b \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
8 a^3 c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[k, 2] Subscript[S,
1, 1] Subscript[S, 2, 0] -
4 a^3 \[Alpha]^2 \[Beta]^3 \[Gamma] Subscript[k, 2] Subscript[S, 1,
1] Subscript[S, 2, 0] +
16 a^3 b^3 c^2 \[Gamma] Subscript[S, 1, 0] Subscript[S, 1, 1]
Subscript[S, 2, 0] +
16 a^3 b^2 c^3 \[Gamma] Subscript[S, 1, 0] Subscript[S, 1, 1]
Subscript[S, 2, 0] +
8 a^3 b^2 c^2 \[Alpha] \[Gamma] Subscript[S, 1, 0] Subscript[S, 1,
1] Subscript[S, 2, 0] +
8 a^3 b c^3 \[Alpha] \[Gamma] Subscript[S, 1, 0] Subscript[S, 1, 1]
Subscript[S, 2, 0] +
16 a^3 b^2 c^2 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[S, 1,
1] Subscript[S, 2, 0] +
24 a^3 b^2 c \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, 1] Subscript[S, 2, 0] +
32 a^3 b c^2 \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, 1] Subscript[S, 2, 0] +
8 a^3 b c \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[
S, 1, 1] Subscript[S, 2, 0] +
8 a^3 c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[
S, 1, 1] Subscript[S, 2, 0] +
24 a^3 b c \[Alpha] \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, 1] Subscript[S, 2, 0] +
8 a^3 b \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] Subscript[
S, 1, 1] Subscript[S, 2, 0] +
16 a^3 c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 1, 1] Subscript[S, 2, 0] +
8 a^3 \[Alpha]^2 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] Subscript[S,
1, 1] Subscript[S, 2, 0] +
16 a^2 b^4 c^2 \[Gamma] Subscript[S, 1, 0] Subscript[S, 2, 1] +
16 a^2 b^3 c^3 \[Gamma] Subscript[S, 1, 0] Subscript[S, 2, 1] +
40 a^2 b^3 c^2 \[Alpha] \[Gamma] Subscript[S, 1, 0] Subscript[S, 2,
1] + 32 a^2 b^2 c^3 \[Alpha] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
32 a^2 b^2 c^2 \[Alpha]^2 \[Gamma] Subscript[S, 1, 0] Subscript[S,
2, 1] + 20 a^2 b c^3 \[Alpha]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
8 a^2 b c^2 \[Alpha]^3 \[Gamma] Subscript[S, 1, 0] Subscript[S, 2,
1] + 4 a^2 c^3 \[Alpha]^3 \[Gamma] Subscript[S, 1, 0] Subscript[S,
2, 1] +
32 a^2 b^3 c^2 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[S, 2,
1] + 16 a^2 b^2 c^3 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[
S, 2, 1] +
16 a^2 b^3 c \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
72 a^2 b^2 c^2 \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
16 a^2 b c^3 \[Alpha] \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
28 a^2 b^2 c \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
52 a^2 b c^2 \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
4 a^2 c^3 \[Alpha]^2 \[Beta] \[Gamma] Subscript[S, 1, 0] Subscript[
S, 2, 1] +
12 a^2 b c \[Alpha]^3 \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
12 a^2 c^2 \[Alpha]^3 \[Beta] \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
16 a^2 b^2 c^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] Subscript[S,
2, 1] + 32 a^2 b^2 c \[Alpha] \[Beta]^2 \[Gamma] Subscript[S, 1,
0] Subscript[S, 2, 1] +
32 a^2 b c^2 \[Alpha] \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
4 a^2 b^2 \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
40 a^2 b c \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
12 a^2 c^2 \[Alpha]^2 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
4 a^2 b \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[S, 1, 0] Subscript[
S, 2, 1] +
12 a^2 c \[Alpha]^3 \[Beta]^2 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
16 a^2 b c \[Alpha] \[Beta]^3 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
8 a^2 b \[Alpha]^2 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] Subscript[
S, 2, 1] +
12 a^2 c \[Alpha]^2 \[Beta]^3 \[Gamma] Subscript[S, 1, 0]
Subscript[S, 2, 1] +
4 a^2 \[Alpha]^3 \[Beta]^3 \[Gamma] Subscript[S, 1, 0] Subscript[S,
2, 1] +
4 a^2 \[Alpha]^2 \[Beta]^4 \[Gamma] Subscript[S, 1, 0] Subscript[S,
2, 1] -
8 a^2 b^3 c^2 \[Gamma]^2 Subscript[k, 2] Subscript[S, 1, 0]
Subscript[S, 2, 1] -
12 a^2 b^2 c^2 \[Alpha] \[Gamma]^2 Subscript[k, 2] Subscript[S, 1,
0] Subscript[S, 2, 1] -
4 a^2 b c^2 \[Alpha]^2 \[Gamma]^2 Subscript[k, 2] Subscript[S, 1,
0] Subscript[S, 2, 1] -
8 a^2 b^2 c^2 \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[S, 1, 0]
Subscript[S, 2, 1] -
12 a^2 b^2 c \[Alpha] \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] Subscript[S, 2, 1] -
4 a^2 b c^2 \[Alpha] \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] Subscript[S, 2, 1] -
16 a^2 b c \[Alpha]^2 \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] Subscript[S, 2, 1] -
4 a^2 c \[Alpha]^3 \[Beta] \[Gamma]^2 Subscript[k, 2] Subscript[S,
1, 0] Subscript[S, 2, 1] -
12 a^2 b c \[Alpha] \[Beta]^2 \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] Subscript[S, 2, 1] -
4 a^2 b \[Alpha]^2 \[Beta]^2 \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] Subscript[S, 2, 1] -
4 a^2 c \[Alpha]^2 \[Beta]^2 \[Gamma]^2 Subscript[k, 2] Subscript[
S, 1, 0] Subscript[S, 2, 1] -
4 a^2 \[Alpha]^3 \[Beta]^2 \[Gamma]^2 Subscript[k, 2] Subscript[S,
1, 0] Subscript[S, 2, 1] -
4 a^2 \[Alpha]^2 \[Beta]^3 \[Gamma]^2 Subscript[k, 2] Subscript[S,
1, 0] Subscript[S, 2, 1] + 16 a^2 b^3 c^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
24 a^2 b^2 c^2 \[Alpha] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 b c^2 \[Alpha]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
16 a^2 b^2 c^2 \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
24 a^2 b^2 c \[Alpha] \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 b c^2 \[Alpha] \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
32 a^2 b c \[Alpha]^2 \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 c \[Alpha]^3 \[Beta] \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
24 a^2 b c \[Alpha] \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 b \[Alpha]^2 \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 c \[Alpha]^2 \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 \[Alpha]^3 \[Beta]^2 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1] +
8 a^2 \[Alpha]^2 \[Beta]^3 \[Gamma]^2 \!
\*SubsuperscriptBox[\(S\), \(1, 0\), \(2\)] Subscript[S, 2, 1];

expr2 = DeleteCases[myExpression, Times[_Integer?Negative, ___]];

Length[expr2]

185

expr3 = Cases[
myExpression, _?Positive | _Symbol | Times[_?Positive, ___]];

Length[expr3]

183

expr2 - Total[expr3]

a b^3 c^4 Subscript[k, 2] \[Gamma]+a b c^4 Subscript[k, 2] \[Alpha]^2 \[Gamma]

Bob Hanlon

---- Michael Knudsen <micknudsen at gmail.com> wrote:

=============
On Aug 14, 12:32 pm, Albert Retey <a... at gmx-topmail.de> wrote:

> Cases[expr, _?Positive | _Symbol | Times[_?Positive, ___]]

This may, in fact, be the solution. Thanks for pointing my attention
the the subtleties of pattern matching in Mathematica!

--
Michael Knudsen

--

Bob Hanlon

```

• Prev by Date: Re: notebooks default context
• Next by Date: LinearModelFit
• Previous by thread: Re: Collecting Positive and Negative Terms
• Next by thread: Re: Collecting Positive and Negative Terms