CHAPTER IV: LINEAR ALGEBRAIC EQUATIONSMaria FernandaVergara MendozaPetroleum engineeringUIS-COLOMBIA2010
MATHEMATICAL BACKGROUNDTo study the methods to solve linear algebraic equations it’s necessary to familiarize with matrices.A matrix is a rectangular array of elements represented by a single symbol. The horizontal and vertical lines in a matrix are called rows and columns, respectively. The numbers in the matrix are called its entries or its elements. To specify a matrix's size, a matrix with m rows and n columns is called an m-by-n matrix or m × n matrix, while m and n are called its dimensions.Matrices where n=m are called square matrices
MATHEMATICAL BACKGROUNDSPECIAL TYPES OF SQUARE MATRICESSymmetric Matrix: aij = ajiDiagonal Matrix:  All elements off the main diagonal are zeroIdentity Matrix: Diagonal matrix where all elements on the main diagonal are equal to 1Upper triangular matrix:  all elements below the main diagonal are zero
SPECIAL TYPES OF SQUARE MATRICESLower triangular matrix:  All the elements above the main diagonal are zeroBanded matrix:  all the elements are equal to zero with the exception of a band centered on the main diagonal
MATHEMATICAL BACKGROUNDMATRIX OPERATION RULESAddition: The sumA+B of two m-by-n matrices A and B is calculated entry wise: (A + B)i,j = Ai,j + Bi,j
Multiplication: is an m-by-n matrix and B is an n-by-p matrix, then their matrix productAB is the m-by-p matrix whose entries are given by dot product of the corresponding row of A and the corresponding column of B:MATHEMATICAL BACKGROUNDREPRESENTING LINEAR ALGEBRAIC EQUATIONS IN MATRIX FORM                          where A is the nxn matrix of coefficients:B is the vector of constants:And X is the vector of unknowns:We must solve the equation for X, one way to obtain a solution is to multiply eachs side by the inverse of A.
Gauss elimination
SOLVING SMALL NUMBERS OF EQUATIONS
1. The graphical methodThis method is appropriate for solving small sets of simultaneous equations , n≤3.A graphical solution of two equations is obtained by plotting them on cartesian coordinates, one axis belongs to one variable (x) and the other corresponds to the another variable (y). Each equation is a straight line because they are linear equations.Both equations can be solved for x2:
1. The graphical methodThe equations are in form of straight lines, the next step is to plot these lines on Cartesian coordinates (x2 ordinate, x1 abscissa). The values of x1 and x2 at the intersection of the lines is the solution. For example: Use the graphical method to solve		3x1+2x2=18		-x1+2x2=2Solution: Solvetheeq. For x2Thenweplotthetwolines:Thesolutionis 4, you can checkthisreplacing in the x.
2. Determinants and Cramer’s RuleDeterminants:  The determinant D of  a system is formed from the coefficients of the equationFor example, the value of the second order determinant:	Is calculated by:For the third-order case, a single numerical value for the determinant can be computed as
2. Determinants and Cramer’s RuleCramer’s Rule:  “Each unknown in a system of linear algebraic equations may be expressed as a fraction of two determinants with denominator D and with the numerator obtained from D by replacing the column of coefficients of the unknown in question by the constants b1, b2, …, bn.”For example, x1 would be:
3.  The elimination of unknownsThe process is to multiply the equations by constants so that one of the unknowns will be eliminated when the two equations are combined. Then, the other variable can be found by substitution.For example: Use the elimination of unknowns to solve	Solution:
NAIVE GAUSS ELIMINATIONThis process is based in two simple steps:
NAIVE GAUSS ELIMINATIONForward Elimination of Unknowns:  Reduce the set of equations to an upper triangular system.Back Substitution: Find xn ,this result can be back-substituted into the (n-1) equation, repeat this procedure to evaluate the remaining x’s.Forward eliminationBacksubstitution
EXAMPLE12
3
PITFALLS OF ELIMINATION METHODS
GAUSS-JORDANIs a variation of Gauss elimination. When an unknown is eliminated in this method, it’s eliminated from all other equations rather than just the subsequent ones.The elimination step results in an identity matrix.It is not necessary to employ back substitution to obtain the solution.
MATHEMATICAL ALGORITHMExpress the coefficients and the right-hand side as an augmented matrix. Go to the left column, get zeros below this front element adding appropriate multiples of the top to the rows below it. The process is done through the following operations: (a) Multiply an equation by a nonzero scalar; (b) Exchange of position two equations; (c) Add to a multiple of another equation.
Cover the top row and repeat the above process with the remaining submatrix. Repeat with the rest of the lines (at this point the array is in the form of step).
Starting with the last line is not zero, move up: for each row get a 1 up front and introduce zero multiples of this sum for the corresponding rows.  Repeat this process until you get an identity matrix, and with this result get the solutions clearing the unknowns
EXAMPLEUse the Gauss-Jordan technique to solve:The augmented matrix is:
Solution:
Solution:
LU DECOMPOSITION AND MATRIX INVERSION
LU DECOMPOSITIONThe LU decomposition is a matrix decomposition which writes a matrix as the product of a lower triangular matrix and an upper triangular matrix. This decomposition is used in numerical analysis to solve systems of linear equations or calculate the determinant.Row swapping is not allowed. If you swap rows, then an LU decomposition will not exist.It is not necessary to get leading ones on the main diagonal when using Gaussian Elimination. In some matrices, however, it is recommended to get leading ones to use nice row operations.When using Gaussian Elimination to find such an LU decomposition, record all row operations involved. The row operations will help find the lower triangular matrix using the identity matrix.An LU decomposition is not unique. There can be more than one such LU decomposition for a matrix.
LU DECOMPOSITIONTo get the matrix U, just use row operations until an upper triangular matrix is formed.To get L, start with the identity matrix and use the following rules: Any row operations that involves adding a multiple of one row to another, for example, Ri + kRj, put the value –k in the ith-row, jth- column of the identity matrix.  Any row operations that involves getting a leading one on the main diagonal, for example, kRi, put the value 1/k in the position of the identity matrix where the leading one occurs.Example: Find an LU decomposition of the following matrix:
LU DECOMPOSITIONFirst use Gauss elimination to get the upper triangular matrix:Second Form the lower triangular matrix L by using the rules mentioned above for the row operations involved to get U.
LU DECOMPOSITIONLU decomposition can also be used to solve system of equations.STEPS TO SOLVE A SYSTEM OF EQUATION USING LU DECOMPOSITION
EXAMPLESolve the following system using an LU decompositionSolution: Set up the equation Ax = b.Find an LU decomposition for A. This will yield the equation (LU)x = b. *Note: We found the LU composition for A earlier. Its given by
Let y = Ux. Then solve the equation Ly = b for y.where y = Ux
Now solving for y gives the following values:Take the values for y and solve the equation y = Ux for x. This will give the solution to the system Ax = b.The solution is:x1 = 1x2= -1x3= 2.
THE MATRIX INVERSEMatrix inverse:  A and B are nxn matrices. Guess that A∙B=B∙A=In . ThenB iscalledtheinverse of A and isdenotedby A-1.  Thusmustbe:Thismethodis a necessarytool for solving systems of linear equations and matrix equations. It represents an alternative operation unable to perform the division of matrices.When A has an inverse, then we say that A is invertible.For a matrix has inverse matrix must meet two conditions:Must be a square matrix.Its determinant must be different from zeroA∙ A-1= A-1∙ A=In
Methods to find the inverse of a matrix
BIBLIOGRAPHYCHAPRA S., Numerical methods for engineers. Mc Graw HillDocuments from The university of Texas at Dallas.GROSSMAN, Stanley l. Elementary Linear algebra. Mc Graw Hill.

