<s>[INST] 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 !
 [/INST] 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}$$
</s>