# How can I add conditions to simplify the result?

Here k is an integer number. How can I simplify the result by adding conditions like k is odd or even?

Also why are the 0^k terms not simplified to 0?

A = {{0, 0, -1}, {0, 0, -1}, {0, 1, -2}};
MatrixFunction[#^k &, A] // FullSimplify // MatrixForm


• Try Simplify[A^k, {Element[k, PositiveIntegers] }] May 11 at 6:48
• MatrixFunction[#^k &, A] // FullSimplify[#, k > 0 && Mod[k, 2] == 0] & // MatrixForm?
– kglr
May 11 at 6:52
• @kglr that Mod is neat May 11 at 7:04
• @kglr Why the restriction Mod[k,2]? A^1 , A^3,...is allowed, I think. May 11 at 7:06
• @UlrichNeumann, Mod[k, 2] == 0 is to add the assumption/condition that k is even. For simplification under the assumption that k is odd, we need Mod[k, 2] ==1.
– kglr
May 11 at 7:10

A = {{0, 0, -1}, {0, 0, -1}, {0, 1, -2}};
`