A system of linear equations is a set of linear equations with the same variables (unknowns). Systems of linear equations are used in many areas of science and engineering, such as data science and analysis. In this post, we discuss systems of linear equations and how to solve them with some examples. First we discuss linear equations.

#### Linear equations

Let us recall that in single-variable calculus, by a linear function (not to be confused with the concept of linear functions in linear algebra), we mean a real-valued function \(f\) defined by $$f(x) = ax+b,$$ where \(a\) and \(b\) are real fixed numbers independent of the variable \(x\). It is evident that a linear equation with one unknown \(x\) is a polynomial equation of degree one, i.e., an equation of the following form: $$ax+b = 0.$$ The fixed number \(a\) is the coefficient of the variable \(x\). The standard form of a linear equation is $$ cx = d,$$ where \(c\) is the coefficient of \(x\) and \(d\) is the constant term.

A linear equation with some unknowns \(x_i\)s is any equation of the form $$a_1 x_1 + \dots + a_n x_n + b = 0,$$ where \(a_i\)s and \(b\) are real fixed numbers. The standard form is as follows: $$c_1 x_1 + \dots + c_n x_n = d$$ where the coefficients \(c_i\)s of the variables \(x_i\)s are on the left side of the equation and the constant term \(d\) on the right side.

**Remark** (for readers familiar with the dot product). If $$x = (x_1, \dots, x_n)$$ is an unknown vector in \(\mathbb{R}^n\), $$a = (a_1, \dots, a_n)$$ is a given vector in \(\mathbb{R}^n\), and \(b\) is a real number, a linear equation can be interpreted as the following vector equation: $$a \cdot x + b = 0.$$

**Example**. The following equation $$2x+5y = 7$$ is an example of a linear equation with the two unknowns \(x\) and \(y\) in its standard form. In the language of “dot product”, the equation is as follows: $$(2,5) \cdot (x,y) = 7.$$

#### Systems of linear equations and their solution sets

A system of linear equations is a set of linear equations with the same variables (unknowns). For example, the following is a system of linear equations with two equations and three unknowns:

$$ \begin{array}{lr}

& 3x & + & 5y & + & z & = & 3\\

& 7x & – & 2y & + & 4z & = & 4

\end{array} $$

The set of all ordered real numbers \((s_1, s_2, s_3)\) satisfying the above equations is the solution set of the given system. Two linear systems are “equivalent” if they have the same solution set.

#### How to solve systems of linear equations

In this section, we will demonstrate how to solve systems of linear equation. We are going to start our discussion by solving the following system of linear equations with two equations and two variables (unknowns):

$$ \begin{array}{lr}

& 3x & + & 5y & = & 3\\

& 7x & – & 2y & = & 4

\end{array} $$

It is essential to remember that whenever a linear equation of a system is given, we need to convert it into its standard form.

$$ \begin{array}{lr}

& 6x & + & 10y & = & 6\\

& 35x & – & 10y & = & 20

\end{array} $$

Here, we add the first equation to the second one and the variable \(y\) is eliminated and we obtain a linear equation with the variable \(x\): \(41 x = 26.\) It is clear that \(x = \frac{26}{41}\). Now, we substitute \(x\) by \(\frac{26}{41}\), for example, in the first original equation and obtain the following equation:

$$3 \times \frac{26}{41} + 5y = 3,$$ and so, \(y = \frac{9}{41}.\)

#### An example of a system with three linear equations in three variables

The procedure for solving a system of linear equations with three equations and three variables is usually longer. In order to continue our discussion, here is an example that we can use:

$$ \begin{array}{lr}

& 4x & – & 3y & + & z & = & -10\\

& 2x & + & y & + & 3z & = & 0\\ & -x & + & 2y & + & -5z & = & 17

\end{array} $$

We pick a pair of equations, say, the first and second:

$$ \begin{array}{lr}

& 4x & – & 3y & + & z & = & -10\\

& 2x & + & y & + & 3z & = & 0

\end{array} $$

By multiplying the first equation by \(-3\) and adding the obtained equation to the second one, the variable \(z\) is eliminated and we have the following equation:

$$- 10 x +10 y = 30.$$

Then, we pick another pair of equations, say, the second and third ones. Again, we eliminate the variable \(z\) and obtain the following equation:

$$7x + 11 y = 51.$$

From the latter equations, we see that \(x = 1\) and \(y = 4\). By substituting these values in one of the original equations, \(z\) is also obtained and the solution set is: $$(x,y,z) = (1,4, -2).$$

#### Matrix notation for systems of linear equations

In a system of linear equations, the essential information is the coefficients of variables and the constant term in each equation. The coefficients are collected in rows of a matrix, called the matrix of coefficients (or coefficient matrix), exactly in the same order as they appear in the given system. If we need to bring the constant terms to the same place, we may add a column to the matrix of coefficients. As a result, we will obtain an updated matrix called the augmented matrix of the system.

**Remark**. The adjective “augmented” means “having been made greater in size or value”.

In order to demonstrate our points, we provide an example. The coefficient matrix of the following system of equations

$$ \begin{array}{lr}

& 4x & – & 3y & + & z & = & -10\\

& & & y & + & 3z & = & 0\\ & -x & & & & -5z & = & 17

\end{array} $$ is the \(3 \times 3\) matrix: $$\begin{pmatrix} 4 & -3 & 1\\ 0 & 1 & 3\\ -1 & 0 & -5 \end{pmatrix}$$ and the augmented matrix is $$\begin{pmatrix} 4 & -3 & 1 & -10\\ 0 & 1 & 3 & 0\\ -1 & 0 & -5 & 17 \end{pmatrix}.$$ Note that if a system of linear equations has \(m\) equations and \(n\) variables, then the size of the coefficient matrix is \(m \times n\) and the augmented matrix has one more column, and so, its size is \(m \times (n+1)\).

#### Systems of linear equations are linear matrix equations

Consider the following general system of linear equations:

$$ \begin{array}{lr}

& a_{11}x_1 & + & \cdots & + & a_{1n} x_n & = & b_1 &\\

& a_{21}x_1 & + & \cdots & + & a_{2n} x_n & = & b_2 \\ & \vdots & + & \cdots & + & \vdots & = & \vdots \\ & a_{m1}x_1 & + & \dots & + & a_{mn} x_n & = & b_m

\end{array} $$ The matrix of coefficients of the above system is $$A = \begin{pmatrix} a_{11} & \cdots & a_{1n} \\ a_{21} & \cdots & a_{2n} \\ \vdots & \cdots & \vdots \\ a_{m1} & \cdots & a_{mn}\end{pmatrix}. $$ The vector of variables and constant terms are: $$ X = \begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix} \text{ and } b = \begin{pmatrix} b_1 \\ \vdots \\ b_m \end{pmatrix}.$$ Therefore, the given system is nothing but the following linear matrix equation: $$AX = b.$$