### 1 LU decomposition

Suppose we have the system of equations

$\phantom{\rule{2em}{0ex}}AX=B.$

The motivation for an $LU$ decomposition is based on the observation that systems of equations involving triangular coefficient matrices are easier to deal with. Indeed, the whole point of Gaussian elimination is to replace the coefficient matrix with one that is triangular. The $LU$ decomposition is another approach designed to exploit triangular systems.

We suppose that we can write

$\phantom{\rule{2em}{0ex}}A=LU$

where $L$ is a lower triangular matrix and $U$ is an upper triangular matrix. Our aim is to find $L$ and $U$ and once we have done so we have found an $LU$ decomposition of $A$ .

##### Key Point 5

An $LU$ decomposition of a matrix $A$ is the product of a lower triangular matrix and an upper triangular matrix that is equal to $A$ .

It turns out that we need only consider lower triangular matrices $L$ that have 1s down the diagonal. Here is an example. Let

$\phantom{\rule{2em}{0ex}}A=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 2\hfill & \hfill 4\hfill \\ \hfill 3\hfill & \hfill 8\hfill & \hfill 14\hfill \\ \hfill 2\hfill & \hfill 6\hfill & \hfill 13\hfill \end{array}\right]=LU$ where $L=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill {L}_{21}\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill {L}_{31}\hfill & \hfill {L}_{32}\hfill & \hfill 1\hfill \end{array}\right]$ and $U=\left[\begin{array}{ccc}\hfill {U}_{11}\hfill & \hfill {U}_{12}\hfill & \hfill {U}_{13}\hfill \\ \hfill 0\hfill & \hfill {U}_{22}\hfill & \hfill {U}_{23}\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill {U}_{33}\hfill \end{array}\right]$ .

Multiplying out $LU$ and setting the answer equal to $A$ gives

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}{U}_{11}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{U}_{12}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{U}_{13}\hfill \\ {L}_{21}{U}_{11}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{21}{U}_{12}+{U}_{22}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{21}{U}_{13}+{U}_{23}\hfill \\ {L}_{31}{U}_{11}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{31}{U}_{12}+{L}_{32}{U}_{22}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{31}{U}_{13}+{L}_{32}{U}_{23}+{U}_{33}\hfill \end{array}\right]=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 2\hfill & \hfill 4\hfill \\ \hfill 3\hfill & \hfill 8\hfill & \hfill 14\hfill \\ \hfill 2\hfill & \hfill 6\hfill & \hfill 13\hfill \end{array}\right].$

Now we use this to find the entries in $L$ and $U$ . Fortunately this is not nearly as hard as it might at first seem. We begin by running along the top row to see that

$\phantom{\rule{2em}{0ex}}{U}_{11}=1\phantom{\rule{1em}{0ex}},\phantom{\rule{2em}{0ex}}{U}_{12}=2\phantom{\rule{1em}{0ex}},\phantom{\rule{2em}{0ex}}{U}_{13}=4\phantom{\rule{1em}{0ex}}.$

Now consider the second row

$\begin{array}{rcll}& & {L}_{21}{U}_{11}=3\phantom{\rule{1em}{0ex}}\therefore {L}_{21}×1=3\phantom{\rule{1em}{0ex}}\therefore {L}_{21}=3\phantom{\rule{1em}{0ex}},& \text{}\\ & & {L}_{21}{U}_{12}+{U}_{22}=8\phantom{\rule{1em}{0ex}}\therefore 3×2+{U}_{22}=8\phantom{\rule{1em}{0ex}}\therefore {U}_{22}=2\phantom{\rule{1em}{0ex}},& \text{}\\ & & {L}_{21}{U}_{13}+{U}_{23}=14\phantom{\rule{1em}{0ex}}\therefore 3×4+{U}_{23}=14\phantom{\rule{1em}{0ex}}\therefore {U}_{23}=2\phantom{\rule{1em}{0ex}}.\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}& \text{}\end{array}$

Notice how, at each step, the equation being considered has only one unknown in it, and other quantities that we have already found. This pattern continues on the last row

$\begin{array}{rcll}& & {L}_{31}{U}_{11}=2\phantom{\rule{1em}{0ex}}\therefore {L}_{31}×1=2\phantom{\rule{1em}{0ex}}\therefore {L}_{31}=2\phantom{\rule{1em}{0ex}},& \text{}\\ & & {L}_{31}{U}_{12}+{L}_{32}{U}_{22}=6\phantom{\rule{1em}{0ex}}\therefore 2×2+{L}_{32}×2=6\phantom{\rule{1em}{0ex}}\therefore {L}_{32}=1\phantom{\rule{1em}{0ex}},& \text{}\\ & & {L}_{31}{U}_{13}+{L}_{32}{U}_{23}+{U}_{33}=13\phantom{\rule{1em}{0ex}}\therefore \left(2×4\right)+\left(1×2\right)+{U}_{33}=13\phantom{\rule{1em}{0ex}}\therefore {U}_{33}=3\phantom{\rule{1em}{0ex}}.& \text{}\end{array}$

We have shown that

