Example. [00FN]

Solve for x: 3x \equiv _9 5 - x. We can’t just start by finding a modular inverse of 3: for one thing, we would still have an x on the other side of the equation; for another thing, 3 and 9 share a common factor so 3 actually doesn’t have a modular inverse modulo 9. We should add x to both sides of the equation first, which yields 4x \equiv _9 5. We find that the modular inverse of 4 modulo 9 is -2 \equiv _9 7. Multiplying both sides of the equation by -2 (we could also multiply both sides by 7) we get x \equiv _9 -10 \equiv _9 -1 \equiv _9 8. Checking, if we take x = -1 we get 3(-1) = -3 \equiv _9 5 - (-1) = 6.