Solution (source code)

= Solution

For an <invertible matrix> $P$ whose columns give the new <basis> in old coordinates, the new <matrix> is $B=P^{-1}AP$. Multiplicativity of the <determinant> gives
$$
\det B=\det(P^{-1})\det A\det P=\det A,
$$
since $\det(P^{-1})\det P=1$.

To justify the <cyclic property of the trace> directly, for two <square matrices> $R,S$,
$$
\operatorname{tr}(RS)=\sum_{i,j}R_{ij}S_{ji}
=\sum_{j,i}S_{ji}R_{ij}=\operatorname{tr}(SR).
$$
Apply it with $R=P^{-1}A$ and $S=P$:
$$
\boxed{\det(P^{-1}AP)=\det A,\qquad
\operatorname{tr}(P^{-1}AP)=\operatorname{tr}(PP^{-1}A)=\operatorname{tr}A.}
$$
Thus both the <determinant> and <trace> are invariant under <change of basis>.