Take a Multiplicative group G, defined by a prime p. Now take an element t from it. Its inverse is t-1. To calculate the inverse you can use the extended Euclidian algorithm or this trick, which I found on wikipedia:
t-1 = tp-2 mod p
Now this makes some sense to me, but the following, which I found in some code, does not.
Take t, and raise it to u (also in G): tu
(tu)-1 = tp-1-u mod p
What is this trick called, and why does it work?