Help understanding the characteristic polynomial Let
$$A = \begin{bmatrix}
1 &2  &1 \\ 
2 & 2 &3 \\ 
1 & 1 &1 
\end{bmatrix}$$
I'm calculating the characteristic polynomial by the following:
$$P(x) = -x^3 + Tr(A)x^2 + \frac{1}{2}(a_{ij}a_{ji} -  a_{ii}a_{jj})x + \det(A)$$
Now when I calculate using matlab (using the charpoly(A) function) I get the following results:
Ans = 1    -4    -3    -1

This makes sense since, for second result ($-4$) you can calculate $2 + 3 + 4$ and for result $-1$ you can do by taking the determinant of this matrix, which is (1) 
But I do not and cannot seem to figure out how they are calculating the $-3$ (in this case)? I know it has something to do with the $\frac{1}{2}(a_{ij}a_{ji} - a_{ii}a_{jj})$ but what would these elements be in this matrix in order to calculate the third result for this? 

As Dario suggested,easiest way to compute characteristic polynomial is to use det$(xI-A)=0$
But if you really wants to compute in a different way, the formula I know (from this link in Wikipedia) is:
$p(x)=x^3-Tr(A)+\frac12 (Tr(A)^2-Tr(A^2))-det(A)$
And you can see $(Tr(A)^2-Tr(A^2))=16-22=-6$ (Please compute diagonal elements of $A^2$ only,you don't need to calculate $A^2$ completely)
So $\frac12 (Tr(A)^2-Tr(A^2))=-3$
