> A:=Matrix([[a,b],[c,d]]);
> B:=Matrix([[p,q],[r,s]]);
> B := _rtable[18397620];
> B := _rtable[18397620];
> B;
Find all matrices commuting with
> A.B;
> B.A;
> A.B-B.A;
Ans: All diagonal matrix.
Show that trace of AB = trace of BA
with(linalg);
Warning, the protected names norm and trace have been redefined and unprotected
> trace(A.B);
> trace(B.A);
Show that (AB - BA)(AB - BA) is scalar
> (A.B-B.A)^2;
> expand((b*r-c*q)^2+(a*q+b*s-p*b-q*d)*(c*p+d*r-r*a-s*c)-((a*q+b*s-p*b-q*d)*(c*p+d*r-r*a-s*c)+(c*q-b*r)^2));
> expand((b*r-c*q)*(a*q+b*s-p*b-q*d)+(a*q+b*s-p*b-q*d)*(c*q-b*r));
> expand((c*p+d*r-r*a-s*c)*(b*r-c*q)+(c*q-b*r)*(c*p+d*r-r*a-s*c));
Show that A-1BA can never be diagonal.
> A^(-1).B.A;
> expand((d*p/(a*d-b*c)-b*r/(a*d-b*c))*b+(d*q/(a*d-b*c)-b*s/(a*d-b*c))*d);
Ans: When B = c I , A^(-1)*B*A can be diagonal.
Show that there is no real invertible matrix S with S-1
S triangular.
> A^(-1).B.A;
> expand((d/(a*d-b*c)-b/(a*d-b*c))*b-b*d/(a*d-b*c));
Ans: If S=
, then S(-1)*
*S is triangular .