2
$\begingroup$

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

Enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ Try Simplify[A^k, {Element[k, PositiveIntegers] }] $\endgroup$ Commented May 11, 2021 at 6:48
  • 2
    $\begingroup$ MatrixFunction[#^k &, A] // FullSimplify[#, k > 0 && Mod[k, 2] == 0] & // MatrixForm? $\endgroup$
    – kglr
    Commented May 11, 2021 at 6:52
  • $\begingroup$ @kglr that Mod is neat $\endgroup$
    – emnha
    Commented May 11, 2021 at 7:04
  • $\begingroup$ @kglr Why the restriction Mod[k,2]? A^1 , A^3,...is allowed, I think. $\endgroup$ Commented May 11, 2021 at 7:06
  • $\begingroup$ @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`. $\endgroup$
    – kglr
    Commented May 11, 2021 at 7:10

1 Answer 1

4
$\begingroup$

You can get some simplification by assuming k>0

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

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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