Let $H$ and $K$ be subgroups of a group $G$. My question is: when is $$ HK = \{hk: h\in H, k\in K\} $$ a subgroup of $G$?
If $G$ is abelian, then this is clearly the case. I believe I have shown that if $H$ and $K$ are both normal subgroups of $G$, then $HK$ is a subgroup.
Are there any more general results where this is the case?
I do see things like this giving a list of equivalent statements, but I was wondering what statements imply that $HK$ is a subgroup.
We use the result provided by Goldy. We can show the following corollary.
Proof. (a) We show that $HK=KH$.
$HK \subset KH$: let $h\in H$ and $k\in K$. Then $h\in N_{G}(K)$. So $hKh^{-1}=K$. Hence $hkh^{-1}=l$ for some $l\in K$. So $hk=lh\in KH$.
$KH\subset HK$: let $k\in K$ and $h\in H$. Then $h^{-1}\in N_{G}(K)$. So $h^{-1}kh=l$ for some $l\in K$. Hence $kh=hl\in HK$.
So $HK=KH$. By the result provided by Goldy, $HK\leq G$.
(b) Since $K\unlhd G$, we have $gKg^{-1}=K$ for all $g\in G$. So $N_{G}(K)=G$. Hence $H\leq N_{G}(K)$. By part (a), $HK\leq G$.
Proof. (a) If $H\leq N_{G}(K)$, then by the first corollary, $HK\leq G$. If $K\leq N_{G}(H)$, then by the first corollary, $KH\leq G$. By the previous result, $HK=KH$. So $HK\leq G$.
(b) If $K\unlhd G$, then $HK\leq G$. If $H\unlhd G$, then $KH\leq G$. So $HK=KH\leq G$.
Edit: one more case.
Proof. If $H\subset K$, then $K\subset HK\subset K$. So $HK=K\leq G$. If $K\subset H$, then $H\subset HK\subset H$. So $HK=H\leq G$.