Prove: $\forall a,b\in\mathbb{Z}$, $x\in G$ : $\left\langle x^{a},x^{b}\right\rangle =\left\langle x^{d}\right\rangle $ [duplicate]

Let $G$ be a group, and let $d=\gcd(a,b)$

Prove: $\forall a,b\in\mathbb{Z}$, $x\in G$:

$$\left\langle x^{a},x^{b}\right\rangle =\left\langle x^{d}\right\rangle. $$

My attempt was to first prove that: $$\left\langle a,b\right\rangle =\left\langle d\right\rangle $$

and then maybe rely on this proof, to show that $$\left\langle x^{a},x^{b}\right\rangle \subseteq\left\langle x^{d}\right\rangle $$

and

$$\left\langle x^{a},x^{b}\right\rangle \supseteq\left\langle x^{d}\right\rangle $$

Is this direction right? I would appreciate any help.

Thanks and sorry if I have English mistakes


Because $x^a$ and $x^b$ commute, then $$\langle x^a, x^b \rangle = \lbrace (x^a)^n(x^b)^m, n, m \in \mathbb{Z} \rbrace$$

so $$\langle x^a, x^b \rangle = \lbrace x^{na+mb}, n, m \in \mathbb{Z} \rbrace$$

Now, $\lbrace na+mb, n,m \in \mathbb{Z} \rbrace = \lbrace kd, k \in \mathbb{Z}\rbrace$ by definition of $d$ as the generator of $\langle a,b \rangle$ in $\mathbb{Z}$. So

$$\langle x^a, x^b \rangle = \lbrace x^{kd}, k \in \mathbb{Z} \rbrace = \lbrace (x^{d})^k, k \in \mathbb{Z} \rbrace$$

i.e.

$$\boxed{\langle x^a, x^b \rangle = \langle x^d \rangle}$$