 ## Introduction and Examples

DEFINITION: A matrix is defined as an ordered rectangular array of numbers. They can be used to represent systems of linear equations, as will be explained below.

Here are a couple of examples of different types of matrices:

Symmetric Diagonal Upper Triangular Lower Triangular Zero Identity      And a fully expanded m×n matrix A, would look like this: ... or in a more compact form: DEFINITION: Two matrices A and B can be added or subtracted if and only if their dimensions are the same (i.e. both matrices have the same number of rows and columns. Take: If A and B above are matrices of the same type then the sum is found by adding the corresponding elements aij + bij .

Here is an example of adding A and B together. ### Subtraction

If A and B are matrices of the same type then the subtraction is found by subtracting the corresponding elements aijbij.

Here is an example of subtracting matrices.  ## Matrix Multiplication

DEFINITION: When the number of columns of the first matrix is the same as the number of rows in the second matrix then matrix multiplication can be performed.

Here is an example of matrix multiplication for two 2×2 matrices. Here is an example of matrix multiplication for two 3×3 matrices. Now lets look at the n×n matrix case, Where A has dimensions m×n, B has dimensions n×p. Then the product of A and B is the matrix C, which has dimensions m×p. The ijth element of matrix C is found by multiplying the entries of the ith row of A with the corresponding entries in the jth column of B and summing the n terms. The elements of C are: Note: That A×B is not the same as B×A

Now, try multiplying your own matrices. ## Transpose of Matrices

DEFINITION: The transpose of a matrix is found by exchanging rows for columns i.e. Matrix A = (aij) and the transpose of A is:

AT = (aji) where j is the column number and i is the row number of matrix A.

For example, the transpose of a matrix would be: In the case of a square matrix (m = n), the transpose can be used to check if a matrix is symmetric. For a symmetric matrix A = AT. Now try an example. ## The Determinant of a Matrix

DEFINITION: Determinants play an important role in finding the inverse of a matrix and also in solving systems of linear equations. In the following we assume we have a square matrix (m = n). The determinant of a matrix A will be denoted by det(A) or |A|. Firstly the determinant of a 2×2 and 3×3 matrix will be introduced, then the n×n case will be shown.

### Determinant of a 2×2 matrix

Assuming A is an arbitrary 2×2 matrix A, where the elements are given by: then the determinant of a this matrix is as follows: Now try an example of finding the determinant of a 2×2 matrix yourself. ### Determinant of a 3×3 matrix

The determinant of a 3×3 matrix is a little more tricky and is found as follows (for this case assume A is an arbitrary 3×3 matrix A, where the elements are given below). then the determinant of a this matrix is as follows: Now try an example of finding the determinant of a 3×3 matrix yourself. ### Determinant of a n×n matrix

For the general case, where A is an n×n matrix the determinant is given by: Where the coefficients αij are given by the relation: where βij is the determinant of the (n-1) × (n-1) matrix that is obtained by deleting row i and column j. This coefficient αij is also called the cofactor of aij.

## The Inverse of a Matrix

DEFINITION: Assuming we have a square matrix A, which is non-singular (i.e. det(A) does not equal zero), then there exists an n×n matrix A-1 which is called the inverse of A, such that this property holds:

AA-1 = A-1A = I, where I is the identity matrix.

### The inverse of a 2×2 matrix

Take for example a arbitury 2×2 Matrix A whose determinant (ad − bc) is not equal to zero. where a,b,c,d are numbers, The inverse is: Now try finding the inverse of your own 2×2 matrices. ### The inverse of a n×n matrix

The inverse of a general n×n matrix A can be found by using the following equation. Where the adj(A) denotes the adjoint (or adjugate) of a matrix. It can be calculated by the following method:

• Given the n×n matrix A, define
B = bij
to be the matrix whose coefficients are found by taking the determinant of the (n-1) × (n-1) matrix obtained by deleting the ith row and jth column of A. The terms of B (i.e. B = bij) are known as the cofactors of A.
• Define the matrix C, where
cij = (−1)i+j bij.
• The transpose of C (i.e. CT) is called the adjoint of matrix A.

Lastly to find the inverse of A divide the matrix CT by the determinant of A to give its inverse.

Now test this method with finding the inverse of your own 3×3 matrices. ## Solving Systems of Equations using Matrices

DEFINITION: A system of linear equations is a set of equations with n equations and n unknowns, is of the form of The unknowns are denoted by x1, x2, ..., xn and the coefficients (a and b above) are assumed to be given. In matrix form the system of equations above can be written as: A simplified way of writing above is like this: Ax = b

Now, try putting your own equations into matrix form. After looking at this we will now look at two methods used to solve matrices. These are:

• Inverse Matrix Method
• Cramer's Rule

## Inverse Matrix Method

DEFINITION: The inverse matrix method uses the inverse of a matrix to help solve a system of equations, such like the above Ax = b. By pre-multiplying both sides of this equation by A-1 gives: or alternatively So by calculating the inverse of the matrix and multiplying this by the vector b we can find the solution to the system of equations directly. And from earlier we found that the inverse is given by From the above it is clear that the existence of a solution depends on the value of the determinant of A. There are three cases:

1. If the det(A) does not equal zero then solutions exist using 2. If the det(A) is zero and b=0 then the solution will be not be unique or does not exist.
3. If the det(A) is zero and b=0 then the solution can be x = 0 but as with 2. is not unique or does not exist.

Looking at two equations we might have that Written in matrix form would look like and by rearranging we would get that the solution would look like Now try solving your own two equations with two unknowns. Similarly for three simultaneous equations we would have: Written in matrix form would look like and by rearranging we would get that the solution would look like Now try solving your own three equations with three unknowns. ## Cramer's Rule

DEFINITION: Cramer's rule uses a method of determinants to solve systems of equations. Starting with equation below, The first term x1 above can be found by replacing the first column of A by . Doing this we obtain: Similarly for the general case for solving xr we replace the rth column of A by and expand the determinant. This method of using determinants can be applied to solve systems of linear equations. We will illustrate this for solving two simultaneous equations in x and y and three equations with 3 unknowns x, y and z.

### Two simultaneous equations in x and y To solve use the following:  or simplified:  Now try solving two of your own equations. ### Three simultaneous equations in x, y and z

ax + by + cz = p
dx + ey + fz = q
gx + hy + iz = r

To solve use the following:   Now try solving your own three equations. 