Solution (source code)

= Solution

Adding the diagonal entries gives $\operatorname{tr}A=4+4+2=10$. Expansion along the first row gives $\det A=4(8-4)+2(0-8)=0$. For the remaining <trace>, direct <matrix multiplication> gives
$$
A^2=\begin{pmatrix}20&4&12\\4&20&12\\12&12&12\end{pmatrix}.
$$
Thus $\operatorname{tr}(A^2)=20+20+12=52$. By <multiplicativity of the determinant>, $\det(A^2)=(\det A)^2=0$. Altogether,
$$
\boxed{\operatorname{tr}A=10,\qquad\det A=0,\qquad\operatorname{tr}(A^2)=52,\qquad\det(A^2)=0.}
$$