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

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.
