# How solve system of linear equations

How to solve system linear of equations? I'm so confused I don't know how to find the result. $$\begin{array}{rcr} 2p - 2q - r + 3s &=& 4 \\ p - q +2s &=& 1 \\ -2p +2q -4s &=& -2 \end{array}$$ Thank you.

We can use Gauss-Jordan elimination. The operations are \begin{align*} \left[\begin{array}{rrrr|r} 2 & -2 & -1 & 3 & 4 \\ 1 & -1 & 0 & 2 & 1 \\ -2 & 2 & 0 & -4 & -2 \end{array}\right] \xrightarrow{(1/2)\cdot R_{1}\to R_{1}}\left[\begin{array}{rrrr|r} 1 & -1 & -\frac{1}{2} & \frac{3}{2} & 2 \\ 1 & -1 & 0 & 2 & 1 \\ -2 & 2 & 0 & -4 & -2 \end{array}\right] \\ \xrightarrow{ \begin{array}{rcr} R_{2}-R_{1} &\to& R_{2} \\ R_{3}+2\cdot R_{1} &\to& R_{3} \\ \end{array}}\left[\begin{array}{rrrr|r} 1 & -1 & -\frac{1}{2} & \frac{3}{2} & 2 \\ 0 & 0 & \frac{1}{2} & \frac{1}{2} & -1 \\ 0 & 0 & -1 & -1 & 2 \end{array}\right] \\ \xrightarrow{2\cdot R_{2}\to R_{2}}\left[\begin{array}{rrrr|r} 1 & -1 & -\frac{1}{2} & \frac{3}{2} & 2 \\ 0 & 0 & 1 & 1 & -2 \\ 0 & 0 & -1 & -1 & 2 \end{array}\right] \\ \xrightarrow{ \begin{array}{rcrcr} R_{1}+1/2\cdot R_{2} &\to& R_{1} \\ R_{3}+R_{2} &\to& R_{3} \\ \end{array}}\left[\begin{array}{rrrr|r} 1 & -1 & 0 & 2 & 1 \\ 0 & 0 & 1 & 1 & -2 \\ 0 & 0 & 0 & 0 & 0 \end{array}\right] \end{align*} These steps show that $$\operatorname{rref}\left[\begin{array}{rrrr|r} 2 & -2 & -1 & 3 & 4 \\ 1 & -1 & 0 & 2 & 1 \\ -2 & 2 & 0 & -4 & -2 \end{array}\right]=\left[\begin{array}{rrrr|r} 1 & -1 & 0 & 2 & 1 \\ 0 & 0 & 1 & 1 & -2 \\ 0 & 0 & 0 & 0 & 0 \end{array}\right]$$ The variables $$\{p, r\}$$ correspond pivot columns and are called "dependent" variables. The other variables $$\{q, s\}$$ are called "free" variables. To find the general solution to the system, we write each dependent variable in terms of the free variables. This gives $$\left[\begin{array}{r} p \\ q \\ r \\ s \end{array}\right] = \left[\begin{array}{r} q - 2 \, s + 1 \\ q \\ -s - 2 \\ s \end{array}\right] = \left[\begin{array}{r} 1 \\ 0 \\ -2 \\ 0 \end{array}\right]+q\left[\begin{array}{r} 1 \\ 1 \\ 0 \\ 0 \end{array}\right]+s\left[\begin{array}{r} -2 \\ 0 \\ -1 \\ 1 \end{array}\right]$$