# Matrices

Linear algebra is an area of study in mathematics that concerns itself primarily with the study of [vector spaces](https://brilliant.org/wiki/vector-space/) and the [linear transformations](https://brilliant.org/wiki/linear-transformations/) between them.

Fore more details see <https://brilliant.org/wiki/matrices/>.

Augmented matrix = you tagged something onto the matrix. For Ax = b. When you add the vector b, A becomes

### Solving a system of equations by elimination

You want to change A into U, where U is in the form of having 0 at the bottom triangle, because is it easier to solve.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Les_bNJt4mr4K_-rEub%2F-LesbA4LGdlNkbHE8i0G%2Fimage.png?alt=media\&token=6db6d63b-5bfe-4ed4-96a9-907eee8e1088)

(multiplying the diagonal gives you the determinant).&#x20;

Back Substitution: when you apply to the  vector b what you did to the matrix A.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Les_bNJt4mr4K_-rEub%2F-Lescbd1508s6aJcJdBx%2Fimage.png?alt=media\&token=d15eb495-1db5-4fa6-a223-2a6904b1115f)

Once you've done the elimination, A becomes U and B become c. Ax = b -> Ux = c.&#x20;

Your final systems will therefore be:&#x20;

x +2y + z = 2,

2y - 2z =6,

5z = -10

###

### Coefficient matrix

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeYqZ76dZLv-0qNMy-S%2Fimage.png?alt=media\&token=4a0c61d0-339e-478e-9143-495395925fd8)

The coefficients = the coefficient matrix. (x, y, z) = column vector.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeiKA8hJFI6eADyMb0Y%2F-Leiup9emR9lw9ujlFmY%2Fimage.png?alt=media\&token=e557f475-54ad-4cb3-a8c8-ce4eb0a4c045)

Ax = v. We are looking for a vector X, which, after the transformation A, equals v.&#x20;

How can you solve this? You can multiply each side by the inverse matrix to have x = inverseA x v.

### Identity Matrix

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeYrDRRHXMz3lbgewQ1%2Fimage.png?alt=media\&token=acfb1e7b-9f08-4e15-9246-19effe3e4508)

### Trace

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LelSNPA3kzqzMlwdWrP%2F-LelsJngIe9nr4T5C2uS%2Fimage.png?alt=media\&token=984de841-c184-4ecd-865f-50f05c83c486)

### Transpose

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeYrynuFU0oT3Hhs_Z0%2Fimage.png?alt=media\&token=a0036661-167a-47a0-9a70-8207366da6ee)

Also

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Les_bNJt4mr4K_-rEub%2F-LevdRuKGo0astf2UnJy%2Fimage.png?alt=media\&token=b6b55bf5-62cb-4072-8e2e-67d976a96619)

Let's finish the topic of elimination.&#x20;

Ex: 2 x 2 elimnation. Let A be a matrix as below where I can do elimination, but no pivots. I want to get from A to U to solve A. But then I want to know how is A related to U where there is a matrix L where A = LU. How do you get there?

First, to solve A and get U (that is then easy to solve), I multiply by my elementary matrix at the position 2, 1 (E(2,1)) because that is how I get a 0 in position 2,1. Therefore we get:

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Les_bNJt4mr4K_-rEub%2F-LevfBOKVdfj0G2L0ldu%2Fimage.png?alt=media\&token=ccdfd1cc-5ac8-4e21-ab39-ebe737e3c3bc)

Then to get A = L U: you need to multiply E, (2,1) by the inverse which becomes L (-4 becomes 4).&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Les_bNJt4mr4K_-rEub%2F-LevehOKVyYOwQseAnR7%2Fimage.png?alt=media\&token=9fa4878e-d1f3-416a-b770-0a647bafb820)

Where L is the Lower triangle, and U is the Upper triangle.&#x20;

### Determinant

The factor by which a linear transformation changes any area, is called the determinant of that transformation. You can also have negative determinants which means that you invert the orientation of space.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiIM_cgihkHGChM7UN%2Fimage.png?alt=media\&token=8260125a-1c72-4859-8f35-d4879980fa85)

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiJLJXvbAdtjQLmKrB%2Fimage.png?alt=media\&token=e447cfb3-9418-4c61-aff9-ff1327364a4c)

Formally, the determinant is a function det from the set of square matrices to the set of real numbers that satisfies 3 important properties:

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeYsMoznFYIvAw7rS7j%2Fimage.png?alt=media\&token=dd19d22e-a33f-4278-b6b3-5441a42df21d)

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiCQ0pDziWttu9qhaz%2Fimage.png?alt=media\&token=caad90ae-eb9c-4d82-adba-e457b0b2cce5)

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiBt9vTKH1EnubQ8WD%2Fimage.png?alt=media\&token=d5e2e8a8-6481-4c32-97a0-739983cb006f)

Unfortunately, these calculations can get quite tedious; already for 3x3 matrices, the formula is too long to memorize in practice.

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiFqAagQkNMEen_zF5%2Fimage.png?alt=media\&token=e41303f2-c56e-4200-a06f-f0247d91997b)

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiGls0H455GQt2pfVc%2Fimage.png?alt=media\&token=6f0f63a1-cf6f-4ad1-bb9f-7a556cd567a2)

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiG8WFw9jPT1f8vSXR%2Fimage.png?alt=media\&token=21945b0e-a13b-44a3-ab5f-27c8be6e3957)

**Example:**

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiGGjrAdAioxpUe9ov%2Fimage.png?alt=media\&token=dc16cbf7-03f0-4475-82ea-d9cd2eedc923)

### Inverting Matrices

The following is true for square matrices.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeYY4QtuY_3sZTsfqYF%2F-LeiJ_erV-i4Y7ARYTRX%2Fimage.png?alt=media\&token=d3d09a80-634c-496c-8d3e-a1e8811ff917)

A square matrix won't have an inverse, if can find a non 0  vector x with Ax = 0 (also if det A = 0) Because I can multiply both sides by A-1, and this leaves us with x = 0. But if we found a non 0 vector where Ax = 0, that is impossible. Therefore, some matrices don't have inverses.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LeiKA8hJFI6eADyMb0Y%2F-LeiKkID3bF01XgkxgQt%2Fimage.png?alt=media\&token=cc74d363-25f2-4bac-a1e1-3ae69b4852ae)

**Why Do We Need an Inverse?**

Because with matrices we **don't divide**! Seriously, there is no concept of dividing by a matrix. But we can **multiply by an inverse**, which achieves the same thing.

Say we want to find matrix X, and we know matrix A and B:

&#x20;                     XA = B

It would be nice to divide both sides by A (to get X=B/A), but remember **we can't divide**.

But what if we multiply both sides by A-1 ?

&#x20;                     XAA-1 = BA-1

And we know that AA-1 = I, so:

&#x20;                     XI = BA-1

We can remove I (for the same reason we can remove "1" from 1x = ab for numbers):

&#x20;                     X = BA-1

And we have our answer (assuming we can calculate A-1)

Inverse of bigger matrices - see the Gauss Jordan method. <https://www.mathsisfun.com/algebra/matrix-inverse-row-operations-gauss-jordan.html>
