# Solving the equation $ax + c \equiv b \mod {n}$

Alright, I can go through and solve equations that do not have the "$+ c$" involved, i.e.: $ax \equiv b \mod{n}$. However, I do not know what to do when a "$+ c$" is incorporated. How does that $c$ affect the final answer / the process?

My best guess would be when pulling back to integers, without "$+ c$" you would get: $ax + ny = b$.

So do I simply need to subtract the c and move it to the right hand side? $ax + ny = b - c$.

Sean

-

Just subtract it to begin with: $$ax\equiv d\pmod n$$ where $d=b-c$, reducing it to a problem already solved.
$\begin{array}{rrl} &\rm a+b &\equiv&\rm c\qquad\quad\ \rm(mod\ n) \\ \qquad\qquad\qquad\iff &\rm\ \ a+b &=&\rm c\quad\ \ \ +\ \ \ \quad k\ n &\rm for\quad k\in\mathbb Z \\ \iff &\rm\ \ a &=&\rm c\!-\!b\ \ \ +\ \ \ k\ n &\rm for\quad k\in\mathbb Z \\ \iff &\rm\ \ a &\equiv&\rm c\!-\!b\:\ \ \ \rm (mod\ n) \end{array}$