# Solving Equation Systems

### Introduction

There are mainly two methods of solving equation systems using matrices. The first uses the inverse matrix of the coefficients of the independent variables and the second converts the coefficients matrix into a unit matrix form.

Consider the equations system:

This system can be written in matrix form as follows:

In a more compact notation the matrices can be written as:

### First method (Crammer’s Rule):

The solution to the equations system is:

Making the multiplications, each element x is equal to:

Where A_{ni}, are the determinants inside the Adjoint matrix.

**So the solution of the equations system is given by the formula:**

Where |A_{i}| is the determinant of matrix **A** if we replace the elements of the i_{th} column of matrix **A** with the elements of matrix **Y** .

**Example**

As a numerical example consider the following equations system:

In matrix form it is written:

We calculate the solution:

### Second method (Row Reduction):

In the second method, called row reduction, we multiply simultaneously each row of matrix **A** and **Y** with a number and we add it to another row, in order to convert matrix **A** to unit form. We can also only multiply a line of **A** and **Y** by a number in order to scale it. It’s easier to start with the left side elements of the main diagonal of matrix **A** and to continue with the elements at the right side or vice versa.

**Example**

As a numerical example consider the following equations system:

In matrix form it is written:

Divide the first row by 2:

Multiply the first row by -5 and add it to the second row:

Divide the second row by -2:

Multiply the first row by -6 and add it to the third row:

Multiply the second row by 12 and add it to the third row:

Divide the third row by -3:

Continuing this procedure, we end up having:

Converting the matrices to equations, we have:

Crammer method is better for small systems and row reduction method is better for larger systems.