If $[G:H]$ and $[G:K]$ are relatively prime, then $G=HK$
We have the following fact:
- If $H$ and $K$ are subgroups of a group $G$, then $[H:H\cap K]\leq [G:K]$. If $[G:K]$ is finite, then $[H:H\cap K]=[G:K]$ if and only if $G=KH$. This is proposition $4.8$ of chapter I in Hungerford's Algebra.
It is easy to prove that $[G:H][H:H\cap K]=[G:K][K:H\cap K]$, from this conclude that $[G:H]\mid [K:H\cap K]$; since $[G:H]$ and $[G:K]$ are relatively prime, and combinig this with $(1)$ we get $[G:H]=[K:H\cap K]$, so...