$d\mid p\!-\!1\Rightarrow x^d-1\pmod{\!p^2}$ has exactly $d$ roots for odd prime $p$ I'm trying to figure out the number of solutions to the congruence equation $x^d \equiv1 \pmod{p^2}$ where $p$ is prime and $d\mid p-1$.
For the congruence equation ${x^d}\equiv1 \pmod p$ where $p$ is prime and $d\mid p-1$ I've shown that there are exactly $d$ solutions modulo $p$.
I'm trying to use the above result to extend it to the higher power. I'm aware of something called Hensel's Lemma which says if a polynomial has a simple root modulo a prime  $p$, then this root corresponds to a unique root of the same equation modulo any higher power of $p$. We can 'lift' the root iteratively up to higher powers.
I'm unsure exactly how this process works. All I have to start with is that I assume a solution of the form $m+np$ solves the 'base' congruence and I'm trying to somehow extend it to $p^2$.
Any help would be appreciated.
Thanks.

Taking Discrete Logarithm with respect to a primitive root $a\pmod {p^n}$ for integer $n\ge1,$
$$d\cdot ind_ax\equiv0\pmod {\phi(p^n)}\implies d\cdot ind_ax\equiv0\pmod {p^{n-1}(p-1)}$$
As $d|(p-1),(d,p-1)=d$ and $(p,p-1)=1\implies (d,p)=1\implies (d,p^{n-1})=d$
$\implies (d,p^{n-1}(p-1))=d$
Using Linear congruence theorem, 
as $d|0,$  there will be  has exactly $d$ solutions.
