How to solve this linear congruence equation and more general cases? Okay so I'm trying to solve $5x \equiv 7 \mod 11$ and this is the particular example that I can't do. Can someone help me learn how to solve these and more general examples $ax \equiv b \mod n$. I believe there is only one solution (well infinitely many but they are all the same $\mod n$) $a$ is coprime to $b$  however I still need help solving these and also how to solve it when it is a simultaneous linear congruence. Any help?
Thanks.

Since 11 is a prime number, any number congruence it has an inverse:
$$5x \equiv 7 \mod 11$$
$$5 \times 9 =45= 4\times 11+1$$
$$5^{-1} \equiv 9 \mod 11$$
$$5^{-1} \times 5 x\equiv 5^{-1} \times 7 \mod 11$$
$$x\equiv 9 \times 7 \equiv 63 \equiv 8 \mod 11$$
$$x\equiv  8 \mod 11$$

If 11 was not prime, you had to try 11 cases from 1 to 11 (try and error) to find primary answers. 
