Finding the rank of a matrix whose entries depend on a parameter Determine the rank of $A$ for all values of the parameter $x$. Use the relevant theory to support
your answer.
$$A = \begin{bmatrix}x&0&x^2-2\\0&1&1\\-1&x&x-1\end{bmatrix}$$
That's the full question. I have been trying to manipulate it into echelon form but I'm not making any progress. Any help would be appreciated.

Recall that the rank of $A$ is the largest order of any non-zero minor in $A$. We have that
$$\det(A)=x(x-1)+(x^2-2)-x^2=x^2-x-2 = (x+1)(x-2),$$
which implies that $\text{rank}(A)=3$ for $x\not\in\{-1,2\}$. Otherwise, for $x=-1$,
$$A = \begin{bmatrix}-1&0&-1\\0&1&1\\-1&-1&-2\end{bmatrix}\implies \text{rank}(A)=2$$
because $\det\left(\begin{bmatrix}-1&0\\0&1\end{bmatrix}\right)\not=0$, and for $x=2$,
$$A = \begin{bmatrix}2&0&2\\0&1&1\\-1&2&1\end{bmatrix}\implies \text{rank}(A)=2$$
because $\det\left(\begin{bmatrix}2&0\\0&1\end{bmatrix}\right)\not=0$.
