# How to find the inverse of elements in a field?

Normally I use the naive method: $$a^{-1} = a \cdot b \bmod p \equiv 1,$$ where b is the inverse of a.

Else I love to use Fermat's little theorem: $$a^{p − 1} \equiv 1 \bmod p.$$ By multiplying both sides with $$a^{-1}$$ you get, that the inverse is $$a^{p-2}$$.

But let us say I have a field of the size 8 $$(F_8)$$ and I shall find the inverse of $$t+2$$, how do I do?

• What is $t$ in $\mathbb F_8$? – lhf May 26 at 21:47
• By the way, you should notice that, in $\Bbb F_8$, $t+2=t$. – Gae. S. May 26 at 21:51
• Euclidean algorithm in the Bezout lemma form – crystal_math May 26 at 21:54

In $$\mathbb F_8$$, we have $$2=0$$.
Assuming that $$t+2\ne0$$, we have $$(t+2)^{-1} = t^{-1} = t^6$$, because $$\mathbb F_8^\times$$ has order $$7$$.