Show that $G$ is a subgroup of $\operatorname{GL}_3(\mathbb R)$ and $G \cong \mathbb R^2 \rtimes (\mathbb R^\times \times \mathbb R^\times)$ This is exercise $3-5$ from Milne's group theory book.
$\DeclareMathOperator{\GL}{GL}$
$\newcommand{\R}{\mathbb R}$
Problem. Let $G$ be all matrices in $\GL_3 (\R)$ of the form
$$\begin{pmatrix} a & 0 & b\\ 0 & a & c \\ 0 & 0 & d \\ \end{pmatrix},$$
where $ad\neq 0$. Check that $G$ is a subgroup of $\GL_3 (\R)$ and that it is a semidirect product of $\R^2$ (additive group) and $\R^\times \times \R^\times$. Is it a direct product of these two groups?
Attempt.
First, to check $G$ is a subgroup of $\GL_3 (\R)$ we can take a matrix $A \in G$ and find that its inverse is given by
$$A^{-1} = \begin{pmatrix} a^{-1} & 0 & e\\ 0 & a^{-1} & f \\ 0 & 0 & d^{-1}\end{pmatrix},$$
where $e=-a^{-1}bd^{-1}$ and $f= -a^{-1}cd^{-1}$. Then straightforward matrix multiplication shows if $A,B \in G$ then $AB^{-1}\in G$, so by the subgroup test $G$ is a subgroup. Now to show $G  \cong \R^2 \rtimes (\R^\times \times \R^\times)$ it suffices to find $N \cong \R^2$ and $Q \cong \R^\times \times \R^\times$ such that
\begin{align*}
    N &\vartriangleleft G;\\
    NQ &= G;\\
    N \cap Q &= \{1\}.\\
\end{align*}
Let $N$ be all matrices of the form
$$\begin{pmatrix} a & 0 & 0 \\ 0 & a & 0 \\ 0 & 0 & d \end{pmatrix}$$
such that $ad \neq 0$, and let $Q$ be all matrices of the form
$$\begin{pmatrix} 1 & 0 & b \\ 0 & 1 & c \\ 0 & 0 & 1\end{pmatrix},$$
such that $b,c \in \R^\times$. Then we can identify $N$ with $\R^2$ and $Q$ with $\R^\times \times \R^\times$ in the obvious way, and we see that the three conditions for semidirect product are also satisfied. Therefore $G \cong \R^2 \rtimes (\R^\times \times \R^\times)$ as desired. Note that $G$ cannot be a direct product of these two subgroups because, e.g., $Q$ is not normal in $G$.
Is this correct?
 A: You have the subgroups $N$ and $Q$ backwards. Notice
$$ \begin{pmatrix} a_1 & 0 & 0 \\ 0 & a_1 & 0 \\ 0 & 0 & d_1 \end{pmatrix}
\begin{pmatrix} a_2 & 0 & 0 \\ 0 & a_2 & 0 \\ 0 & 0 & d_2 \end{pmatrix} =
\begin{pmatrix} a_1a_2 & 0 & 0 \\ 0 & a_1a_2 & 0 \\ 0 & 0 & d_1d_1 \end{pmatrix} \tag{q}$$
corresponds to $(a_1,d_1)(a_2,d_2)=(a_1a_2,d_1d_2)$ in the multiplicative group $\mathbb{R}^\times\times\mathbb{R}^\times$, and
$$ \begin{pmatrix} 1 & 0 & b_1 \\ 0 & 1 & c_1 \\ 0 & 0 & 1\end{pmatrix} 
\begin{pmatrix} 1 & 0 & b_2 \\ 0 & 1 & c_2 \\ 0 & 0 & 1\end{pmatrix} =
\begin{pmatrix} 1 & 0 & b_1+b_2 \\ 0 & 1 & c_1+c_2 \\ 0 & 0 & 1\end{pmatrix} \tag{n}$$
corresponds to $(b_1,c_1)+(b_2,c_2)=(b_1+b_2,c_1+c_2)$ in the additive group $\mathbb{R}\times\mathbb{R}$. You should be able to turn these two equations into proofs that we are talking about subgroups, not just subsets, and that they are isomorphic to $(\mathbb{R}^\times)^2$ and $\mathbb{R}^2$ as claimed.
So, you should let $N$ be comprised of the particular unitriangular elements and let $Q$ be comprised of the diagonal elements. In order to verify $G=N\rtimes Q$ is a semidirect product, you must verify the first three bullet points below:

*

*Every element of $G$ is expressible as $nq$, where $n\in N$ and $q\in Q$.

*The intersection $N\cap Q$ is trivial (i.e. only the identity matrix).

*The subgroup $N$ is normal in $G$ (or normalized by $Q$, at least).

*$Q$ is not normal.

The fourth bullet point indeed shows the product is not direct, only semidirect. Or, since $(\mathbb{R}^\times)^2$ and $\mathbb{R}^2$ are both abelian, their direct product would also be abelian, so disprove directness it suffices to show $G$ is not abelian, for which it suffices to find any tw matrices in it which do not commute.
