# Matrix Method

If you tried solving any math problem without knowing the exact formula or method, you may get confused. Surely the question that once pops into your mind or might come is if it is fine to quit this question. Some students memorize formulas and rules to complete many math problems, but this does not mean they are good in the subject. Math is all about the understanding and practice. Mostly students feel solving linear equation using matrix method is more complicated than any other methods. This mind set might be because of various reasons. We have explained step by step how to solve linear equations using matrix. At the end of this section, you understand the underlying concepts behind what you are doing. Matrix method might be your first preference to solve problems based on linear equations.

## What is Matrix Method?

Like any other methods such as substitution method, elimination method etc, Matrix Method is also used for solving systems of linear equations. This method also called as "Cramer's Rule".  Before you move ahead advise to know about system of linear equations and get master to find the inverse of a matrix.

## Solving Systems of Equations by Matrix Method

The linear equation system can be solved by using the matrix method. Consider a system of linear equations with three variables:
$a_1$ x + $b_1$y + $c_1$z = $d_1$
$a_2$ x + $b_2$ y + $c_2$ =  $d_2$ and
$a_3$ x + $b_3$ y + $c_3$ =  $d_3$

Let us suppose we have a system of linear equations. Let $A$ be the square matrix, made by coefficients of given system and $B$ be a column matrix that is obtained from the constant terms in the equations. Then, we may write

$A\ X$ = $B$ ; where $X$ is the column matrix of variables of given linear equations.

So we have

$X$ = A$^{-1}\ B$

Using this concept, a set of linear equations can be solved via finding the inverse of the coefficient matrix.

Step 1 : Find the cofactor matrix of coefficient matrix $A$ formed from the given system.

Step 2 : Write its transpose matrix by interchanging the rows elements by column elements. This is called adjoint matrix of $A$ or $adj(A)$.

Step 3 : Calculate the determinant of $A$ i.e. $|A|$.

Step 4 : Divide $adj(A)$ by $|A|$ to find the inverse, since we have the following formula for inverse :

$A^{-1}$ = $\frac{adj(A)}{|A|}$

Step 5 : Now, multiply $A^{-1}$ and $B$, we will get a column matrix.

Step 6 : Compare the elements of this matrix by matrix $X$, we will obtain the values of our variables.

## Examples

Example: Solve the linear system using matrix method.
5x + y = 13
3x + 2y = 5

Solution:
$\begin{bmatrix} 5 & 1\\ 3 & 2\end{bmatrix} \begin{bmatrix} x\\ y\end{bmatrix} = \begin{bmatrix} 13\\ 5 \end{bmatrix}$

i.e $A\ X$ = $B$

Now, A = $\begin{bmatrix} 5 & 1\\ 3 & 2 \end{bmatrix}$

$cof(A)$ = $\begin{bmatrix} 2 & -3\\ -1 & 5\end{bmatrix}$

$Adj(A)$ = Transpose of $cof(A)$

= $\begin{bmatrix} 2 & -1\\ -3 & 5\end{bmatrix}$

Determinant of A = |A| = 10 - 3 = 7

$A^{-1}$ = $\frac{adj(A)}{|A|}$

= $\frac{1}{7}$ $\begin{bmatrix} 2 & -1\\ -3 & 5 \end{bmatrix}$

X = $A^{-1}\ B$

$\begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} \frac{2}{7} & -\frac{1}{7}\\ -\frac{3}{7} & \frac{5}{7} \end{bmatrix} \times \begin{bmatrix} 13\\ 5 \end{bmatrix}$ = $\begin{bmatrix} \frac{21}{7}\\ \frac{-14}{7} \end{bmatrix}$

$\begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 3\\ -2 \end{bmatrix}$

On comparing we get, x = 3 and y = -2

## Practice Problems

Practice below problems to excel your skills.
Problem 1:  Solve 3x - y = 10 and x + 2y = 1
Problem 2: Solve linear equations using matrix method
x + 3y =  6
2y - 5z = 4