ABSTRACT

The direct methods for solving a linear system Ax = b are to try to find the exact solution of the linear system, by inverting the matrix A directly or indirectly. The iterative methods aim at finding an approximate solution of the linear system by finding a sequence of vectors that is converging to the exact solution. In the case that the linear system does not have a solution, the problem turns into a least squares problem.

This chapter aims to find approximate and least squared solutions of linear systems. It is divided into three sections. In the first section, basic concepts such as error norm and convergence of vector sequences are introduced. Then, in the second section three iterative methods for finding approximate solutions of linear systems of equations are discussed and implemented in MATLAB® and Python. When a linear system does not have a solution, the problem turns into searching for a least squares solution that minimizes the error norm. Examples of least squares problems and best approximations of functions by polynomials are discussed and implemented in MATLAB and Python, in the third section.