

# Basics of linear equations and systems

A linear equation is an equation of the form:

$$ax + by + cz + \cdots + n = 0$$

where a, b, c, ..., n are constants, and x, y, z, ..., n are variables.

A system of linear equations is a collection of linear equations that share the same variables.

To solve a system of linear equations, we can use various methods. The most common methods are Cramer's rule, Gaussian elimination, iterative methods (Gauss-Seidel and Jacobi), and matrix inversion.

# Cramer's rule: overview and application

Cramer's rule is a method for solving systems of linear equations. It involves finding the determinant of a matrix and using it to find the solution of the system.

The general form of Cramer's rule is:

$$x_i = \frac{\det(A_i)}{\det(A)}$$

where A is the augmented matrix of the system, A_i is the matrix obtained by replacing the i-th column of A with the constants in the right-hand side of the system, and x_i is the solution to the i-th variable.

To apply Cramer's rule, follow these steps:

1. Write the system of linear equations in matrix form.
2. Compute the determinant of the augmented matrix.
3. For each variable, compute the determinant of the matrix obtained by replacing the column of the variable with the constants in the right-hand side of the system.
4. Divide the determinant from step 3 by the determinant from step 2 to obtain the solution for that variable.

# Gaussian elimination: row operations and pivot elements

Gaussian elimination is a method for solving systems of linear equations. It involves performing a series of row operations to transform the system into row echelon form.

The main idea behind Gaussian elimination is to use row operations to make the system of equations easier to solve. The most common row operations are:

- Swapping two rows.
- Multiplying a row by a non-zero constant.
- Adding a multiple of one row to another row.

The pivot element is the leading coefficient of the row after performing Gaussian elimination. It is the first non-zero element in each row.

# Iterative methods: Gauss-Seidel and Jacobi

Iterative methods are a class of methods for solving systems of linear equations that involve repeatedly updating the solution until it converges to the correct value.

Two common iterative methods are Gauss-Seidel and Jacobi.

- Gauss-Seidel: In this method, the solution is updated simultaneously for all variables.
- Jacobi: In this method, the solution is updated one variable at a time.

To use these methods, follow these steps:

1. Write the system of linear equations in matrix form.
2. Choose an initial guess for the solution.
3. Perform the row operations from the previous section to obtain the iteration formula.
4. Use the iteration formula to update the solution until it converges.

# Matrix inversion and its use in solving linear equations

Matrix inversion is the process of finding the inverse of a matrix. The inverse of a matrix is a matrix that, when multiplied by the original matrix, gives the identity matrix.

The inverse of a matrix can be used to solve systems of linear equations. To use the inverse to solve a system of linear equations, follow these steps:

1. Write the system of linear equations in matrix form.
2. Compute the inverse of the coefficient matrix.
3. Multiply the inverse by the constants in the right-hand side of the system to obtain the solution.

# Numerical methods: comparison and applications

Numerical methods are methods for solving systems of linear equations using computers. They involve approximating the solution and iterating until the solution converges.

Some common numerical methods are:

- Gauss-Seidel and Jacobi: These are iterative methods for solving systems of linear equations.
- Cramer's rule: This method involves finding the determinant of a matrix to solve a system of linear equations.
- Gaussian elimination: This method involves performing row operations to transform the system into row echelon form.

The choice of method depends on the specific problem and the desired level of accuracy.