Let $A_1,A_2,...,A_n$ be subgroups of $G$ and $H=A_1A_2...A_n$.
Is there any sufficient and necessary condition for $H$ to be subgroup ?
When $n=2$, $H$ is a subgroup if and only if $A_1A_2=A_2A_1$. I do not know if there is any generalization of this principle ?
Note: if necessary you may assume $G$ is finite.
Edit: This question seems to be already asked here with not accepted answer.