Q: Order of certain subgroups of $\text{GL}_3(\mathbb{F}_p)$. Let $\mathbb{F}_p$ be the field with $p$ element. How many elements do the following subgroups of $\text{GL}_3(\mathbb{F}_p)$ have?

*

*$G_1=\left\{ \begin{pmatrix} x & a & b \\ 0 & d & c \\ 0 & 0 & x \end{pmatrix} \right\}$,

*$G_2=\left\{ \begin{pmatrix} x & a & b \\ 0 & x & 0 \\ 0 & d & c \end{pmatrix} \right\}$,

*$G_3=\left\{ \begin{pmatrix} a & 0 & b \\ d & x & c \\ 0 & 0 & x \end{pmatrix} \right\}$.

Here GL is the general linear group, the group of invertible n×n matrices.
Could someone provide me with a complete solution for one of the three subgroups so that I know how to redo it with the others?
Thank you in advance.

A: Let's do (3).
The only constraint on the variables is that the determinant is nonzero. The determinant in this case is $ax^2$, so we must require $a,x\ne 0$ but $b,c,d$ can then be arbitrary. That means $(p-1)^2$ choices for $a,x$ and $p^3$ choices for $b,c,d$ so there are $p^3(p-1)^2$ elements in this subset.
