how to handle roots of unity symbolically ?



 
> this simplifies some expressions, but fails with others, for example:
> when w^6=1 , w^2-w+1 is not simplified, when 0 was expected...

I believe your test case is wrong:
Consider w=1 is a solution of w^6=1, but 1^2-1+1 = 1 not 0 as you
seem to expect...

HTH,
Harald