Ran Wei/ Linear Algebra
中文
Linear Algebra · Structure and approximation

Module 6Determinants, inverses and LU

Read signed volume from a determinant, recognise invertibility, and reuse elimination through a factorisation.

80 minYou need Modules 2, 3 and 5

In this module you will

  • Compute and interpret a determinant using row operations
  • Connect a nonzero determinant with an inverse
  • Solve a system by forward and backward substitution
1

Signed area and volume

In two dimensions the columns (a,c)T(a,c)^\mathsf T and (b,d)T(b,d)^\mathsf T enclose a parallelogram with signed area ad−bc.ad-bc\mathclose{\text{.}} The magnitude gives the area. The sign records whether the linear map preserves or reverses orientation. In higher dimensions the square-matrix determinant measures the signed volume factor.

Swapping rows reverses its sign, scaling a row scales it by the same factor, and adding a multiple of another row leaves it alone. These rules also follow from the determinant being alternating and linear in each row separately. A triangular matrix has determinant equal to the product of its diagonal entries. Track the row swaps and scalings while reducing.

Example 6.1Reduce without changing the determinant✓ Checked

For A=(2143),A=\begin{pmatrix}2&1\\4&3\end{pmatrix}\mathclose{\text{,}} subtract twice the first row from the second. The resulting triangular matrix has diagonal entries 2,1,2,1\mathclose{\text{,}} so det⁡A=2.\det A=2\mathclose{\text{.}} The map doubles ordinary area and preserves orientation.

2

Which maps have an inverse?

For an n×nn\times n matrix the following are equivalent: rank n,n\mathclose{\text{,}} zero kernel, a unique solution for every right-hand side, and nonzero determinant. Elimination explains the last link: there is a zero diagonal pivot in triangular form precisely when there are fewer than nn pivots. The inverse A−1A^{-1} reverses the map. Reducing [A∣I][A\mid I] gives [I∣A−1][I\mid A^{-1}] when the inverse exists.

For a single numerical system, use a solver such as elimination rather than computing the inverse and multiplying by b.\mathbf b\mathclose{\text{.}} For repeated solves with the same A,A\mathclose{\text{,}} compute a factorisation once.

3

Triangular solves and LU

For the example, elimination gives

A=LU,L=(1021),U=(2101).A=LU,\qquad L=\begin{pmatrix}1&0\\2&1\end{pmatrix},\quad U=\begin{pmatrix}2&1\\0&1\end{pmatrix}.

The entry 22 in LL records the elimination multiplier. To solve Ax=b,A\mathbf x=\mathbf b\mathclose{\text{,}} solve Lz=bL\mathbf z=\mathbf b from the top down, then Ux=zU\mathbf x=\mathbf z from the bottom up. With row swaps the common convention is PA=LU,PA=LU\mathclose{\text{,}} so use PbP\mathbf b on the right of the first solve.

Compute itVerify a factorisation and solve
Python
from sympy import Matrix

A = Matrix([[2, 1], [4, 3]])
L, U, swaps = A.LUdecomposition()
print(L.tolist(), U.tolist(), swaps)
print(list(A.LUsolve(Matrix([5, 11]))))
Output
[[1, 0], [2, 1]] [[2, 1], [0, 1]] []
[2, 1]
4

Exercises

Exercise 6.1★Orientation

What happens to area and orientation under diag⁡(−2,3)?\operatorname{diag}(-2,3)\mathclose{\text{?}}

Show solution✓ Checked

The determinant is −6.-6\mathclose{\text{.}} The map multiplies ordinary area by 66 and reverses orientation.

Exercise 6.2★★Inverse check

Find the inverse of (1201).\begin{pmatrix}1&2\\0&1\end{pmatrix}\mathclose{\text{.}}

Show solution✓ Checked

The map sends (x,y)(x,y) to (x+2y,y).(x+2y,y)\mathclose{\text{.}} Subtracting 2y2y from the first output reverses it, so the inverse has rows (1,−2)(1,-2) and (0,1).(0,1)\mathclose{\text{.}}

Exercise 6.3★★★Solve using factors

Use the factors above for b=(3,8)T.\mathbf b=(3,8)^\mathsf T\mathclose{\text{.}}

Show solution✓ Checked

The lower triangular solve gives z1=3,z_1=3\mathclose{\text{,}} 2z1+z2=8,2z_1+z_2=8\mathclose{\text{,}} so z2=2.z_2=2\mathclose{\text{.}} The upper triangular solve gives x2=2x_2=2 and 2x1+x2=3,2x_1+x_2=3\mathclose{\text{,}} so x1=1/2.x_1=1/2\mathclose{\text{.}}

5

Check yourself

1
What happens to a determinant after swapping two rows?
2
What does determinant zero imply for a square matrix?
3
For PA=LU,PA=LU\mathclose{\text{,}} what is the first right-hand side for solving Ax=b?A\mathbf x=\mathbf b\mathclose{\text{?}}
Finished this module?