Cal11 calculator

Solve The Following Triangular Linear System Calculator

Reviewed by Calculator Editorial Team

Triangular linear systems are a special type of linear system where the coefficient matrix is either upper triangular or lower triangular. These systems are easier to solve than general linear systems because they have a simpler structure that allows for straightforward back substitution or forward substitution methods.

What is a triangular linear system?

A triangular linear system is a set of linear equations where the coefficient matrix has all the elements either above or below the main diagonal equal to zero. There are two types:

  • Upper triangular system: All elements below the main diagonal are zero
  • Lower triangular system: All elements above the main diagonal are zero

For example, an upper triangular system might look like this:

2x₁ + 3x₂ + 4x₃ = 10
0x₁ + 5x₂ + 6x₃ = 15
0x₁ + 0x₂ + 7x₃ = 21

And a lower triangular system might look like this:

8x₁ + 0x₂ + 0x₃ = 32
2x₁ + 4x₂ + 0x₃ = 12
1x₁ + 2x₂ + 3x₃ = 10

How to solve triangular linear systems

Solving triangular linear systems is simpler than solving general linear systems because we can use either back substitution or forward substitution methods, depending on the type of system.

Back substitution

Used for upper triangular systems:

  1. Start with the last equation and solve for the last variable
  2. Substitute this value into the previous equation and solve for the next variable
  3. Continue this process until all variables are found

Forward substitution

Used for lower triangular systems:

  1. Start with the first equation and solve for the first variable
  2. Substitute this value into the next equation and solve for the next variable
  3. Continue this process until all variables are found

Both methods require that the diagonal elements are non-zero. If any diagonal element is zero, the system either has no solution or infinitely many solutions.

Solving upper triangular systems

To solve an upper triangular system, follow these steps:

  1. Write the system in matrix form: A·x = b
  2. Start with the last row and solve for xₙ
  3. Substitute xₙ into the previous row and solve for xₙ₋₁
  4. Continue this process until all variables are found

Example: Solve the following upper triangular system:

3x₁ + 2x₂ - x₃ = 5
0x₁ + 2x₂ + x₃ = 3
0x₁ + 0x₂ + 4x₃ = 8

Solution:

  1. From the third equation: 4x₃ = 8 → x₃ = 2
  2. Substitute x₃ into the second equation: 2x₂ + 2 = 3 → x₂ = 0.5
  3. Substitute x₂ and x₃ into the first equation: 3x₁ + 1 - 2 = 5 → 3x₁ = 6 → x₁ = 2

The solution is x₁ = 2, x₂ = 0.5, x₃ = 2.

Solving lower triangular systems

To solve a lower triangular system, follow these steps:

  1. Write the system in matrix form: A·x = b
  2. Start with the first row and solve for x₁
  3. Substitute x₁ into the second row and solve for x₂
  4. Continue this process until all variables are found

Example: Solve the following lower triangular system:

2x₁ + 0x₂ + 0x₃ = 4
3x₁ + 5x₂ + 0x₃ = 13
4x₁ + 6x₂ + 7x₃ = 30

Solution:

  1. From the first equation: 2x₁ = 4 → x₁ = 2
  2. Substitute x₁ into the second equation: 6 + 5x₂ = 13 → 5x₂ = 7 → x₂ = 1.4
  3. Substitute x₁ and x₂ into the third equation: 8 + 8.4 + 7x₃ = 30 → 7x₃ = 13.6 → x₃ ≈ 1.9429

The solution is approximately x₁ = 2, x₂ ≈ 1.4, x₃ ≈ 1.9429.

Worked examples

Example 1: Upper triangular system

Solve the following system:

4x₁ - 2x₂ + 3x₃ = 15
0x₁ + 5x₂ - x₃ = 10
0x₁ + 0x₂ + 2x₃ = 6

Solution:

  1. From the third equation: 2x₃ = 6 → x₃ = 3
  2. Substitute x₃ into the second equation: 5x₂ - 3 = 10 → 5x₂ = 13 → x₂ = 2.6
  3. Substitute x₂ and x₃ into the first equation: 4x₁ - 5.2 + 9 = 15 → 4x₁ + 3.8 = 15 → 4x₁ = 11.2 → x₁ = 2.8

The solution is x₁ = 2.8, x₂ = 2.6, x₃ = 3.

Example 2: Lower triangular system

Solve the following system:

3x₁ + 0x₂ + 0x₃ = 9
2x₁ + 4x₂ + 0x₃ = 12
1x₁ + 3x₂ + 2x₃ = 8

Solution:

  1. From the first equation: 3x₁ = 9 → x₁ = 3
  2. Substitute x₁ into the second equation: 6 + 4x₂ = 12 → 4x₂ = 6 → x₂ = 1.5
  3. Substitute x₁ and x₂ into the third equation: 3 + 4.5 + 2x₃ = 8 → 2x₃ = -0.5 → x₃ = -0.25

The solution is x₁ = 3, x₂ = 1.5, x₃ = -0.25.

FAQ

What is the difference between upper and lower triangular systems?
Upper triangular systems have all zeros below the main diagonal, while lower triangular systems have all zeros above the main diagonal. The solving methods are back substitution for upper triangular and forward substitution for lower triangular.
Can triangular systems have infinitely many solutions?
Yes, if the system is consistent and the last equation is 0 = 0, it may have infinitely many solutions. This occurs when the system is underdetermined.
What happens if a diagonal element is zero?
If any diagonal element is zero, the system may have no solution or infinitely many solutions. You would need to swap rows or use other methods to solve such systems.
Are triangular systems always solvable?
Not always. If the system is inconsistent (no solution satisfies all equations), it has no solution. You can check consistency by verifying if the augmented matrix has a row of zeros with a non-zero constant term.
How do I know if a system is triangular?
A system is triangular if all elements either above or below the main diagonal are zero. Look at the coefficient matrix to determine if it's upper or lower triangular.