What a Coefficient Matrix Records
A system of linear equations can be recorded compactly once the variables have a fixed order. The coefficient matrix keeps the coefficients of those variables and arranges them in rows, one row for each equation. It does not include the constant on the right side of an equation. This makes the matrix a record of the variable terms, not a complete replacement for the whole system.
For example, if the chosen variable order is \(x,y\), then the equation \(3x-2y=7\) contributes the row \(\begin{bmatrix}3&-2\end{bmatrix}\). The first entry belongs to \(x\), and the second belongs to \(y\). The \(7\) is not a coefficient of either variable, so it is not an entry of this row. If an equation has no \(x\)-term, its coefficient of \(x\) is \(0\), and the row must include that zero.
The variable order is essential information. The first column represents the first variable in the order, the second column represents the second variable, and so on. A matrix without its variable order can be ambiguous: the same row of numbers can describe different variable terms if the columns are interpreted differently.
There are \(m\) rows because there are \(m\) equations, and \(n\) columns because there are \(n\) ordered variables. This shape is a useful first check. A system of three equations in two variables must produce a \(3\times2\) coefficient matrix, even if some coefficients are zero.
A Reliable Construction Method
To build the matrix, first write down the variable order and keep it fixed. Then put each equation into a form where all variable terms are on the left and the constant is on the right. For each equation, read the coefficient of each variable in the chosen order. Use \(0\) for a missing variable, preserve negative signs and fractions, and place the resulting list in one row. Do not add a column for the constants.
For instance, state explicitly that the order is \(x,y,z\). This fixes what each column means.
Collect variable terms on the left and leave the constant on the right, so the coefficients can be read consistently.
Write exactly one coefficient for each variable, in the fixed order. Include zero entries for absent variables.
Multiply the proposed matrix by the column of variables. Each resulting component should reproduce the left-hand side of the corresponding equation.
The final check uses the definition of matrix-vector multiplication. If \(\mathbf{x}=\begin{bmatrix}x_1&\cdots&x_n\end{bmatrix}^{\top}\), then the \(i\)th entry of \(\mathbf{A}\mathbf{x}\) is \(a_{i1}x_1+\cdots+a_{in}x_n\), exactly the variable expression from equation \(i\). This check tests the row contents and their order; it does not solve the system.
Proof. Let the system have \(m\) equations, with equation \(i\) written as \(a_{i1}x_1+\cdots+a_{in}x_n=b_i\). By the definition of the coefficient matrix, row \(i\) is \(\begin{bmatrix}a_{i1}&\cdots&a_{in}\end{bmatrix}\), so it contains \(n\) entries, one for each variable. There are \(m\) such rows, so the matrix has \(m\) rows and \(n\) columns. By the definition of matrix-vector multiplication, the \(i\)th entry of \(\mathbf{A}\mathbf{x}\) is the dot product of row \(i\) with \(\mathbf{x}\), namely \(a_{i1}x_1+\cdots+a_{in}x_n\). This is the variable expression on the left side of equation \(i\). Since this holds for each \(i=1,\dots,m\), the product lists all those expressions in equation order. \(\square\)
Worked Two-Variable System
Worked Example: Missing Variable and Negative Coefficient
Construct the coefficient matrix for the system below using the variable order \(x,y\).
The first equation has coefficient \(3\) for \(x\) and coefficient \(-2\) for \(y\), so its row is \(\begin{bmatrix}3&-2\end{bmatrix}\). The second equation has no \(x\)-term, so its \(x\)-coefficient is \(0\); its \(y\)-coefficient is \(1\), so its row is \(\begin{bmatrix}0&1\end{bmatrix}\). Therefore the coefficient matrix is
Check the rows by multiplying by the ordered variable vector:
These are precisely the variable expressions on the left sides of the original equations. The constants \(7\) and \(4\) do not appear in this coefficient matrix.
Worked Three-Variable System
Worked Example: Zero Entries in a Three-Variable Matrix
Construct the coefficient matrix using the variable order \(x,y,z\).
Read the coefficients in the order \(x,y,z\). The first equation gives \((2,1,-3)\). The second equation has no \(y\)-term, giving \((-1,0,4)\). The third gives \((\tfrac12,-1,2)\). With one row per equation, the matrix is
To check, multiply by the column of variables in the same order:
Each component matches the variable expression in the corresponding equation. The zero in row 2, column 2 is needed to preserve the meaning of the \(y\)-column.
Changing the Variable Order
A different variable order is allowed, but all rows and the variable vector must use that same order. Changing the order changes the positions of the coefficients in every row. It does not change the equations themselves.
Proof. Suppose the new ordered variables are \(u_1,\dots,u_n\), where each \(u_j\) is one of the original variables, with each original variable appearing exactly once. In equation \(i\), let \(c_{ij}\) be the coefficient of \(u_j\). The row formed in the new order is \(\begin{bmatrix}c_{i1}&\cdots&c_{in}\end{bmatrix}\), and the new variable column is \(\begin{bmatrix}u_1&\cdots&u_n\end{bmatrix}^{\top}\). Their product is \(c_{i1}u_1+\cdots+c_{in}u_n\). Since the \(u_j\) are exactly the same variables as before, only reordered, this sum contains exactly the same variable terms as equation \(i\). Repeating this for each row preserves the order of the equations and reproduces all their variable expressions. \(\square\)
Worked Example: A Deliberately Different Variable Order
Construct the coefficient matrix using the variable order \(z,x,y\) for the following equations:
First collect the variable terms on the left. The equations become \(z+2x-3y=8\), \(-2z+4y=6\), and \(3z-x=1\). Now read each equation in the order \(z,x,y\). The rows are \((1,2,-3)\), \((-2,0,4)\), and \((3,-1,0)\), respectively. Thus
The subscript on \(\mathbf{x}_{\mathrm{ord}}\) here simply reminds us that this variable column is ordered as \(z,x,y\), not \(x,y,z\). Multiplying checks the construction:
The result matches the rearranged left sides, in the same equation order. The constants \(8,6,1\) are not included.
Common Mistake: Reading Columns in a Different Order
Suppose the system is \(x+2y=5\), \(3x-y=4\), and the stated variable order is \(y,x\). A common mistake is to write the rows in the familiar order \(x,y\), producing the incorrect matrix \(\begin{bmatrix}1&2\\3&-1\end{bmatrix}\) while still treating the columns as \(y,x\). Multiplying that matrix by \(\begin{bmatrix}y\\x\end{bmatrix}\) gives \(\begin{bmatrix}y+2x\\3y-x\end{bmatrix}\), which does not reproduce the system’s left sides.
With the required order \(y,x\), the first equation has coefficients \(2,1\), and the second has coefficients \(-1,3\). The correct matrix is
Indeed, multiplying by the variable column in the stated order gives
The correction is not to change the equations or the chosen variable order, but to move each coefficient to the column assigned to its variable. Another related error is to place constants in the coefficient matrix. Constants are not coefficients of the variables, so they do not belong there.
Why the Construction Is Useful
A coefficient matrix gives a consistent way to organize a system, especially when equations contain different variables, negative signs, or missing terms. Its rows preserve equation order, and its columns preserve variable order. With those conventions fixed, the product of the matrix and the variable column reconstructs every left-hand side. That connection is the main check on a translation: if the product gives even one wrong variable expression, some coefficient has been omitted, misplaced, or given the wrong sign.
Keep the distinction between coefficients and constants clear. The matrix records the coefficients of the variables only; the equations also contain right-hand-side constants, which are part of the system but not part of its coefficient matrix. When constructing a matrix, label the variable order before reading coefficients, include zeros for missing variables, and check the product row by row.
Check Your Understanding
For each question, write the variable order explicitly and check your proposed rows by multiplying by the corresponding variable column.
- Construct the coefficient matrix for \(2x-y=3\), \(x+4y=-1\), using the order \(x,y\).
- Construct the coefficient matrix for \(y-2z=5\), \(3x+z=0\), using the order \(x,y,z\). Which entries are zero?
- For \(4x+y=2\), \(-x+3y=7\), write the coefficient matrix using the order \(y,x\).
- Explain why the equation \(5z=9\) contributes a zero coefficient for \(x\) and for \(y\) when the order is \(x,y,z\).
- A proposed row is \(\begin{bmatrix}2&-1&0\end{bmatrix}\) for an equation in \(x,y,z\). What variable expression does this row produce when multiplied by \(\begin{bmatrix}x&y&z\end{bmatrix}^{\top}\)?