Prove:$x^d-1 \mid x^n-1$ iff $d \mid n$.

Suppose $x^{d}-1\mid x^{n}-1$. By division algorithm, we can write $n=qd+r$ for some $q,r\in\mathbb{N}_0$ with $0\le r<d$. Now, observe that $$x^{d}-1 \mid (x^{d}-1)(x^{n-d}+x^{n-2d}+\cdots + x^{n-qd}+1)$$ Expanding the above, and cancelling many terms, we get that $$x^{d}-1 \mid x^{n}+x^{d}-x^{n-qd}-1=x^{n}-1+x^{d}-x^{r}$$ Together with $x^{d}-1\mid x^{n}-1$, this implies: $$x^{d}-1\mid x^{d}-x^{r}=(x^{d}-1)+(1-x^{r})$$ which gives $x^{d}-1\mid x^{r}-1$. This is a contradiction, unless $r=0$, in which case $d\mid n$.

The converse easily follows from the identity $x^{n}-1=(x-1)(x^{n-1}+x^{n-2}+\cdots + x+1)$.