I am trying to figure out the set of all integer solutions in terms of an appropriate number of free variables for the following:
$2x_1 + 12x_2 + 3x_3 = 7$.
I have found that the $gcd(2,12,3) = 1$ and $1 | 7$ so I know there are infinitely many solutions. However, I do not understand how to find the set of all integer solutions from here. I understand how to solve these problems for the case where there are only two variables however I do not understand how to apply the extended Euclidean algorithm to the greater-than-two variable case.
Thank you in advance.
Recall the following
Note that you can rewrite your equation as $$ 2 x_1 + 12 x_2 + 3 x_3 = 2 x_1 + 3 ( 4x_2 + x_3) = 7 \label{eq:orig} \tag{1} $$ In particular, every solution $(x_1,x_2,x_3)$ of \eqref{eq:orig} gives you a solution $(x_1, y = 4x_2 + x_3)$ of $$ 2 x_1 + 3 y = 7 \label{eq:partial_1} \tag{2} $$ thus we will first solve this other equation and then for each of these solutions we will look for the corresponding solution of \eqref{eq:orig}, if there are any.
Observe that $(2,3) = 1$, thus \eqref{eq:partial_1} has infinitely many solutions. Furtehrmore, $x_1 = 2, y = 1$ is a particular solution of \eqref{eq:partial_1}, hence from Fact 1 you know that every solution of \eqref{eq:partial_1} is of the form $$ x_1 = 3s + 2 \quad y = -2s + 1 \qquad \forall s \in \Bbb{Z} $$ Now, for any fixed $s$ we go on and solve the equation $$ 4 x_2 + x_3 = -2s + 1 \label{eq:partial_2} \tag{3} $$ Again, observe that $(4,1) = 1$ and that $x_2 = -s$, $x_3 = 2s + 1$ is a particular solution of \eqref{eq:partial_2}. Hence it follows from Fact 1 that the general solution is of the form $$ x_2 = t - s \quad x_3 = -4t + 2s + 1 \qquad \forall t \in \Bbb{Z} $$ Putting it together, we conclude that the general solution of \eqref{eq:orig} is of the form $$ x_1 = 3s + 2 \quad x_2 = t - s \quad x_3 = -4t + 2s + 1 \qquad \forall s,t \in \Bbb{Z} $$