Solution (source code)

= Solution

An element of the <general linear group over a finite field> is an invertible $2\times2$ <matrix>. Its columns must form an ordered <basis> of $\mathbb F_p^2$. There are $p^2-1$ choices for the first column. Its <linear span> contains $p$ vectors, so there are $p^2-p$ choices for a second column outside that <linear span>. Thus the <order of a general linear group over a finite field> is
$$
\boxed{|GL_2(\mathbb F_p)|=(p^2-1)(p^2-p)=p(p-1)^2(p+1).}
$$
The <determinant> is a surjective <group homomorphism> $GL_2(\mathbb F_p)\to\mathbb F_p^\times$: for each $a\ne0$, the diagonal <matrix> $\operatorname{diag}(a,1)$ has <determinant> $a$. Its <kernel of a group homomorphism> is the <special linear group over a finite field>. The <first isomorphism theorem> gives $|GL_2|/|SL_2|=p-1$, hence
$$
\boxed{|SL_2(\mathbb F_p)|=p(p^2-1).}
$$