This is geometric progression with first member x and q=x.
Therefore, its sum is
We obtained equality:
Differentiating with respect to x yields:
Since x is n-th root of unity then and we can write above equality as
Again, since then
As can be seen from formula x=1 can't be applied to the formula.
Therefore, if x=1 , otherwise