#1: Matrix Operations
1.1 Matrix Addition and Scalar Multiplication
Definition:
    Matrix Addition: Add corresponding elements of two matrices of the same size.
    Scalar Multiplication: Multiply every element of a matrix by the same scalar value.
Rules:
 1. Addition is commutative: A + B     = B + A.
 2. Addition is associative: A + (B   + C) = (A + B) + C .
 3. Scalar multiplication distributes over addition:
         r(A + B) = rA + rB .
         (r + s)A = rA + sA.
Examples:
2×2 Matrices: Let:
                                            1 2                       5 6
                                      A=[       ],            B=[         ].
                                            3 4                       7 8
                                                                                
 1. Addition:
                                            1+5 2+6      6 8
                                A+B =[              ]=[       ].
                                            3+7 4+8     10 12
                                                                                        
 2. Scalar Multiplication: Multiply A by 3:
                                            3⋅1 3⋅2     3 6
                                   3A = [           ]=[      ].
                                            3⋅3 3⋅4     9 12
                                                                                    
3×2 Matrices: Let:
                                    2 1                                    1 2
                                C = −1 3 ,                         D = 3 −1 .                                 
                                    0 4                                    5 0
 1. Addition:
                                    2+1      1+2      3 3
                            C + D = −1 + 3 3 + (−1) = 2 2 .
                                                                                                                          
                                    0+5      4+0      5 4
 2. Scalar Multiplication: Multiply C by −2:
                                  −2 ⋅ 2   −2 ⋅ 1   −4 −2
                           −2C = −2 ⋅ (−1) −2 ⋅ 3 = 2 −6 .
                                                                                                                              
                                  −2 ⋅ 0   −2 ⋅ 4   0 −8
1.2 Matrix Multiplication
Definition:
    Multiply the rows of the first matrix by the columns of the second matrix.
    AB is defined if the number of columns in A equals the number of rows in B .
Rules:
 1. Matrix multiplication is not commutative: AB    BA.
                                                   =
 2. Matrix multiplication is associative: A(BC) = (AB)C .
 3. Distributive over addition: A(B   + C) = AB + AC .
Examples:
2×2 Matrices:
                                                 2 3                                     1 0
                                   A=[               ],                         B=[          ].
                                                 1 4                                     2 1
                                                                                                               
Find AB :
                                       (2)(1) + (3)(2) (2)(0) + (3)(1)
                              AB = [                                   ].
                                       (1)(1) + (4)(2) (1)(0) + (4)(1)
                                                                                                                         
Simplify:
                                                                           8 3
                                                      AB = [                   ].
                                                                           9 4
                                                                                    
3×2 and 2×3 Multiplication:
                                    1 2
                                                                                         1 0 2
                                 A= 3 4 ,                                  B=[                 ].
                                                                                         2 1 3
                                                                                                                
                                    5 6
Find AB :
                       (1)(1) + (2)(2) (1)(0) + (2)(1) (1)(2) + (2)(3)
                  AB = (3)(1) + (4)(2) (3)(0) + (4)(1) (3)(2) + (4)(3) .
                                                                                                                              
                       (5)(1) + (6)(2) (5)(0) + (6)(1) (5)(2) + (6)(3)
Simplify:
                                               5 2 8
                                         AB = 11 4 18 .                                               
                                              17 6 28
#2: Finding the Inverse of a Matrix
2.1 2×2 Inverse
Formula:
             a b
For A   =[       ], the inverse is:
             c d
                 
                                      1      d −b
                           A−1 =           [      ],                       if det(A) = ad − bc =
                                                                                                0.
                                   ad − bc −c a
                                                        
Example:
Let:
                                                                  2 1
                                                       A=[            ].
                                                                  3 4
                                                                           
 1. Compute det(A):
                                      det(A) = (2)(4) − (1)(3) = 8 − 3 = 5.
 2. Apply the formula:
                                                          1 4 −1
                                                A−1 =      [     ].
                                                          5 −3 2
                                                                               
Simplify:
                                                          0.8 −0.2
                                                A−1 = [            ].
                                                          −0.6 0.4
                                                                                   
2.2 3×3 Inverse
Procedure:
 1. Form the augmented matrix [A∣I].
 2. Use row operations to transform A into I . The right side becomes A−1 .
Example:
Let:
                                                     1 2 3
                                                  A= 0 1 4 .                             
                                                     5 6 0
 1. Augment:
                                          1 2 3 1 0 0
                                          0 1 4 0 1 0 .
                                                                                                 
                                          5 6 0 0 0 1
 2. Perform row operations to reduce A to I . The result is:
                                                    −24 18 5
                                         −1
                                     A            = 20 −15 −4 .
                                                                                                        
                                                    −5   4 1
#3: Conditions for a Matrix to Have an Inverse
Definition:
A square matrix A is invertible if and only if:
 1. Determinant Condition: det(A)        0.
                                        =
 2. Row-Reduced Form: A can be row-reduced to the identity matrix I .
