a_{i,0} x_{0} + · · · + a_{i,n1} x_{n1} = b_{i}, for i = 0, . . . ,n  1,
with coefficients a_{i,j} and components b_{i} belonging to a field can be solved for x_{i}. The solution is unique if the determinant of the matrix of coefficients A = ( a_{i,j} ) is nonzero. In matrix notation the system is written simply as A x = B.The techniques for solving the linear system A x = B are customarily divided into two classes: direct methods and iterative methods. The methods belonging the class of direct methods include Gaussian elimination, Choleski decomposition of positive definite symmetric matrices, Crout's LU decomposition, Doolittle's LU decomposition, and special methods for lower or upper triangular matrices and for tridiagonal matrices. The methods belonging to the class of iterative methods include Jacobi's method, GaussSeidel's method and the method of successive overrelaxation.
Direct Methods
The direct methods are usually preferrable for small matrices. If a single linear systemA x = B is to be solved where det A ≠ 0, then unless the system is a triangular system or a tridiagonal system, Gaussian Elimination (with partial pivoting) is adequate with the proviso that the system of equations is equilibrated. If the righthand side B can vary, then it is preferable to chose one of the LU decomposition methods, either Crout's, Doolittle's, or Choleski's. Note that the linear system A x = B is mathematically equivalent to the linear system ( A^{T}A ) x = A^{T} B, where A^{T}A is positive definite symmetric (if A is nonsingular).
Iterative Methods
The iterative methods are generally preferred for large sparse matrices in which the diagonal elements are all nonzero. In general GaussSeidel's method is preferable to Jacobi's method, but there are examples in which GaussSeidel's method fails to converge while Jacobi's method converges and viceversa. Successive Overrelaxation is preferable to GaussSeidel provided that the relaxation parameter is wellchosen.
