I'd be surprised if they are really differentiating. This is a discrete distribution. Would you please do the following?
E(x) = sum x*p(x) = sum x*p * (1-p)^(x-1)
= p sum x*(1-p)^(x-1)
To compute sum x*(1-p)^(x-1). Let A=sum x*(1-p)^(x-1)
write x*A/(1-p) and subtruct it from A.
I mean write: x*A/(1-p) - A
Do you see any terms canceling each other? There should be many.
If you can't see, write them in two different lines, and let the same terms (x, x^2, x^2,...) come one top of another and see how they cancel each other.