program works with maxima 5.29.1 but freezes with maxima 5.30.0



>
> The problem isn't expand though, I wouldn't think. It's almost certainly
> operating correctly. I expect that the problem is that what you are
> expanding is huge.
>    
> My *guess* is that something simplified massively when you did the big
> substitution on the previous version of Maxima

It seems that you are right. "expand(factor(test2))"  returns good 
answer while  "expand(test2)"  consumes all available memory.  I just  
added the "factor" command manually. Now everything works as expected, 
so problem solved.

Thank you very much for help.