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

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.