Key Points:
 1. A matrix is singular if det(A)   = 0, meaning it has no inverse.
 2. A matrix is nonsingular if det(A)     0, meaning it has an inverse.
                                         =
Examples:
2×2 Example:
                                                           2 3
                                                  A=[          ].
                                                           4 6
                                                                   
 1. Compute det(A):
                                det(A) = (2)(6) − (3)(4) = 12 − 12 = 0.
Since det(A)   = 0, A is singular and does not have an inverse.
3×3 Example:
                                               1 2 3
                                            B= 4 5 6 .
                                                                        
                                               7 8 10
 1. Compute det(B) (using the first row for expansion):
                                                         5 6                4 6                4 5
                       det(B) = 1 ⋅ det [                     ] − 2 ⋅ det [      ] + 3 ⋅ det [     ].
                                                         8 10               7 10               7 8
                                                                                              
Compute the minors:
                                         5 6
                                 det [        ] = (5)(10) − (6)(8) = 50 − 48 = 2.
                                         8 10
                                                        
                                        4 6
                                det [        ] = (4)(10) − (6)(7) = 40 − 42 = −2.
                                        7 10
                                                    
                                         4 5
                                 det [       ] = (4)(8) − (5)(7) = 32 − 35 = −3.
                                         7 8
                                                    
Substitute:
                                det(B) = 1(2) − 2(−2) + 3(−3) = 2 + 4 − 9 = −3.
Since det(B)    0, B is nonsingular and has an inverse.
               =
#4: Properties of Matrix Inverses
Key Properties:
 1.   (A−1 )−1 = A.
 2.   (AB)−1 = B −1 A−1 .
 3.   (AT )−1 = (A−1 )T .
 4.   det(A−1 ) =     1
                    det(A)
                           .
Examples:
Property 1: (A−1 )−1   =A
2×2 Example: Let:
                                                                   2 1
                                                      A=[              ].
                                                                   3 4
                                                                             
 1. Compute A−1 :
                                                           1 4 −1
                                             A−1 =          [     ].
                                                           5 −3 2
                                                                                             
 2. Compute (A−1 )−1 , which should give A:
                                                                              2 1
                                           (A−1 )−1 = A = [                       ].
                                                                              3 4
                                                                                                     
Property 2: (AB)−1   = B −1 A−1
2×2 Example: Let:
                                              1 2                                             2 0
                                      A=[         ],                        B=[                   ].
                                              3 4                                             0 3
                                                                                                           
 1. Compute AB :
                                                                   2 6
                                                  AB = [                ].
                                                                   6 12
                                                                                         
 2. Find (AB)−1 :
                                                                1 12 −6
                                           (AB)−1 =               [     ].
                                                               24 −6 2
                                                                                                        
 3. Find A−1 and B −1 :
                                      1 4 −2                                                          0.5  0
                             A−1 =      [    ],                             B −1 = [                           ].
                                     −2 −3 1                                                           0 0.333
                                                                                                                  
 4. Verify (AB)−1   = B −1 A−1 .
#5: Using the Inverse of a Matrix to Solve Ax                                                         =b
Definition:
For a system Ax       = b, the solution is:
                                                            x = A−1 b,
if A is invertible.
Examples:
2×2 Example: Solve:
                                                       2 1                                      5
                                              A=[          ],                             b = [ ].
                                                       3 4                                     11
                                                                                                    
 1. Compute A−1 :
                                                                 1 4 −1
                                               A−1 =              [     ].
                                                                 5 −3 2
                                                                                             
 2. Multiply A−1 b:
                                                       0.8 −0.2 5
                                              x=[              ][ ].
                                                       −0.6 0.4 11
                                                                                                 
Simplify:
                                                                     2
                                                                x = [ ].
                                                                     1
                                                                                      
3×3 Example: Solve:
                                           1 2 3                                                6
                                        A= 0 1 4 ,
                                                                              
                                                                                           b = 10 .             
                                           5 6 0                                                8
 1. Compute A−1 (using Gaussian elimination):
                                      −24 18 5
                           −1
                       A            = 20 −15 −4 .
                                                                                  
                                      −5   4 1
 2. Multiply A−1 b:
                          −24 18 5                                             6
                      x = 20 −15 −4
                                                                         10 .
                                                                                            
                          −5   4 1                                             8
Simplify:
                                         −2
                                      x= 1 .                
                                         3
#6: Elementary Matrices and Their Role in Row Operations and Inverses
Definition:
An elementary matrix is a matrix obtained by performing a single elementary row operation on the
identity matrix.
 1. Row Swap: Interchange two rows of the identity matrix.
 2. Row Scaling: Multiply a row by a nonzero scalar.
 3. Row Replacement: Replace a row with itself plus a multiple of another row.
Key Points:
 1. Inverse of an Elementary Matrix:
        The inverse of an elementary matrix corresponds to the inverse of the row operation.
 2. Role in Inverses:
        Any invertible matrix A can be expressed as a product of elementary matrices.
