Sylow p-subgroups and set X not divisible by p Let $P$ be a Sylow $p$-subgroup of $G$ and suppose that $P\subseteq Z(G)$.  Show that the set $X$ of elements of $G$ with order not divisible by $p$ is a  subgroup of $G$ and that $G=P\times X$.
I can see that $X\neq \phi$, and $X$ is closed under inversions. How do I show $X$ is closed under multiplication?
To show that $G=P\times X$, my first thought is to take the quotient $G/X=(P\times X)/X=P$. 
 A: We are assuming that $G$  is finite, furthermore, $\left|G\right|=p^{n}m$  with $p$ prime and $m\in \mathbb{N_{>0}}$  where $\left(m,p\right)=1$, then $\left|P\right|=p^n$. Moreover $P\trianglelefteq G$ because $P\subseteq Z\left(G\right)$.
First we show that $X$ is subgroup of $G$, indeed, $X\neq\phi$  because we can consider the prime factorization of $m$  and choose one of these factors and apply the Cauchy Theorem. Clearly $X$ is closed under inversions. Let us prove that $X$ is closed under multiplication, indeed, let  $a,b\in X$, then $\left\langle ab\right\rangle \leq\left\langle \left\langle a\right\rangle \left\langle b\right\rangle \right\rangle $  and  we know that $\left|\left\langle \left\langle a\right\rangle \left\langle b\right\rangle \right\rangle \right|=\frac{\left|a\right|\left|b\right|}{\left|\left\langle a\right\rangle \cap\left\langle b\right\rangle \right|}$ where  $\left|a\right|$, $\left|b\right|$  and $\left|\left\langle a\right\rangle \cap\left\langle b\right\rangle \right|$ do not divisible by $p$, then $\left|\left\langle \left\langle a\right\rangle \left\langle b\right\rangle \right\rangle \right|$ is not divisible by $p$, in particular, $\left|ab\right|$ is not divisible by $p$.
Note that $p\nmid \left|X\right|$ because if it were not so then there would be a subgroup of $X$ of order $p$. Therefore  $\left|X\right|$ divide to $m$, furthermore,  $\left|X\right|=m$, indeed,  we  consider the prime factorization of $m=q_{1}^{k_{1}}q_{2}^{k_{2}}\dots q_{s}^{k_{s}}$  where $q_{s}$ are prime numbers different of $p$, as $\left|X\right|$ divide to $m$   suppose that $\left|X\right|\neq m$, then, without loss of generality, we consider  $\left|X\right|=q_{1}^{k_{1}}q_{2}^{k_{2}}\dots q_{t}^{k_{t}}$  with $t<s$, but by First Sylow Theorem there is a Sylow $q_{j}$-supgroup $H_{j}$ of $G$ of order $q_{j}^{k_{j}}$ for each $t<j\leq s$, note that the order of each element in $H_{j}$ is not divisible by $p$, then $H_{j}\leq X$, therefore  $q_{j}^{k_{j}}$ divide to $\left|X\right|$ which contradicts our supposition.
Finally, as  $P\trianglelefteq G$ then $PX\leq G$, mareover,  clearly $P\cap X=\left\{ e\right\}$. Therefore $\left|PX\right|=\left|P\right|\left|X\right|=p^nm=\left|G\right|$, hence, $G=PX$.
