If x is -1, then the eigenvalues returned by MuPAD are -1, 2, 1, 0. The eigenvalues you expected are 1, 0, -1, 2 (assuming you meant |x|+1 as your last expression.) They're the same, just in a different order.
More generally, since both |x| and -|x| are eigenvalues in your list of expected eigenvalues and you told MuPAD it can assume x is real, that's the same as including x and -x in the list of eigenvalues. They'll just be listed in a different order if x is negative. Similarly for real x, 1-|x| and 1+|x| are the same as 1-x and 1+x, just in a different order if x is negative.
Now if you assumed x was Type::Complex, and called:
simplify(linalg::eigenvalues(M))
then the sets {|x|, -|x|} and {x, -x} are NOT necessarily the same but in a different order. In that case, MuPAD knows it cannot eliminate the absolute value signs, and indeed when I make that modification to your assume call the results do include the absolute value signs.
Best Answer