Finding rank of a matrix depending on parameter a We have the matrix
$$A = \begin{bmatrix}1 & a & 1\\-4 & 2 & a \\ a & -1 & -2 \\ 4 & 6 & 1\end{bmatrix}$$
and we want to find the rank of this matrix as a function of parameter $a$.

The rank of the matrix is equal to the number of nonzero rows in the matrix after reducing it to the row echelon form using elementary transformations over the rows of the matrix.
$\ \begin{bmatrix}1 & a & 1\\-4 & 2 & a \\ a & -1 & -2 \\ 4 & 6 & 1\end{bmatrix}$ substract (-4)*row 1 from row 2 ->
$\ \begin{bmatrix}1 & a & 1\\0 & 4a+2 & a+4 \\ a & -1 & -2 \\ 4 & 6 & 1\end{bmatrix}$ substract a*row 1 from row 3 ->
$\ \begin{bmatrix}1 & a & 1\\0 & 4a+2 & a+4 \\ 0 & -a^2-1 & -a-2 \\ 4 & 6 & 1\end{bmatrix}$ substract 4*row 1 from row 4 ->
$\ \begin{bmatrix}1 & a & 1\\0 & 4a+2 & a+4 \\ 0 & -a^2-1 & -a-2 \\ 0 & -4a+6 & -3\end{bmatrix}$ substract $\ (\frac{-a^2-1}{4a+2})$*row 2 from row 3, $\ 4a+2\neq0$ ->
$\ \begin{bmatrix}1 & a & 1\\0 & 4a+2 & a+4 \\ 0 & 0 & \frac{a^3-9a}{4a+2} \\ 0 & -4a+6 & -3\end{bmatrix}$ substract $\ (\frac{-2a+3}{2x+1})$*row 2 from row 4,$\ 2a+1\neq0$ ->
$\ \begin{bmatrix}1 & a & 1\\0 & 4a+2 & a+4 \\ 0 & 0 & \frac{a^3-9a}{4a+2} \\ 0 & 0 & \frac{2a^2-a-15}{2a+1}\end{bmatrix}$ substract $\ (\frac{4a+10}{a^2+3a})$*row 3 from row 4 ,$\ a^3-9a\neq0$->
$\ \begin{bmatrix}1 & a & 1\\0 & 4a+2 & a+4 \\ 0 & 0 & \frac{a^3-9a}{4a+2} \\ 0 & 0 & 0\end{bmatrix}=M =>$ rankM=3
And now to check for the values of $\ a$ that are excluded from the previous calculation
for $\ a=\frac{-1}{2} ->rankA=3,a=3-> rankA=2, a=-3->rankA=3, a=0->rankA=3$
