Solve $91x\equiv 84\pmod{147}$ So, I posted a similar question to this, and I know that the equation is solvable because $\gcd(91,147) = 7$ and $7 \mid 84$. 
Plugging into Wolfram Alpha, I found that the solution is a line $21n + 9$. I can't figure out a means of getting this answer, though.
I tried the following: $91x= 147m + 84 = 7(21m+12)$, but this differs from the WA solution.
Any help would be appreciated.
Neurax
 A: $91x= 147m + 84 = 7(21m+12) \iff 13x = 21m + 12\tag{division by $7$}$
i.e. Solve $\;13x \equiv 12 \pmod{21} \implies $


*

*solve $\;x = 12\cdot 13^{-1} \pmod{21}$


and you'll get $x\equiv 9\pmod{21}$.
Now, find all solutions, modulo 147: all integers $x = 9 + 21k \lt 147$
A: You're on the right track, you just need to divide both sides by seven:
$13x = 12 + 21m \implies 13x \equiv 12 \pmod{21}$
Now find the inverse of 13 mod 21, by whatever means you like. The extended Euclidean algorithm works here, but it's small enough you can do it by hand: 13.
Multiply both sides by 13:
$$13x \equiv 12 \pmod{21}$$
$$169x \equiv 156 \pmod{21}$$
$$x \equiv 9 \pmod{21}$$
A: Hint $\ $ Below are a few solutions, by Gaussian inversion, idempotents, and CRT.
$\rm\displaystyle\:91x = 84\!+\!147n\iff 13x = 12\!+\!21n\iff mod\ 21\!:\ x \equiv \frac{12}{13} \equiv\frac{24}{26} \equiv \frac{3}5 \equiv \frac{12}{20} \equiv \frac{12}{-1} \equiv 9$
OR $ $ note $\rm\ 3\cdot 7\mid 12\cdot 14 = 13^2\!-\!1,\:$ so $\rm\:mod\ 21\!:\ 13^2\equiv 1\:\Rightarrow\:x \equiv 13(13x)\equiv 13(12)\equiv 9$
OR $ $ by  CRT, $\rm\ mod\ \color{#C00}7\!:\ x = 12/13\equiv -2/-1\equiv \color{#C00}{2},\:$ so $\rm\:mod\ 21\!:\ x \equiv \color{#C00}{2\!+\!7n} \equiv 2,\color{#0A0}9,16.\:$ But $\rm\:mod\ 3\!:\ x\equiv 12/13\equiv \color{#0A0}0,\:$ so the solution must be $\rm\:x \equiv \color{#0A0}9\ \ (mod\ 21),\:$ since $\rm\:3\nmid 2,16.$ 
Beware $\ $ One can employ fractions $\rm\ x\equiv b/a\ $ in modular arithmetic (as above) only when the fractions have denominator $ $ coprime $ $ to the modulus $ $ (else the fraction may not (uniquely) exist, $ $  i.e. the equation $\rm\: ax\equiv b\,\ (mod\ m)\:$ might have no solutions, or more than one solution). The reason why such fraction arithmetic works here (and in analogous contexts) will become clearer when one learns about the universal properties of fraction rings (localizations). 
The first method is a special case of Gauss's algorithm for computing inverses. This always works for prime moduli, but may fail for composite moduli (in which case one may employ the extended Euclidean algorithm to compute inverses).
A: We want to solve the congruence 
$$(7\cdot 13)x\equiv 7\cdot 12\pmod{7\cdot 21}.$$
This is equivalent to 
$$13x\equiv 12\pmod{21}.$$
We can solve the congruence by multiplying through by the inverse of $13$ modulo $21$. It is however easier to replace $13$ by $-8$. So our congruence is equivalent to $-8x\equiv 12\pmod{21}$, which is equivalent to $-2\equiv 3\pmod{1}$. But we can replace $3$ by $-18$, and reach $x\equiv 9\pmod{21}$.
Modulo the original modulus $147$, that gives the solutions $x\equiv 9\pmod{147}$, $x\equiv 30\pmod{147}$, and so on, a total of $7$ solutions modulo $147$.
Remark: I would not worry about Alpha. Though it gets the right answer quite often, it doesn't know what it is doing. 
A: Hint:
$$(1)\;\;\;\;\;91x=84\pmod{147}\iff 91x=84+147k\iff13x=12+21k\ldots$$
$$(2)\;\;\;\;\;13^{-1}=?\pmod{21}...$$
A: To supplement the numerous other answers:
Apply the Euclid-Wallis Algorithm
$$
\begin{array}{r}
&&1&1&1&1&1&2\\\hline
1&0&1&-1&2&-3&5&-13\\
0&1&-1&2&-3&5&-8&21\\
147&91&56&35&21&14&7&0
\end{array}
$$
Thus,
$$
\begin{align}
5\cdot147-8\cdot91&=7\\
-13\cdot147+21\cdot91&=0
\end{align}
$$
$12$ times the top plus $k$ times the bottom
$$
(60-13k)\cdot147+\color{#C00000}{(-96+21k)}\cdot91=84
$$
Therefore,
$$
x\equiv-96\equiv9\pmod{21}
$$
A: Solve
$\tag C 91x\equiv 84\pmod{147}$
We begin by writing down two equations,
$\tag {A0} 91 \times 1 = 84 + \color{red}{(}7\color{red}{)}$ 
$\tag Z 91 \times 2 = 147 + \color{red}{(}35\color{red}{)}$ 
Observe that if we multiply $\text{(Z)}$ by $a$ and subtract it from $\text{(A0)}$ we can write
$\tag 1 \text{A1 = A0} + a \times \text{Z} : \quad 91 \times (1 +2a) = 84 + 147 a + \color{red}{(}7 + 35a\color{red}{)}$
For a solution to exist there must be a minimum positive integer $a$ such that
$\tag 2 7 + 35a = 91q \quad \text{ for some positive integer } q$
Dividing out the factor of $7$ from both sides of $\text{(2)}$ we see that $a$ = $5$ and $q=2$ (use $\text{modulo-}13$ calculations).
Substituting back into $\text{(1)}$,
$\tag 3  91 \times (1 +10) = 84 + 147 \times 5 + \color{red}{(}91 \times 2\color{red}{)}$
or
$\tag 4  91 \times 9 = 819$
So we have a particular solution, $9 \pmod {147}$.
Solving the homogeneous equation $91z\equiv 0\pmod{147}$ is easy - factor out $7$ and recall that $13 \times 13 \equiv 1 \pmod{21}$ - to conclude that $z \equiv 0 \pmod{21}$.
So the general solution to the congruence equation $\text{(C)}$ is
$\tag{ANS} x = 9 + z \quad \text{ where } z \equiv 0 \pmod{21}$
