Solving system of Congruences with Two Variables (x and y) I know a bit about the Chinese Remainder theorem but what do I do in the case I was asked to solve a system of congruences such as this with two variables:
$3x + y = 7$ (mod 8)
$4x + 3y = 1$ (mod 8)
 A: Approach these equations as you would equations over $\mathbb R$.
Multiply the first by $3$ to get $x+3y\equiv5\pmod 8$.
Then subtract that from $4x+3y\equiv1\pmod 8$ to get $3x\equiv1-5\equiv9-5=4\pmod8$.
Multiply by the inverse of $3$ (which is $3\pmod8$) to get $x\equiv4\pmod 8$.
Now can you solve for $y$ given $3x+y\equiv7\pmod8$?
A: Solve the system of equations without the $\pmod 8$. You will get $x = 4, y = -5$.
A: The first equation is in a form suggesting substitution method as you have $y$ with coefficient $1$:


*

*$y \equiv 7-3x \pmod 8$
Plug this into the second equation and solve for $x$:
$$4x + 3(7-3x) \equiv 4x +21 -9x \stackrel{21=16+5}{\equiv} -5x +5 \equiv 1 \pmod 8$$
Now, note that the $5^2 \equiv (24+1) \equiv 1 \pmod 8$. Using this you get
$$\Leftrightarrow 5x \equiv 4 \pmod 8 \stackrel{\cdot 5}{\Leftrightarrow} \boxed{x =} 20 \equiv \boxed{4 \pmod 8}$$
Plugging this back into the equation $y \equiv 7-3x\pmod 8$ gives
$$\boxed{y=} 7-3\cdot 4 \equiv -5 \equiv \boxed{3 \pmod 8}$$
A: Cramer's rule ($\rm\color{#0a0}{scale}$ by $\color{#c00}{\rm adjugate}$) works over any commutative ring (here $\Bbb Z/8 = $ integers $\!\bmod 8)$ 
$\qquad\quad\ \begin{align} \rm\color{#c00}{\begin{bmatrix}\rm 3 &\!\!\! \rm -1 \\ \!\!\rm -4 & \rm 3 \end{bmatrix}} {\bf \color{#0a0}\times} &\, \left\{\, \begin{bmatrix}\rm 3 & \rm 1 \\ \rm 4 & \rm 3 \end{bmatrix} \begin{bmatrix} \rm x \\ \rm y \end{bmatrix} \,\equiv\, 
\begin{bmatrix}\rm 7 \\ \rm 1\end{bmatrix}\, \right\}\\[.2em] 
\Longrightarrow &\,\qquad\qquad\,  
\begin{array}\ 
\rm\ 5\ x\   \equiv\, \ \ \rm \color{#c00}3\cdot 7 \color{#c00}{- 1}\cdot 1\, \equiv\ \ \  20\iff x\equiv\, 4\\ 
\rm\ 5\ y\ = \rm \color{#c00}{-4}\cdot 7 + \color{#c00}1\cdot 3 \,\equiv -25\!\iff y\equiv -5\end{array}^{\phantom{|}} \end{align}$
$ \begin{align}{\rm using}\ \ \ \rm\color{#c00}{\begin{bmatrix}\rm d &\!\!\! \rm -b \\ \!\!\rm -c & \rm a \end{bmatrix}} {\bf \color{#0a0}\times} &\, \left\{\, \begin{bmatrix}\rm a & \rm b \\ \rm c & \rm d \end{bmatrix} \begin{bmatrix} \rm x \\ \rm y \end{bmatrix} \,=\, \begin{bmatrix}\rm X \\ \rm Y\end{bmatrix}\, \right\}\\[.2em] 
\Longrightarrow &\,\qquad\qquad\,  \begin{array}\ \rm\Delta\ x\   =\, \ \ \rm \color{#c00}d\ X \color{#c00}{- b}\ Y \\ \rm\Delta\ y\ = \rm \color{#c00}{-c}\ X + \color{#c00}a\ Y \end{array}^{\phantom{|}} ,\ \ \ \ \rm \Delta\ :=\ \color{#c00}{ad-bc} \end{align}$
Beware $ $ The determinant $\Delta = 5\,$ is invertible $\!\bmod 8$ so we can cancel it to (uniquely) solve for $x$ and $y$. If it is not coprime to the modulus then it is not invertible so we need to be more careful, and there may  be zero or multiple solutions. The same caveat holds if you instead perform  (Gaussian) elimination, where scaling an equation need not yield an equivalent equation if the scale factor is not invertible. Thus you cannot generally "solve as you do in $\Bbb R$" as suggested elsewhere on this page  (but that is true for prime moduli $p$ where $\,\Bbb Z/p\,$ is a field like $\Bbb R,\,$ i.e. nonzero elements are invertible).
