What are the methods of solving linear congruences?

$$25x\equiv 15\pmod{29}\tag{1}$$

$29$ is a prime number, an one can show (I think Gauss showed) that that implies every number in $\{1,2,3,\ldots,28\}$ must have a mod-$29$ multiplicative inverse within that set. So let's find the inverse $y$ of $25$, so that $25y\equiv1\pmod{29}$, and then multiply both sides of $(1)$ by $y$, getting $$ x\equiv15y\pmod{29}. $$ We want: $$ \begin{align} 25y & \equiv 1 \pmod {29} \\ 25y & = 1 - 29z \\ 25y+29z & = 1. \end{align} $$

If we divide $29$ by $25$, we get $1$, with remainder $4$: $$ 29-\{1\}25 = 4\tag{2} $$ Now divide $25$ by $4$, getting $6$, with remainder $1$: $$ 25-\{6\}4 = 1\tag{3} $$ Because $(2)$ is true, we can put $29-\{1\}25$ in place of $4$ in $(2)$: $$ 25-\{6\}(29-\{1\}25). $$ Now collect the $29$s and $25$s: $$ -\{6\}29 + \{7\}25 = 1.\tag{4} $$ So we have $y=7$ and $z=-6$.

Thus $(4)$ tells us that $$ 7\cdot25\equiv 1\pmod{29} $$

Thus multiply both sides of $(1)$ by $7$: $$ x\equiv7\cdot15\equiv 18 \pmod{29}. $$ See Calculating the Modular Multiplicative Inverse without all those strange looking symbols for the way to find the inverse of $322$ mod $701$. It turns out to be $455$.


A related problem. First step we simplify the congruence as $$ 25 x \equiv 15\bmod{29} \Rightarrow 5 x \equiv 3 \bmod 29\,, $$ since $\gcd(5,29)=1\,.$

You can use the following algorithm,

if $ a x \equiv b \bmod m$, then you can reduce it to $ m y \equiv -b \bmod a)\,.$ If $y_0$ is a solution for of the reduced congruence, then $x_0$ defined by $$ x_0 = \frac{my_0+b}{a} \,.$$ is a solution of the original congruence.

Applying this algorithm to your problem, we can reduce our congruence to

$$ 29 y \equiv -3 \bmod 5 \Rightarrow 4 y \equiv -3 \bmod 5\,. $$ You can see now by inspection that $y_0 = 3 $ is a solution of the last congruence. Substituting in $$ x_0 = \frac{my_0+b} a =\frac{29.3+3}{5}=18\,. $$