Solve $15\cdot x=27\pmod{18}$ EXERCISE:


  Solve   $15\cdot x\equiv 27\pmod{18}$


SOLUTION:
We know that $\gcd(15,18)=3$ and $3\setminus 27=3\cdot 9$.

So from http://www.math.niu.edu/~richard/Math420/lin_cong.pdf we can conclude that we have 3 solutions!

Then we have that $15\cdot x\equiv 27\pmod{18}\implies 5\cdot x\equiv 9\pmod{6}$

So, from now and then I can't understand how to proceed!

The book continue with this:
"We have a unique solution of   $5\cdot x\equiv 9\pmod{6}$ which is":

$x=5\cdot 9 =45\equiv 3\pmod 6$ and $15\cdot 3\equiv 27\pmod{18}\equiv 9\pmod{18} $

The other solutions are:$(9,15)$. So all solutions are these: $(3,9,15)$

Can anyone explain me how the author of the book continue the exercise?I really can't understand how he ends up with these solutions!Is there another way to reach these solutions?

I would really appreciate a thorough  explanation, since I've just started working on these type of exercises and I have to clear my mind on them. 

Thanks for your time !
Note that

$$15\cdot x\equiv 27\pmod{18}\iff 15\cdot x\equiv 9\pmod{18}$$

and

$$15\cdot x\equiv 9\pmod{18}\iff 15\cdot x=9+18\cdot k\\\iff 5\cdot x=3+6\cdot k \iff 5\cdot x\equiv 3\pmod{6}$$

note also that

$$5\cdot 5\equiv 25 \equiv 1\pmod{6}$$

then

$$5\cdot x\equiv 3\pmod{6}\iff 5\cdot 5\cdot x\equiv 5\cdot3\pmod{6}\iff x\equiv 15\pmod{6}\\\iff x\equiv 3\pmod{6}$$
It is possible to solve this problem using algebraic symbols or augmented matrices. For example the following uses augmented matrices to solve the problem:

$$\begin{array}{c|c|c|}
 \hline
 \text{x} &amp; \text{y} &amp; \text{c} &amp; \text{s} &amp; \text{t} \\
\hline
\text{15} &amp; \text{-18} &amp; \text{27} \\
&amp; \text{+3} &amp; \text{+3} &amp; \text{-15} \\
 &amp; &amp; &amp; &amp; \text{3} \\
\hline
\text{5} &amp; \text{-6} &amp; \text{9} \\
&amp; \text{1} &amp; \text{1} &amp; \text{-5} \\
\hline
\text{1} &amp; &amp; \text{3} &amp; \text{9} \\
&amp; \text{1} &amp; \text{1} &amp; \text{-5}
\\
\hline
\end{array}$$

I have included animations for the construction of the augmented matrices in the PDF document "How I solved 15x≡27 (mod 18)" and a description of the "method" and its relation to the Euclidean Algorithm and the Extended Euclidean Algorithm.