# Mathematica doesn't evaluate/simplify arithmetic expression in its output [closed]

I have two matrices, A := {{1, 2, -4}, {2, -2, -2}, {-4, -2, 1}} and V := {{-2/3, 1/Sqrt, -1/(3 Sqrt)}, {-1/3, 0, (2 Sqrt)/3}, {2/3, 1/Sqrt, 1/(3 Sqrt)}}. I was interested in whether Transpose[V].A.V was a diagonal matrix with 6, -3, -3.

However the output I got is the following: When I saw that, I immediately thought I calculated something wrong on paper, but on closer inspection, most of those numbers are a complicated way of writing 0 or -3! In fact, Simplify[%] gives the expected format, and Transpose[V].A.V == DiagonalMatrix[{6, -3, -3}] is True.

Usually such mere numerical expressions are evaluated/simplified, why weren't they now?

• See a simpler example in the help to Dot. I think that behavior is intended. It does not make great inconvenience for users. – user64494 Jun 11 '19 at 18:52
• A simpler example: Sqrt - 1/Sqrt is returned unmodified, and a simplification gives 1/Sqrt. Only a restricted set of ultrafast simplifications is done automatically: for example, 2+3 is auto-simplified to 5. The system designer (WR) has to draw the line somewhere and leave more complex simplifications to the explicit invocation of Simplify or even FullSimplify. Apparently the line is drawn in a way that does not simplify/merge square roots by default. Maybe as computers get more powerful, the line will shift. – Roman Jun 11 '19 at 20:15
• @Roman post as answer please. I was looking for an explanation/confirmation, I know how to call simplify myself – jcora Jun 12 '19 at 17:39

A simpler example:

Sqrt - 1/Sqrt
(*    -(1/Sqrt) + Sqrt    *)


is returned unmodified, and a simplification gives

Simplify[%]
(*    1/Sqrt    *)


Only a restricted set of ultrafast simplifications is done automatically: for example, 2 + 3 is auto-simplified to 5. The system designer (WR) has to draw the line somewhere and leave more complex simplifications to the explicit invocation of Simplify or even FullSimplify. Apparently the line is drawn in a way that does not simplify/merge square roots by default. Maybe as computers get more powerful, the line will shift.

Transpose[V].A.V // FullSimplify
(*{{6, 0, 0}, {0, -3, 0}, {0, 0, -3}}*)