Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Try the following:

z = Exp[2 \[Pi] I / 5]

Z = { { z, 1 }, { 0, 1/z } }

Simplify[MatrixPower[Z, 5]] //MatrixForm

Of course, this should return a 2 x 2 identity matrix. Instead, we get:

{{1, 1 - (-1)^(1/5) + (-1)^(2/5) - (-1)^(3/5) + (-1)^(4/5)}, {0, 1}}

That is, Mathematica doesn't seem to understand that summing these roots of unity gives zero. Is there some way to make it realize this?

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

Try FullSimplify:

m = {{1, (1 - (-1)^(1/5) + (-1)^(2/5) - (-1)^(3/5) + (-1)^(4/5)) b}, {0, 1}};

m // FullSimplify

{{1, 0}, {0, 1}}

Alternatively, for this very specific situation you can use the ExpToTrig function which will convert expressions of the form $(-1)^\alpha$ to $\cos (\pi \alpha )+i \sin (\pi \alpha )$. When written in this form, the terms cancel trivially, thus the simplification is done automatically. ExpToTrig will be a bit faster, in case this matters in your application or you have huge expressions on which FullSimplify is very slow.

ExpToTrig[m]

{{1, 0}, {0, 1}}

share|improve this answer
    
Thanks for the edit! –  István Zachar Jun 4 '12 at 9:33
2  
ComplexExpand also works here. –  Mr.Wizard Jun 4 '12 at 9:42
add comment

As István says, FullSimplify[MatrixPower[Z, 5]], is the usual way to do things when Simplify[] just isn't cutting it. ExpToTrig[]/ComplexExpand[] are very handy in this specific application as well, but if you've already done the work with Simplify[] as with the OP, the only further push needed can be done via RootReduce[]:

Simplify[MatrixPower[Z, 5]]
{{1, 1 - (-1)^(1/5) + (-1)^(2/5) - (-1)^(3/5) + (-1)^(4/5)}, {0, 1}}

RootReduce[%]
{{1, 0}, {0, 1}}
share|improve this answer
    
Thanks! Upvoted both answers; sad I can only accept one. –  Daniel McLaury Jun 4 '12 at 20:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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