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.
 A: The first two columns are linearly independent for all values of $x$ (can you see why?). So the question remains about the third. When does there exist constants $a, b$ such that $a(x,0, -1) + b(0, 1, x) = (x^2-2, 1, x-1)$? This amounts to solving the system
\begin{align}
ax &= x^2-2 \\
b &= 1 \\
bx-a &= x-1
\end{align}
Substituting the second equation into the third yields $x-a = x-1 \implies a = 1$. Hence the first equation reduces to $x^2-x-2 = (x+1)(x-2) = 0$. This means that for $x = -1$ and $x = 2$, the third column is a linear combination of the two others, meaning that the matrix has rank $2$. Otherwise, all columns are linearly independent and the rank is $3$.
A: 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$.
