Matrix Calculator

🌐 English
A (3×3)
Rows: 3
Cols: 3
B (3×3)
Rows: 3
Cols: 3
Supports: fractions (1/2), decimals (0.5), constants (pi, e). Empty cells are treated as 0.

Calculation Results

Upper Triangular Matrix Calculator With Steps

Convert matrices to upper triangular form using step-by-step elimination.

1. What Is an Upper-Triangular Matrix?

An upper-triangular matrix is a special type of square matrix where all elements below the main diagonal are equal to zero. If a matrix \( A = [a_{ij}] \), then it is upper-triangular when:

$$ a_{ij} = 0 \quad \text{for all } i > j $$

A general form of an upper-triangular matrix is:

$$ U = \begin{bmatrix} u_{11} & u_{12} & \cdots & u_{1n} \\ 0 & u_{22} & \cdots & u_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & u_{nn} \end{bmatrix} $$

Any square matrix can be converted into this form using Gaussian elimination. Our Upper-Triangular Matrix Calculator automates the entire process.

2. How to Convert a Matrix into Upper-Triangular Form

The transformation uses Gaussian elimination, following these steps:

Step 1: Select the Pivot

Choose the first non-zero element in the column as the pivot. If the pivot is zero, swap it with a row below that contains a non-zero element.

Step 2: Eliminate Elements Below the Pivot

Use row operations:

$$ R_i := R_i - k R_j $$ $$ k = \frac{a_{ij}}{a_{jj}} $$

Step 3: Repeat for Remaining Columns

Continue eliminating values below each pivot until all elements below the main diagonal are zero.

3. Worked Examples

Example 1

Convert the following matrix into an upper-triangular matrix:

$$ A = \begin{bmatrix} 2 & 1 & -1 \\ 4 & 5 & 2 \\ 6 & 3 & 1 \end{bmatrix} $$

Eliminate elements below the first pivot:

$$ R_2 := R_2 - 2R_1 = [0,\, 3,\, 4] $$ $$ R_3 := R_3 - 3R_1 = [0,\, 0,\, 4] $$

The upper-triangular form is:

$$ U = \begin{bmatrix} 2 & 1 & -1 \\ 0 & 3 & 4 \\ 0 & 0 & 4 \end{bmatrix} $$

Example 2

$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 7 \\ 1 & 1 & 0 \end{bmatrix} $$

Apply elimination:

$$ R_2 := R_2 - 2R_1 = [0,\, 0,\, 1] $$ $$ R_3 := R_3 - R_1 = [0,\,-1,\,-3] $$ $$ R_3 := R_3 + R_2 = [0,\,-1,\,-2] $$

Final upper-triangular matrix:

$$ U = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 1 \\ 0 & -1 & -2 \end{bmatrix} $$

4. Common Mistakes

  • Incorrect pivot selection: Using a zero pivot without swapping rows.
  • Wrong row operations: Forgetting to apply operations across the entire row.
  • Non-square matrices: Only square matrices can be triangular.
  • Sign mistakes: Incorrect computation of the elimination factor \( k = a_{ij} / a_{jj} \).

5. Practice Problems

Try converting the following matrices into upper-triangular form. Answers are hidden in collapsible sections.

Exercise 1

$$ \begin{bmatrix} 3 & 1 & -2 \\ 6 & -3 & 2 \\ 9 & 0 & 1 \end{bmatrix} $$
Show Answer

$$ \begin{bmatrix} 3 & 1 & -2 \\ 0 & -5 & 6 \\ 0 & -3 & 7 \end{bmatrix} $$

Exercise 2

$$ \begin{bmatrix} 1 & 4 & 2 \\ 2 & 8 & 6 \\ 1 & 2 & 3 \end{bmatrix} $$
Show Answer

$$ \begin{bmatrix} 1 & 4 & 2 \\ 0 & 0 & 2 \\ 0 & -2 & 1 \end{bmatrix} $$

Exercise 3

$$ \begin{bmatrix} 2 & 2 & 1 \\ 1 & 3 & 2 \\ 4 & 1 & 5 \end{bmatrix} $$
Show Answer

$$ \begin{bmatrix} 2 & 2 & 1 \\ 0 & 2 & 1.5 \\ 0 & -3 & 3 \end{bmatrix} $$

Exercise 4

$$ \begin{bmatrix} 5 & 2 & 4 \\ 1 & 3 & 2 \\ 7 & 0 & 1 \end{bmatrix} $$
Show Answer

$$ \begin{bmatrix} 5 & 2 & 4 \\ 0 & 2.6 & 1.2 \\ 0 & -2.8 & -4.6 \end{bmatrix} $$

Frequently Asked Questions (FAQ)

Q: What is an upper triangular matrix?

It is a matrix where all elements below the main diagonal are zero.

Q: Does this calculator show steps?

Yes. It shows each elimination step clearly.


Copyright Notice: This article is original content from the Matrix Calculator website. Please credit the source when sharing or reproducing it. For more matrix computation tools, visit matrixcalcu.com.

Learn matrix multiplication more easily in just 2 minutes with this free game.

Matrix Multiplication Game