Examples:
Elementary Matrices:
 1. Row Swap (R1      ↔ R2 ): 
                                                             0 1
                                                       E=[       ].
                                                             1 0
                                                                     
 2. Row Scaling (R1        → 3R1 ):    
                                                             3 0
                                                       E=[       ].
                                                             0 1
                                                                     
 3. Row Replacement (R2            
                                       → R2 − 2R1 ):
                                                 
                                                             1 0
                                                       E=[        ].
                                                             −2 1
                                                                         
                                                 2 1
Example: Represent A                 =[              ] as a product of elementary matrices.
                                                 4 3
                                                                  
                                                                                    1 0
 1. Start with the identity matrix I                                        =[          ].
                                                                                    0 1
                                                                                                
 2. Perform row operations to reduce A to I :
                                                          0.5 0
         R1 → 12 R1 : E1 = [                                    ].
                                                           0 1
                                                                       
                                                                           1 0
         R2 → R2 − 4R1 : E2 = [                                                 ].
                                                                           −4 1
                                                                                       
                                                          1   0
         R2 → 13 R2 : E3 = [                                      ].
                                                          0 0.333
                                                                               
 3. Write A     = E1−1 E2−1 E3−1 .
                                                
#7: Expressing a Matrix and Its Inverse as a Product of Elementary Matrices
Steps:
 1. Reduce A to I using elementary row operations.
 2. Each row operation corresponds to an elementary matrix.
 3. The matrix A can be expressed as:
                                                                                                A = Ek−1 Ek−1
                                                                                                         
                                                                                                          −1
                                                                                                              ⋯ E1−1 .
                                                                                                                            
 4. The inverse of A is:
                                                                                                 A−1 = E1 E2 ⋯ Ek .
                                                                                                                       
Example:
Let:
                                                                 1 2
                                             A=[                     ].
                                                                 3 4
                                                                                        
 1. Augment A with I :
                                                 1 2 1 0
                                             [           ].
                                                 3 4 0 1
                                                                                                  
 2. Perform row operations:
         R2 → R2 − 3R1 :
                              
                                                     1 2  1 0
                                                 [             ].
                                                     0 −2 −3 1
                                                                                                          
                  1
         R2 → 
                  −2 R2 :
                           
                                                 1 2 1    0
                                             [                ].
                                                 0 1 1.5 −0.5
                                                                                                              
         R1 → R1 − 2R2 :
                              
                                                 1 0 −2   1
                                             [                ].
                                                 0 1 1.5 −0.5
                                                                                                              
 3. The right half is A−1 :
                                                                 −2   1
                                           A−1 = [                        ].
                                                                 1.5 −0.5
                                                                                                        
#8: LU-Factorization
Definition:
LU-factorization expresses A as:
                                                 A = LU ,
where L is lower triangular and U is upper triangular.
Steps:
 1. Perform Gaussian elimination on A to form U .
 2. Construct L using the multipliers from row operations.
Example:
Let:
                                           2  1 1
                                       A = 4 −6 0 .
                                                                                                      
                                           −2 7 2
 1. Transform A to U using Gaussian elimination:
         R2 → R2 − 2R1 :
                            
                                                  2  1 1
                                                  0 −8 −2 .
                                                                                                                              
                                                  −2 7 2
         R3 → R3 + R1 :
                        
                                                      2 1  1
                                                      0 −8 −2 .
                                                                                                                      
                                                      0 8  3
 2. The resulting U is:
                                             2 1  1
                                         U = 0 −8 −2 .                                                                    
                                             0 0  1
 3. Construct L:
                                            1  0 0
                                         L= 2  1 0 .                                                                  
                                            −1 −1 1
#9: Using LU-Factorization to Solve a System
Steps:
 1. Solve Ly   = b using forward substitution.
 2. Solve Ux    = y using back substitution.
Example:
Solve Ax   = b for:
                                      2  1 1                                                                                                                        5
                                  A = 4 −6 0 ,                                                                                      
                                                                                                                                                                b = −2 .                              
                                      −2 7 2                                                                                                                        9
 1. Use LU-factorization:
                                  1  0 0                                                                                                        2 1  1
                               L= 2  1 0 ,
                                                                                                                                       U = 0 −8 −2 .                                                               
                                  −1 −1 1                                                                                                       0 0  1
 2. Solve Ly   = b:
                                                        1  0 0                                                                                  y1   5    
                                                        2
                                                          1 0                                                                              y2 = −2 .
                                                                                                                                                                                                          
                                                        −1 −1 1                                                                                 y3   9    
                                     5
    Forward substitution yields y = −12 .                                             
                                    −2
 3. Solve Ux    = y:
                                                2 1  1                                                                                      x1    5 
                                                0 −8 −2
                                                                                                                                       x2 = −12 .
                                                                                                                                                                                                              
                                                0 0  1                                                                                      x3   −2 
                                 3
    Back substitution yields x = 2 .                              
                                 −2