$\phantom{\rule{2em}{0ex}}A=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 2\hfill & \hfill 4\hfill \\ \hfill 3\hfill & \hfill 8\hfill & \hfill 14\hfill \\ \hfill 2\hfill & \hfill 6\hfill & \hfill 13\hfill \end{array}\right]=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 3\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 2\hfill & \hfill 1\hfill & \hfill 1\hfill \end{array}\right]\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 2\hfill & \hfill 4\hfill \\ \hfill 0\hfill & \hfill 2\hfill & \hfill 2\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 3\hfill \end{array}\right]$

and this is an $LU$ decomposition of $A$ .

Find an $LU$ decomposition of $\left[\begin{array}{cc}\hfill 3\hfill & \hfill 1\hfill \\ \hfill -6\hfill & \hfill -4\hfill \end{array}\right]$ .

Let

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{cc}\hfill 3\hfill & \hfill 1\hfill \\ \hfill -6\hfill & \hfill -4\hfill \end{array}\right]=LU=\left[\begin{array}{cc}\hfill 1\hfill & \hfill 0\hfill \\ \hfill {L}_{21}\hfill & \hfill 1\hfill \end{array}\right]\left[\begin{array}{cc}\hfill {U}_{11}\hfill & \hfill {U}_{12}\hfill \\ \hfill 0\hfill & \hfill {U}_{22}\hfill \end{array}\right]=\left[\begin{array}{cc}\hfill {U}_{11}\hfill & \hfill {U}_{12}\hfill \\ \hfill {L}_{21}{U}_{11}\hfill & \hfill {L}_{21}{U}_{12}+{U}_{22}\hfill \end{array}\right]$

then, comparing the left and right hand sides row by row implies that ${U}_{11}=3$ , ${U}_{12}=1$ , ${L}_{21}{U}_{11}=-6$ which implies ${L}_{21}=-2$ and ${L}_{21}{U}_{12}+{U}_{22}=-4$ which implies that ${U}_{22}=-2$ . Hence

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{cc}\hfill 3\hfill & \hfill 1\hfill \\ \hfill -6\hfill & \hfill -4\hfill \end{array}\right]=\left[\begin{array}{cc}\hfill 1\hfill & \hfill 0\hfill \\ \hfill -2\hfill & \hfill 1\hfill \end{array}\right]\left[\begin{array}{cc}\hfill 3\hfill & \hfill 1\hfill \\ \hfill 0\hfill & \hfill -2\hfill \end{array}\right]$

is an $LU$ decomposition of $\left[\begin{array}{cc}\hfill 3\hfill & \hfill 1\hfill \\ \hfill -6\hfill & \hfill -4\hfill \end{array}\right]$ .

Find an $LU$ decomposition of $\left[\begin{array}{ccc}\hfill 3\hfill & \hfill 1\hfill & \hfill 6\hfill \\ \hfill -6\hfill & \hfill 0\hfill & \hfill -16\hfill \\ \hfill 0\hfill & \hfill 8\hfill & \hfill -17\hfill \end{array}\right]$ .

Using material from the worked example in the notes we set

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 3\hfill & \hfill 1\hfill & \hfill 6\hfill \\ \hfill -6\hfill & \hfill 0\hfill & \hfill -16\hfill \\ \hfill 0\hfill & \hfill 8\hfill & \hfill -17\hfill \end{array}\right]=\left[\begin{array}{ccc}{U}_{11}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{U}_{12}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{U}_{13}\hfill \\ {L}_{21}{U}_{11}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{21}{U}_{12}+{U}_{22}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{21}{U}_{13}+{U}_{23}\hfill \\ {L}_{31}{U}_{11}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{31}{U}_{12}+{L}_{32}{U}_{22}\hfill & \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{31}{U}_{13}+{L}_{32}{U}_{23}+{U}_{33}\hfill \end{array}\right]$

and comparing elements row by row we see that

$\phantom{\rule{2em}{0ex}}\begin{array}{ccccc}{U}_{11}=3,\hfill & \phantom{\rule{1em}{0ex}}\hfill & {U}_{12}=1,\hfill & \phantom{\rule{1em}{0ex}}\hfill & {U}_{13}=6,\hfill \\ {L}_{21}=-2,\hfill & \hfill & {U}_{22}=2,\hfill & \hfill & {U}_{23}=-4\hfill \\ {L}_{31}=0\hfill & \hfill & {L}_{32}=4\hfill & \hfill & {U}_{33}=-1\hfill \end{array}$

and it follows that

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 3\hfill & \hfill 1\hfill & \hfill 6\hfill \\ \hfill -6\hfill & \hfill 0\hfill & \hfill -16\hfill \\ \hfill 0\hfill & \hfill 8\hfill & \hfill -17\hfill \end{array}\right]=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill -2\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 4\hfill & \hfill 1\hfill \end{array}\right]\left[\begin{array}{ccc}\hfill 3\hfill & \hfill 1\hfill & \hfill 6\hfill \\ \hfill 0\hfill & \hfill 2\hfill & \hfill -4\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill -1\hfill \end{array}\right]$

is an $LU$ decomposition of the given matrix.