Find the smallest $x$ for $9x \equiv 3 \pmod {23}$ $9x \equiv 3 \pmod {23}$
How to derive the smallest $x$. I understand I can use the extended euclidean algorithm for eg $19x = 1 \pmod {35}$. 
However, I not too sure how to work on it when it is $3 \pmod {23}$. 
I am able to reach the step of $1 = -5(9) + 2(23$) after going thru the euclidean algorithm. 

We employ an algorithm that was discussed here.
$\alpha-$Solve:
$\;9x \equiv 3 \pmod{23}, \text{ and } \; 23 = 9 \cdot 2 + 5,\quad -3 + 1 \cdot 9 = 6$
$\alpha-$Solve:
$\;5x \equiv 6 \pmod{9}, \text{ and } \; 9 = 5 \cdot 1 + 4,\quad -6 + 2\cdot 5 = 4$
$\alpha-$Solve:
$\;4x \equiv 4 \pmod{5},  \text{ ANS: } \; x = 1 \text{ is the least residue solution}.$
Propagating backward,
Solve $5x = 6 + 1 \cdot 9, \text{ ANS: } \; x = 3$
Solve $9x = 3 + 3 \cdot 23, \text{ ANS: } \; x = 8$
$\text{ANSWER: }  x = 8 \text{ is the least natural number satisfying }$
$\quad 9x \equiv 3 \pmod{23}$
