Let’s perform an LU decomposition on a matrix . Here’s an example:

  1. Transform into
    Eliminate , and :
  • To eliminate 3 under 1 (first column), multiply the first row by 3 and subtract it from the second row.
  • To eliminate 2 under 1 , multiply the first row by 2 and subtract it from the third row.
  • To eliminate 4 under 1 , multiply the first row by 4 and subtract it from the fourth row.

Proceed to the second column:

  • Now focus on making the matrix below the main diagonal of the second column zeros, considering the matrix already modified in step 1.

And so on for the third column:

  • You only need to eliminate in this step.
  1. Construct
    The matrix is the result of these elimination steps. Since the actual arithmetic is not shown here, let’s directly jump to constructing from the multipliers used.

  2. Construct
    The matrix captures the multipliers used in each step:
    For , if the multiplier was 3 (you subtracted 3 times the first row from the second row), then .
    For , if the multiplier was 2 , then .
    For , if the multiplier was 4 , then .
    The process continues similarly for other subdiagonal elements based on the multipliers used.

Gradient

Example:

If we want to find the direction to move to increase our function the fastest, we plug in our current coordinates (such as 3,4,5) into the gradient and get:

The gradient points to the direction of greatest increase;