Let $$A = \begin{bmatrix} 1 & 0 & 2 &-1 \\ 0 & 1 & -1 & 0 \\ 0 & 0 & 0 &0 \end{bmatrix}, \qquad B = \begin{bmatrix} \frac{3}{2} &-\frac{3}{2} &0\\ \frac{3}{2} & \frac{3}{2} & 1\\ 0 & 0 & 0 \end{bmatrix}$$ Find the general solution for $AX=B$.
My textbook says we can construct new equation $CX=D$,where
$$C=\left[\begin{matrix} 1 & 0 & 2 &-1 \\ 0 & 1 & -1 & 0 \\ 0 & 0 & 1 &0 \\ 0 & 0 & 0 & 1\\ \end{matrix}\right],\qquad D=\left[ \begin{matrix} \frac{3}{2} &-\frac{3}{2} &0\\ \frac{3}{2} & \frac{3}{2} & 1\\ c_1 & c_3 & c_5\\ c_2 & c_4 & c_6\\ \end{matrix}\right]$$
where $c_1,\dots,c_6$ are any constants. Then solve this get
$$X=\left[\begin{matrix} \frac{3}{2} & -\frac{3}{2} &0\\ \frac{3}{2} & \frac{3}{2} & 1\\ 0 & 0 & 0\\ 0 & 0& 0 \\ \end{matrix}\right]+\left[ \begin{matrix}-2 & 1\\ 1&0\\1& 0\\0 & 1 \end{matrix}\right]\left[ \begin{matrix}c_1& c_3 &c_5\\ c_2 &c_4 &c_6 \end{matrix}\right]$$
I really can't see why this will work.
In terms of components, we have $$\sum_{j}A_{ij}X_{jk}=B_{ik}.$$ The matrix $X$ has $4\times 3 =12$ components, while $i$ can take values $1,2,3$ and $k$ can take values $1,2,3$, so it seems like we have $9$ equations for $12$ unknowns and will expect $3$ free constants. Then, we notice that $A_{3,j}=0$ for all values of $j$, so three of our equations give us no information and we expect $3+3=6$ free constants, as in the textbook's answer. The only equations we have with which to constrain $X$ are $\sum_{j}A_{ij}X_{jk}=B_{ik}$ for $i=1,2$ and $k=1,2,3$.
Now, does the equation $CX=D$ encompass all of the above equations? Yes! The equation $$\sum_j C_{ij}X_{jk}=D_{ik}$$ has the same constraints as $AX=B$ for $i=1,2$ and $k=1,2,3$. The free constants are incorporated into the equation in the final two rows of $D$, which guarantees that the required constraints are untouched (this is not the only possible way of doing things), so any solution of $CX=D$ for any set of constants will yield a matrix $X$ that solves the desired $6$ relations of $AX=B$.