Similarity between matrices. I have two matrices,
$A = \begin{pmatrix} 1&2\\3&4\end{pmatrix}$
$B =\begin{pmatrix} 1&2\\-1&-4\end{pmatrix}$
I need to check if A is similar to B.
I did by first computing the characterstic polynomial of the first one and the second one.
I got that $\det(t I-A) = t^2 -5t -2$
and $\det(t I-B) = t^2+3t-2$
Which means they are not similar. Please correct me if I'm wrong.
Also, I have another two matrices
$C = \begin{pmatrix} i\sqrt{2}&0&1 \\0&1&0 \\ 1&0&-i\sqrt{2}\end{pmatrix}$
$D = \begin{pmatrix} i&0&1 \\0&1&0 \\ 0&0&-i\end{pmatrix}$
And I need to check the similarity between them.
I got that:
$\det(t I-C) = (t-i)(t-1)(t+i)$
and $\det(t I-D) = (i\sqrt{2}t + 1)(t-1)$
Which makes them not similar. Are my characteristic polynomials wrong?

Now, let's prove similar matrices have equal traces.

General proposition:
Let $A\in M_{mn}(\mathbb F)$ and $B\in M_{nm}(\mathbb F)$. Then $\operatorname{trace}(AB)=\operatorname{trace}(BA)$.
Note: $AB\in M_m(\mathbb F)$ and $BA\in M_n(\mathbb F)$.
As stated in previous answers, 
two matrices $A,B\in M_n(\mathbb F)$ are similar $\iff\exists S\in M_n(\mathbb F),\det S\ne 0$ s.t.
$$A=S^{-1}BS$$
$\operatorname{trace} A=\operatorname{trace}\left(S^{-1}BS\right)=\operatorname{trace}\left(\left(S^{-1}B\right)S\right)=\operatorname{trace}\left(S\left(S^{-1}B\right)\right)=\operatorname{trace}\left(SS^{-1}B\right)=\operatorname{trace} B$
