5
$\begingroup$

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?

$\endgroup$
11
$\begingroup$

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}}

$\endgroup$
  • 2
    $\begingroup$ ComplexExpand also works here. $\endgroup$ – Mr.Wizard Jun 4 '12 at 9:42
5
$\begingroup$

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}}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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