Chapter 4: Linear Algebraic Equations

  • 1.
    CHAPTER IV: LINEARALGEBRAIC EQUATIONSMaria FernandaVergara MendozaPetroleum engineeringUIS-COLOMBIA2010
  • 2.
    MATHEMATICAL BACKGROUNDTo studythe methods to solve linear algebraic equations it’s necessary to familiarize with matrices.A matrix is a rectangular array of elements represented by a single symbol. The horizontal and vertical lines in a matrix are called rows and columns, respectively. The numbers in the matrix are called its entries or its elements. To specify a matrix's size, a matrix with m rows and n columns is called an m-by-n matrix or m × n matrix, while m and n are called its dimensions.Matrices where n=m are called square matrices
  • 3.
    MATHEMATICAL BACKGROUNDSPECIAL TYPESOF SQUARE MATRICESSymmetric Matrix: aij = ajiDiagonal Matrix: All elements off the main diagonal are zeroIdentity Matrix: Diagonal matrix where all elements on the main diagonal are equal to 1Upper triangular matrix: all elements below the main diagonal are zero
  • 4.
    SPECIAL TYPES OFSQUARE MATRICESLower triangular matrix: All the elements above the main diagonal are zeroBanded matrix: all the elements are equal to zero with the exception of a band centered on the main diagonal
  • 5.
    MATHEMATICAL BACKGROUNDMATRIX OPERATIONRULESAddition: The sumA+B of two m-by-n matrices A and B is calculated entry wise: (A + B)i,j = Ai,j + Bi,j
  • 6.
    Multiplication: is anm-by-n matrix and B is an n-by-p matrix, then their matrix productAB is the m-by-p matrix whose entries are given by dot product of the corresponding row of A and the corresponding column of B:MATHEMATICAL BACKGROUNDREPRESENTING LINEAR ALGEBRAIC EQUATIONS IN MATRIX FORM where A is the nxn matrix of coefficients:B is the vector of constants:And X is the vector of unknowns:We must solve the equation for X, one way to obtain a solution is to multiply eachs side by the inverse of A.
  • 7.
  • 8.
  • 9.
    1. The graphicalmethodThis method is appropriate for solving small sets of simultaneous equations , n≤3.A graphical solution of two equations is obtained by plotting them on cartesian coordinates, one axis belongs to one variable (x) and the other corresponds to the another variable (y). Each equation is a straight line because they are linear equations.Both equations can be solved for x2:
  • 10.
    1. The graphicalmethodThe equations are in form of straight lines, the next step is to plot these lines on Cartesian coordinates (x2 ordinate, x1 abscissa). The values of x1 and x2 at the intersection of the lines is the solution. For example: Use the graphical method to solve 3x1+2x2=18 -x1+2x2=2Solution: Solvetheeq. For x2Thenweplotthetwolines:Thesolutionis 4, you can checkthisreplacing in the x.
  • 11.
    2. Determinants andCramer’s RuleDeterminants: The determinant D of a system is formed from the coefficients of the equationFor example, the value of the second order determinant: Is calculated by:For the third-order case, a single numerical value for the determinant can be computed as
  • 12.
    2. Determinants andCramer’s RuleCramer’s Rule: “Each unknown in a system of linear algebraic equations may be expressed as a fraction of two determinants with denominator D and with the numerator obtained from D by replacing the column of coefficients of the unknown in question by the constants b1, b2, …, bn.”For example, x1 would be:
  • 13.
    3. Theelimination of unknownsThe process is to multiply the equations by constants so that one of the unknowns will be eliminated when the two equations are combined. Then, the other variable can be found by substitution.For example: Use the elimination of unknowns to solve Solution:
  • 14.
    NAIVE GAUSS ELIMINATIONThisprocess is based in two simple steps:
  • 15.
    NAIVE GAUSS ELIMINATIONForwardElimination of Unknowns: Reduce the set of equations to an upper triangular system.Back Substitution: Find xn ,this result can be back-substituted into the (n-1) equation, repeat this procedure to evaluate the remaining x’s.Forward eliminationBacksubstitution
  • 16.
  • 17.
  • 18.
  • 19.
    GAUSS-JORDANIs a variationof Gauss elimination. When an unknown is eliminated in this method, it’s eliminated from all other equations rather than just the subsequent ones.The elimination step results in an identity matrix.It is not necessary to employ back substitution to obtain the solution.
  • 20.
    MATHEMATICAL ALGORITHMExpress thecoefficients and the right-hand side as an augmented matrix. Go to the left column, get zeros below this front element adding appropriate multiples of the top to the rows below it. The process is done through the following operations: (a) Multiply an equation by a nonzero scalar; (b) Exchange of position two equations; (c) Add to a multiple of another equation.
  • 21.
    Cover the toprow and repeat the above process with the remaining submatrix. Repeat with the rest of the lines (at this point the array is in the form of step).
  • 22.
    Starting with thelast line is not zero, move up: for each row get a 1 up front and introduce zero multiples of this sum for the corresponding rows. Repeat this process until you get an identity matrix, and with this result get the solutions clearing the unknowns
  • 23.
    EXAMPLEUse the Gauss-Jordantechnique to solve:The augmented matrix is:
  • 24.
  • 25.
  • 26.
    LU DECOMPOSITION ANDMATRIX INVERSION
  • 27.
    LU DECOMPOSITIONThe LUdecomposition is a matrix decomposition which writes a matrix as the product of a lower triangular matrix and an upper triangular matrix. This decomposition is used in numerical analysis to solve systems of linear equations or calculate the determinant.Row swapping is not allowed. If you swap rows, then an LU decomposition will not exist.It is not necessary to get leading ones on the main diagonal when using Gaussian Elimination. In some matrices, however, it is recommended to get leading ones to use nice row operations.When using Gaussian Elimination to find such an LU decomposition, record all row operations involved. The row operations will help find the lower triangular matrix using the identity matrix.An LU decomposition is not unique. There can be more than one such LU decomposition for a matrix.
  • 28.
    LU DECOMPOSITIONTo getthe matrix U, just use row operations until an upper triangular matrix is formed.To get L, start with the identity matrix and use the following rules: Any row operations that involves adding a multiple of one row to another, for example, Ri + kRj, put the value –k in the ith-row, jth- column of the identity matrix. Any row operations that involves getting a leading one on the main diagonal, for example, kRi, put the value 1/k in the position of the identity matrix where the leading one occurs.Example: Find an LU decomposition of the following matrix:
  • 29.
    LU DECOMPOSITIONFirst useGauss elimination to get the upper triangular matrix:Second Form the lower triangular matrix L by using the rules mentioned above for the row operations involved to get U.
  • 31.
    LU DECOMPOSITIONLU decompositioncan also be used to solve system of equations.STEPS TO SOLVE A SYSTEM OF EQUATION USING LU DECOMPOSITION
  • 32.
    EXAMPLESolve the followingsystem using an LU decompositionSolution: Set up the equation Ax = b.Find an LU decomposition for A. This will yield the equation (LU)x = b. *Note: We found the LU composition for A earlier. Its given by
  • 33.
    Let y =Ux. Then solve the equation Ly = b for y.where y = Ux
  • 34.
    Now solving fory gives the following values:Take the values for y and solve the equation y = Ux for x. This will give the solution to the system Ax = b.The solution is:x1 = 1x2= -1x3= 2.
  • 35.
    THE MATRIX INVERSEMatrixinverse: A and B are nxn matrices. Guess that A∙B=B∙A=In . ThenB iscalledtheinverse of A and isdenotedby A-1. Thusmustbe:Thismethodis a necessarytool for solving systems of linear equations and matrix equations. It represents an alternative operation unable to perform the division of matrices.When A has an inverse, then we say that A is invertible.For a matrix has inverse matrix must meet two conditions:Must be a square matrix.Its determinant must be different from zeroA∙ A-1= A-1∙ A=In
  • 36.
    Methods to findthe inverse of a matrix
  • 37.
    BIBLIOGRAPHYCHAPRA S., Numericalmethods for engineers. Mc Graw HillDocuments from The university of Texas at Dallas.GROSSMAN, Stanley l. Elementary Linear algebra. Mc Graw Hill.