Intuition about the semidirect product of groups
Solution 1:
Forget about the actual construction of the semidirect product for now. I argue that the semidirect product is important because it arises naturally and beautifully in many areas of mathematics. I will list below many examples, and I urge you to find a few that interest you and look at them in detail.
Before doing that let me just give the following extra motivation: say you have a group $G$, and you find two subgroups $H,K$ such that every element of $G$ can be uniquely written as a product $hk$ for $h \in H$, $k \in K$. In other words, you have a set-theoretic bijection between $G$ and $H \times K$. Then certainly you'd want to understand $G$ by studying its smaller components $H$ and $K$. One way to achieve this would be to find a suitable group structure on $H \times K$ intertwining the structures of $H$ and $K$ such that the above bijection becomes a group isomorphism. This can be done; however doing things in this generality becomes rapidly tedious. If instead we restrict our attention to such decompositions with $H$ normal in $G$, the problem becomes much more manageable. In this case we have what we call a split exact sequence $$1 \to H \to G \to K \to 1,$$ and $G$ is called a semidirect product of $H$ and $K$. An existence and uniqueness theorem gives us all the possible semidirect products one can obtain from $H$ and $K$ through the group of homomorphisms from $K$ to $\operatorname{Aut}H$. Note that $K = \mathbb{Z}/2$ appears often in practice, because this guarantees normality of $H$. Now here are some examples:
The symmetric group $S_n = A_n \rtimes \mathbb{Z}/2$. The exact sequence is $$1 \to A_n \to S_n \xrightarrow{\mathit{sign}} \mathbb{Z}/2 \to 1.$$
The dihedral group $D_n = \mathbb{Z}/n \rtimes \mathbb{Z}/2$. The exact sequence is $$1 \to \mathbb{Z}/n \to D_n \xrightarrow{\mathit{det}} \mathbb{Z}/2 \to 1.$$
The infinite dihedral group $D_\infty = \mathbb{Z} \rtimes \mathbb{Z}/2$. The exact sequence depends on your explicit construction. You may take $$1 \to \mathbb{Z} \to \mathbb{Z}/2 * \mathbb{Z}/2 \to \mathbb{Z}/2 \to 1$$ or $$1 \to \mathbb{Z} \to A(1,\mathbb{Z}) \to \mathbb{Z}/2 \to 1,$$ where $A(1,\mathbb{Z})$ is the group of affine transformations of the form $x \mapsto ax + b$, where $a \in \{ \pm 1 \} \cong \mathbb{Z}/2$ and $b \in \mathbb{Z}$.
Many matrix groups, thanks to the determinant map. For example, $G = \operatorname{GL}(n,\mathbb{F})$, $O(n,\mathbb{F})$ and $U(n)$ have respective subgroups $H = \operatorname{SL}(n,\mathbb{F}),\operatorname{SO}(n,\mathbb{F}),\operatorname{SU}(n)$ and $K = \mathbb{F}^\times,\mathbb{Z}/2,U(1)$.
The fundamental group of the Klein bottle is $G = \langle x,y \mid xyx = y \rangle$. This is just the nontrivial semidirect product of $\mathbb{Z}$ with itself. Interestingly, the other (trivial) semidirect product $\mathbb{Z}^2$ is the fundamental group of the other closed surface of Euler characteristic $0$, namely the torus.
The affine group $A(n,\mathbb{F}) = \mathbb{F}^n \rtimes \operatorname{GL}(n,\mathbb{F})$. Its elements are transformations $\mathbb{F}^n \to \mathbb{F}^n$ of the form $x \mapsto Ax + b$, with $A$ an invertible matrix and $b$ a translation vector. The exact sequence is $$1 \to \mathbb{F}^n \to A(n,\mathbb{F}) \xrightarrow{f} \operatorname{GL}(n,\mathbb{F}) \to 1$$ where $f$ forgets the affine structure (the translation part).
The hyperoctahedral group $O(n,\mathbb{Z})$ is the group of signed permutation matrices. We have two decompositions $O(n,\mathbb{Z}) \cong \operatorname{SO}(n,\mathbb{Z}) \rtimes \mathbb{Z}/2$ and $O(n,\mathbb{Z}) \cong (\mathbb{Z}/2)^n \rtimes S_n$. In the corresponding exact sequences the surjective map is respectively the determinant homomorphism and the "forget all the signs" homomorphism.
Solution 2:
It is nice to think about $D_4$ as a semidirect product. Namely, $D_4=\langle \sigma,\tau:\sigma^4=\tau^2=1,\tau\sigma=\sigma^{-1}\tau\rangle$. You can see the automorphism because $\sigma$ and $\tau$ do not commute, but the automorphism ($x\mapsto x^{-1}$) tells you how to move the $\tau$ past the $\sigma$.
In general, the direct product is not enough because the operation between elements of the two subgroups is always commutative. On the other hand, if $G$ is a group, $N$ is a normal subgroup, $H$ is a subgroup ($H$ need not be normal like in a direct product), $H\cap N=\{1\}$, and $G=NH$, then $G$ must be a semidirect product. (The operation between elements of $N$ and $H$ need not be commutative.) So, you can argue that the semidirect product classifies all groups constructed in this way.
The big idea in a semidirect product is the following:
You have two subgroups $N$ and $H$. You understand the operation when you multiply elements of $N$ and you understand the operation when you multiply elements of $H$.
The automorphism is used to compare the operation between elements of $N$ and elements of $H$.
You know that $N$ is normal, so for any $n\in N$ and $h\in H$, $hnh^{-1}$ is some element of $N$, and the map $n\mapsto hnh^{-1}$ is an automorphism of $N$. The semidirect product construction describes this conjugation automorphism. Therefore, if the automorphism determined by conjugation is $\phi_h:N\rightarrow N$, then $hn=hnh^{-1}h=\phi_h(n)h$.
Solution 3:
I take a different point of view than most people on this, I think, which is due to the way I first encountered it (along the lines of mathematical physics). To me the direct product is lacking in much structure. You effectively just slap two groups together and call it a day - much like when you combine two subspaces via direct sums.
The semi-direct product is a simple way to really mix two groups together. Let's consider matrices. If we have two groups of square matrices (with the same dimension), say $G$ and $H$, then if we were to multiply elements, we'd have $g_1 h_1 g_2 h_2$. This would be like the product $(g_1,h_1)(g_2,h_2)$ in direct product notation. If $H$ commutes with $G$, then we could rewrite this as $g_1 g_2 h_1 h_2$ which we could realize as being similar to $(g_1g_2,h_1h_2)$ in direct product notation. The two groups don't really see each other in this setting.
We know however that this is not always the case. Instead what you might have is that $H$ acts on $G$ in some way so that if you try to repackage the product $g_1 h_1 g_2 h_2$ in the form $g_1 g_2 h_1 h_2$, $g_2$ gets mixed up a bit by $h_1$. Since we don't want to leave the group $G$, we would need that $h_1$ acting on $g_2$ gives us another element in $G$. Moreover $h_1 I = I h_1$ so $h_1$ would have to permute the elements of $G$ while leaving the identity fixed. Moreover, if we had $g_1 h_1 g_2g_3 h_3$, then acting $h_1$ on each of $g_2$ and $g_3$ independently (and moving over) should give the same result as acting on their product (and moving over) - this is just the homomorphism property.
This does not give rise to the automorphism aspect, but this can be seen by noting that $h^{-1}hg = g$ and so if $h$ mapped $g$ to the identity, you would have a contradiction (unless $g = I$ of course).
In summary: if you had two matrix groups $G$ and $H$ that did not necessarily commute but attempted to reorder the elements in a direct product kind of way, you necessarily need that $H$ acts on $G$ by automorphisms.