Matrix Equation
A system of equations can be solved using matrices by writing it in the form of a matrix equation. We can also determine whether a system has a unique solution or infinite number of solutions or no solution using the matrix equation.
Let us learn how to solve matrix equations in different methods along with examples.
1.  What is Matrix Equation? 
2.  How to Write Matrix Equation? 
3.  How to Solve Matrix Equation? 
4.  Consistency of Solution of Matrix Equation 
5.  FAQs on Matrix Equation 
What is Matrix Equation?
A matrix equation is of the form AX = B where A represents the coefficient matrix, X represents the column matrix of variables, and B represents the column matrix of the constants that are on the right side of the equations in a system. Let us consider a system of n nonhomogenous equations in n variables.
a₁₁ x₁ + a₁₂ x₂ + ... + a₁ₙ xₙ = b₁
a₂₁ x₁ + a₂₂ x₂ + ... + a₂ₙ xₙ = b₂
....
aₙ₁ x₁ + aₙ₂ x₂ + ... + aₙₙ xₙ = bₙ
Then the matrix equation that corresponds to the above system is:
AX = B, where
 A = A matrix made of coefficients = \(\left[\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1 n} \\
a_{21} & a_{22} & \cdots & a_{2 n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n 1} & a_{n 2} & \cdots & a_{n n}
\end{array}\right]\)  X = Column matrix of variables = \(\left[\begin{array}{c}
x_{1} \\
x_{2} \\
\vdots \\
x_{n}
\end{array}\right]\)  B = Column matrix of constants = \(\left[\begin{array}{c}
b_{1} \\
b_{2} \\
\vdots \\
b_{n}
\end{array}\right]\)
How to Write Matrix Equation?
To write a system of equations as a matrix equation:
 Make sure that the variables are in the same order in each of the equations.
 Make sure that only the variable terms are on the left side and the constant terms are on the right side.
 Then find the coefficient matrix A, variable matrix X, and the constant matrix B to write the given system as matrix equation AX = B.
Here is an example to understand these steps.
Example: Write the following system as a matrix equation.
3x + y + 2z  10 = 0
z  3y = 5
y + x  2z = 7
Solution:
Let us get all variable terms on one side (also in order) and constants on the right side.
3x + y + 2z = 10
0x  3y + z = 5
x + y  2z = 7
Now we can write this system as:
\(\left[\begin{array}{ccc}
3 & 1 & 2 \\
0 & 3 & 1 \\
1 & 1 & 2
\end{array}\right]\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{c}
10 \\
5 \\
7
\end{array}\right]\)
This is the matrix equation of the given system which alternatively can be written as AX = B where, A = \(\left[\begin{array}{ccc}
3 & 1 & 2 \\
0 & 3 & 1 \\
1 & 1 & 2
\end{array}\right]\), X = \(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]\), and B = \(\left[\begin{array}{c}
10 \\
5 \\
7
\end{array}\right]\).
How to Solve Matrix Equation?
Let us solve the matrix equation AX = B for X. For this, we left multiply both sides of the equation by the inverse of A (that can be written as A^{1}).
A^{1} (AX) = A^{1} B
We know that A^{1}A = I, where I is the identity matrix of the same order as A.
IX = A^{1}B
We also know that IX = X.
X = A^{1}B
This gives the solution of the matrix equation. This is also known as inverse matrix equation and hence the process of using the above formula to solve a system of equations is known as the "inverse matrix method". Thus, here are the steps to solve a system of equations using matrices:
 Write the system as matrix equation AX = B.
 Find the inverse, A^{1}.
 Multiply it by the constant matrix B to get the solution. i.e., X = A^{1}B.
We can see the examples of solving a system using these steps in the "Matrix Equation Examples" section below.
Consistency of Solution of Matrix Equation
We know that we can find the inverse of a matrix only when it is nonsingular. i.e., A^{1} exists only when det (A) ≠ 0. Thus, the solution (X = A^{1}B) exists and it is unique only when det (A) ≠ 0.
In case, if det (A) = 0, how can we know how many solutions a system may have? In this case, we have to find (adj A) B, where adj A stands for "adjoint of A".
 If (adj A) B ≠ O, then the system has no solution and hence the system is said to be inconsistent.
 If (adj A) B = O, then the system may be "consistent with an infinite number of solutions" or "inconsistent (no solution)".
Here, 'O' is a null matrix. This is summarized in the flowchart below.
☛ Related Topics:
Matrix Equation Examples

