I have this expression :

1/4 (-Inactive[Cj][j]^2 - 2 Inactive[Cj][j]^3) Inactive[
    SixJSymbol][{j, j, j}, {j, j, j}] - 
 1/2 Inactive[Cj][j] Inactive[triple456][j, j, j, j, j, j]

enter image description here

As you can see, there is a "not simplified" polynomial in front of the SixJSymbol. I would like Mathematica to replace this part with -(1/4) Inactive[Cj][j]^2 (1 + 2 Inactive[Cj][j]), i.e. $((-1/4)Cj^2(1+2*Cj))$.

I could do this manually, but I want to know if it is possible to tell Mathematica something like : "Consider that I have a polynomial expression in SixJSymbol and triple456, I want that you simplify the factors in front of each of those terms". (If I basically do a Simplify here, I will no longer have a "factorisation" by SixJsymbol and triple456).

Is this possible ? If it is, I would like the simplest way to do it.


1 Answer 1


Use Collect with Simplify as the third argument:

expr= 1/4 (-Inactive[Cj][j]^2-2 Inactive[Cj][j]^3) Inactive[SixJSymbol][{j,j,j},{j,j,j}] -
    1/2 Inactive[Cj][j] Inactive[triple456][j,j,j,j,j,j];

    Inactive[SixJSymbol][__] | Inactive[triple456][__],

-(1/4) Inactive[Cj][ j]^2 (1 + 2 Inactive[Cj][j]) Inactive[SixJSymbol][{j, j, j}, {j, j, j}] - 1/2 Inactive[Cj][j] Inactive[triple456][j, j, j, j, j, j]

  • $\begingroup$ Collect is really magic, thanks ! $\endgroup$
    – StarBucK
    Jul 11, 2017 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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