The matrix $B$ is below:
$$ B = \begin{pmatrix} 1 & 0 & 1 & 0 \\ -1 & x & 0 & 1 \\ 0 & 0 & x & 1 \\ x^2 & x & 7 & 0 \end{pmatrix} $$
Using Gaussian elimination I got this for the determinant. -----
$$ \det B = 1×x×x×((x^2-x-6)/x) = x^3-x^2-6x $$
I need the values $x$ that make $B$ noninvertible.
Can you help me out from there?
Adding the first line to the second one and also adding the first line time $-x^2$ to the fourth on, you get$$\begin{vmatrix}1&0&1&0\\-1&x&0&1\\0&0&x&1\\x^2&x&7&0\end{vmatrix}=\begin{vmatrix}1&0&1&0\\0&x&1&1\\0&0&x&1\\0&x&-x^2+7&0\end{vmatrix}.$$Now, subtracting the second one from the fourth one, you get$$\begin{vmatrix}1&0&1&0\\0&x&1&1\\0&0&x&1\\0&x&-x^2+7&0\end{vmatrix}=\begin{vmatrix}1&0&1&0\\0&x&1&1\\0&0&x&1\\0&0&-x^2+6&-1\end{vmatrix}.$$So\begin{align}\begin{vmatrix}1&0&1&0\\-1&x&0&1\\0&0&x&1\\x^2&x&7&0\end{vmatrix}&=x\begin{vmatrix}x&1\\-x^2+6&-1\end{vmatrix}\\&=x(-x+x^2-6)\\&=x^3-x^2-6x\end{align}indeed. Therefore, $B$ is invertible if and only if $x\notin\{-2,0,3\}$.