For a given $3\times3$ matrix $A$, find $\beta$ such that $A^7-(\beta -1)A^6-\beta A^5$ is singular 
If $$A^7-(\beta -1)A^6-\beta A^5$$ is a singular   matrix find $\beta$, where $$A=
\begin{bmatrix}\beta  & 0 & 1 \\
-1 & 0 & 0 \\
3 & 1 & 2 \\
\end{bmatrix}
$$

My attempt
Let $A^7-(\beta -1)A^6-\beta A^5$ be $B$
taking the determinant on both sides we get $|A^7|-(\beta -1)|A^6| -\beta |A^5| =0 $
which means $A^2 -(\beta-1)A-\beta =0$
which is $(|A|-\beta)(|A|-1)=0$
which means $A=1 \text{or}  A=\beta$
now $|A|=-1$
which means $\beta=-1$.
however, the answer is $\frac{1}{3}$ why am I wrong
 A: As pointed out by the other answer, the determinant function is not linear. In general, $|A^7-(\beta -1)A^6-\beta A^5|$ is not equal to $|A|^7-(\beta -1)|A|^6-\beta |A|^5$.
However, one may observe that $A$ is always nonsingular, regardless of the value of $\beta$. Therefore $A^7-(\beta -1)A^6-\beta A^5$ is singular if and only if $A^2-(\beta -1)A-\beta I=(A-\beta I)(A+I)$ is singular. In other words, it is singular if and only if at least one of $A-\beta I$ or $A+I$ is singular. You may continue from here.
A: Keep an eye: determinant is not linear! You have to compute the powers of the matrix, do the computations and finally take the determinant.
Or better, you can take common factor ($A^5$) and then apply determinant.
A: My suggestion is to use Eigendecomposition of a matrix, factorize A in terms of its own eigen vectors(at the end you may realize that you only need to deal with the eigen value matrix )  and eigen values matrix.
from the given matrix equation we should have : $λ^7 - (β−1)λ^6 - βλ^5 = 0 $
and the requirement on the Eigenvalues :  det(A - λI) = 0
β can be found by solving the above equations,
