Solving $ax+b$ (mod n) = $cx+d$ (mod n) How does one solve questions of $ax+b$ (mod n) = $cx+d$ (mod n) form?
I know that if $b,d$ are $0$ then, I can take multiples of $n$ as solutions for x.
but what if $b,n$ are not zero? 
Under what conditions do solutions exist?
 A: What you've written is essentially $ax + b \equiv cx + d \pmod n$ (as mentioned in a comment).
You can rearrange to: $(a-c)x \equiv (d-b) \pmod n$, which gives the solution $x \equiv (d-b)(a-c)^{-1} \pmod n$, where $(a-c)^{-1}$ is the Modular Multiplicative Inverse of $a-c$ modulo $n$ (if it exists). The modular inverse exists if and only if $a-c$ is coprime to $n$.
A: $$ ax + b \pmod n \equiv cx + d \quad \pmod n $$
$$ (a - c)x \equiv d-b \pmod n$$
$$ Ax \equiv B \quad \pmod n$$
where $A  = a-c, \; B = d - b$. Thus,
1) If $ a \equiv c \pmod n$:


*

*If $b \equiv d \pmod n$: $x$ is any integer.

*Otherwise, no solution.


2) If $a \not\equiv c \pmod n$:


*

*If $A$ has a multiplicative inverse$\pmod n$ called C, the solution will be:
$ x \equiv BC \pmod n$.

*Otherwise, no solution.


Note the multiplicative inverse$\pmod n$ can be found by tabulating the product of $ij$ in a square table where the rows are numbered $i = 0,1,...,n-1$ and the columns are numbered $j=0,1,...n-1$. To find the multiplicative inverse of each $i$, find the value of $j$ that makes $ij \equiv 1\pmod n$. In general, not all $i$ have a multiplicative inverse.
