When is $HK$ a subgroup? 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.
 A: We use the result provided by Goldy. We can show the following corollary. 

Corollary. Let $H$ and $K$ be subgroups of a group $G$.
  (a) If $H\leq N_{G}(K)$, then $HK$ is a subgroup of $G$. 
  (b) If $K\unlhd G$ then $HK\leq G$. 

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$. 

Corollary. Let $H$ and $K$ are subgroups of a group $G$. (a) If $H\leq N_{G}(K)$ or $K\leq N_{G}(H)$, then $HK\leq G$. (b) If $H\unlhd G$ or $K\unlhd G$, then $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.

Corollary. Let $H$ and $K$ be subgroups of a group $G$. If $H\subset K$ or $K\subset H$, then $HK\leq G$.

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$. 
A: $HK$ is a subgroup of $G$ iff $HK=KH$.
Let $HK$ be a subgroup of $G$. If $x\in HK$ is any element, then $x^{-1}\in HK$. This implies, $x^{-1}=hk \implies x=k^{-1}h^{-1}\in KH$. Thus, $HK\subseteq KH$. Similarly, $KH\subseteq HK$. Hence, $HK=KH$.
Conversely, let $KH=HK$. Let $x,~y\in HK$. Then $x=h_1k_1$ and $y=h_2k_2$ for some $h_1,h_2\in H$, $k_1,k_2\in K$. This implies, $xy^{-1}=h_1(k_1k_2^{-1})h_2^{-1}$.
Now, $(k_1k_2^{-1})h_2^{-1}\in KH=HK$, thus $(k_1k_2^{-1})h_2^{-1}=hk$ for some $h\in H$, $k\in K$. Thus, $xy^{-1}=h_1(hk)=(h_1h)k\in HK$. Hence, $HK$ is a subgroup, as $x, y\in HK\implies xy^{-1}\in HK$. 
