Trying to calculate the Characteristic Polynomial using the following formula found online for $3 \times 3$matrices:
$C P=-\lambda^{3}+\operatorname{tr}(A) \lambda^{2}+\left(\operatorname{tr}(A)^{2}-\operatorname{tr}\left(A^{2}\right)\right) \lambda+\operatorname{det}(A)$
For the following matrix:
$$\left(\begin{array}{rrr}{5} & {2} & {-4} \\ {4} & {7} & {-8} \\ {4} & {2} & {-3}\end{array}\right)$$
The answer is $-\lambda^{3}+9 \lambda^{2}-23 \lambda+15$
But $A^2=$ $\left(\begin{array}{lll}{17} & {16} & {-24} \\ {16} & {41} & {-48} \\ {16} & {16} & {-23}\end{array}\right) \implies tr(A^2)=35$
So shouldn't $\operatorname{tr}(A)^{2}-\operatorname{tr}\left(A^{2}\right)=81-35=46 $ and not $-23$?
Your computations are fine, but your formula isn't. It should be:$$-\lambda^3+\operatorname{tr}(A)\lambda-\frac12\bigl(\operatorname{tr}^2(A)-\operatorname{tr}(A^2)\bigr)\lambda+\det(A).$$