Orders of $GL_2$ and $SL_2$ over the field $\Bbb Z_p$ So as I see it, if I find $|GL_2|$ I can simply divide it by $|\Bbb Z_p^*|=p-1$ to find $|SL_2|$, because $GL_2/SL_2\cong\Bbb Z_p^*$, so the problem comes down to finding $|GL_2|$. To find it, I was thinking in the following direction: the matrix can have at most $2$ zeros (otherwise it wouldn't be invertible), so if we denote by $N_i$ the number of nonsingular matrices with $i$ zeros in them, $|GL_2|=N_2+N_1+N_0$. If the matrix has $2$ zeros, then they are either on the main diagonal or the opposite one and in either of those cases the number of invertible matrices is $(p-1)^2$, so $N_2=2(p-1)^2$. By similar reasoning, $N_1=4(p-1)^3$. What I'm much less sure about is the value of $N_0$, i.e. the number of nonsingular matrices with nonzero entries. Would the following be correct?

There are $(p-1)^2$ possible choices for the first column (or row, however you view the determinant), and since the second column cannot be a multiple of the first, $(p-1)^2-p$ possible choices for the second one. Therefore, $N_0=(p-1)^2((p-1)^2-p)$

After some simplification, that would make $|GL_2|=(p-1)^2(p^2+p-1)$ and $|SL_2|=(p-1)(p^2+p-1)$.
Edit: The correct solution to this according to my book is $|GL_2|=p(p+1)(p-1)^2$, with $|SL_2|$ following from that, so what did I do wrong? As I see it, that's essentially my answer, without the constant term in the quadratic. Where exactly was I wrong?


and since the second column cannot be a multiple of the first, $(p-1)^2-p$ possible choices for the second one.

Among the vectors with no zeroes in them, there are $p-1$ that are multiplies of the first column, not $p$. So you get
$$
(p-1)^2-(p-1)=(p-1)(p-2)
$$
possibilities for column 2 in $N_0$.
More generally, I would adopt this column-by-column analysis to the whole problem, not just $N_0$. You can solve the entire problem in one go that way.