Example 1: Write the following system of equations in terms of matrices: 2y  3x = 2; 5x  2y  7 = 0.
Solution:
Let us write the variables on the left and constants on the right side of the equation. Also, let us maintain the same order of variables in every equation.
3x + 2y = 2
5x  2y = 7Now, the coefficient matrix is, A = \(\left[\begin{array}{ll}
3 & 2 \\ \\
5 & 2
\end{array}\right]\).The variable matrix is, X = \(\left[\begin{array}{ll}
x \\ \\
y
\end{array}\right]\).The constant matrix is, B = \(\left[\begin{array}{ll}
2 \\ \\
7
\end{array}\right]\).Thus, the matrix equation is:
\(\left[\begin{array}{ll}
3 & 2 \\ \\
5 & 2
\end{array}\right]\) \(\left[\begin{array}{ll}
x \\ \\
y
\end{array}\right]\) = \(\left[\begin{array}{ll}
2 \\ \\
7
\end{array}\right]\).Answer: The system of equations is written in matrix form.

Example 2: Using the matrix equation found in Example 1, find the solution of the given system.
Solution:
From Example 1,
A = \(\left[\begin{array}{ll}
3 & 2 \\ \\
5 & 2
\end{array}\right]\).Using the formula of the inverse of 2x2 matrix,
A^{1} = 1 / (6  10) \(\left[\begin{array}{ll}
2 & 2 \\ \\
5 & 3
\end{array}\right]\)= 1/4 \(\left[\begin{array}{ll}
2 & 2 \\ \\
5 & 3
\end{array}\right]\)= \(\left[\begin{array}{ll}
1/2 & 1/2 \\ \\
5/4 & 3/4
\end{array}\right]\)The solution of the given system is,
X = A^{1}B
=\(\left[\begin{array}{ll}
1/2 & 1/2 \\ \\
5/4 & 3/4
\end{array}\right]\) \(\left[\begin{array}{ll}
2 \\ \\
7
\end{array}\right]\)= \(\left[\begin{array}{ll}
(1/2) (2) + (1/2) (7) \\ \\
(5/4)(2) + (3/4) (7)
\end{array}\right]\)= \(\left[\begin{array}{ll}
5/2 \\ \\
11/4
\end{array}\right]\)= \(\left[\begin{array}{ll}
x \\ \\
y
\end{array}\right]\)Answer: The solution is x = 5/4 and y = 11/4.

Example 3: Is the system that is solved in Example 2 consistent or inconsistent? How many solutions does it have? Justify your answer with another method.
Solution:
In Example 2, we have seen that the system has only one solution.
Since it has at least one solution, the system is consistent.
We can justify this using the determinant.
We have A = \(\left[\begin{array}{ll}
3 & 2 \\ \\
5 & 2
\end{array}\right]\).det (A) = (3)(2)  (5)(2) = 6  10 = 4 ≠ 0.
When det (A) ≠ 0, the system has a unique solution.
Answer: Consistent with a unique solution and the answer is justified using determinants.
FAQs on Matrix Equation
What is the Definition of Matrix Equation?
A matrix equation is of the form AX = B and it is writing the system of equations as a single equation in terms of matrices. Here,
 A = A matrix formed by the coefficients
 X = A column matrix formed by the variables
 B = A column matrix formed by the constants
How to Solve Matrix Equation AX = B?
To solve a matrix equation AX = B:
 Find A^{1} (using the formula A^{1} = (adj A) / (det A).
 Find the solution using X = A^{1} B.
How to Solve System of Equations Using Matrix Equation?
To solve a system of equations using matrices:
 First, write all the variables on one side and the constants on the other side of the equations. Also, write the variables in the same order in every equation.
 Write the system in the form AX = B by writing all coefficients of variables in matrix A, all variables as a column in matrix X, and all constants in a column in matrix B.
 Find the solution using X = A^{1} B.
What are the Methods Used to Solve a Matrix Equation?
Here are the methods to solve a matrix equation AX = B.
 Matrix inversion method (using the formula X = A^{1} B)
 Cramer's rule. Click here to learn about it.
 Gauss Jordan method.
How to Write a System of Equations as a Matrix Equation?
We can write a system of equations as a matrix equation AX = B. Here are the steps for the same:
 Maintain the order of the variables to be the same in all the equations.
 Get all variables to the left side and send the constants to the right side of every equation.
 Write the matrix A with all the coefficients of variables, where each row of A represents the coefficients of variables in one equation.
 Write the matrix X with variables in order as a column.
 Write the matrix B with constants in order as a column.
How Many Solutions a Matrix Equation Has?
A matrix equation AX = B has:
 a unique solution (consistent) if det (A) ≠ 0.
 no solution (inconsistent) if det (A) = 0 and (adj A) B ≠ O.
 infinite solutions (consistent) or no solution (inconsistent) if det (A) = 0 and (adj A) B = O.
Here, O is the null matrix.
What is the Relation Between Matrix Equation and Rank of a Matrix?
For a matrix equation AX = B, [A B] represents the augmented matrix. Let r(A) and r(A, B) represent the ranks of matrices A and [A B].
 If r(A) = r(A, B) = number of variables, then the system is consistent and has unique solution.
 If r(A) = r(A, B) < number of variables, then the system is consistent and has infinitely many solutions.
 If r(A) ≠ r(A, B), then the system is inconsistent and has no solution.
visual curriculum