Today’s tip is very useful, and we should thank Simon King for it.
Suppose we are trying to prove that, the matrix, ,
sage: M = matrix([[sin(x), cos(x)],[-cos(x),sin(x)]])
belongs to the orthogonal group, i.e., .
sage: E = M*M.transpose()
For simplifying the matrix, unfortunately, one should simplify each element, it’s done with the following line,
sage: E.apply_map(lambda x: x.simplify_full())