Euler Hall — free maths guides

Solve Ax = b by solving Lc = b and then Ux = c

State the order of the two triangular solves and why that order is forced. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

Two triangular solves, in this order

WithA=LUA=LU:

Name the inner vectorc=Ux\mathbf{c}=U\mathbf{x}. That single substitution turns one hard system into two easy ones, and both are easy for the same reason: a triangular system is solved by substitution with no elimination inside it.

Why the factorisation makes this cheaper, not just tidier

Elimination costs about13n3\tfrac13n^3 operations. OnceLL andUU exist, each right-hand side costsn2n^2: the two triangular solves together. So forkk right-hand sides the comparison is

13n3+k n2versusk(13n3+n2).\tfrac13n^3 + k\,n^2\quad\text{versus}\quad k\left(\tfrac13n^3+n^2\right).

Atn=3n=3,k=2k=2 that is9+18=279+18=27 against2(9+9)=362(9+9)=36 — the factorisation already wins. Asnn grows the13n3\tfrac13n^3 is paid once instead ofkk times, so the gap widens fast.

The two solves are genuinely cheap because each row of a triangular system involves only the unknowns already found. Rowii ofLL holdsc1,…,cic_1,\dots,c_i and nothing else, so it can be solved the moment you reach it.

A worked example, end to end

Forward.c1=6c_1=6; then2(6)+c2=72(6)+c_2=7 givesc2=−5c_2=-5; then1(6)−1(−5)+c3=31(6)-1(-5)+c_3=3 givesc3=−8c_3=-8. Soc=(6,−5,−8)\mathbf{c}=(6,-5,-8).

Back.4x3=−84x_3=-8 givesx3=−2x_3=-2; then2x2−(−2)=−52x_2-(-2)=-5 givesx2=−72x_2=-\tfrac72; then3x1+6(−2)=63x_1+6(-2)=6 givesx1=6x_1=6.

x=(6,−72,−2).\mathbf{x}=\left(6,-\tfrac72,-2\right).

Check.A=LU=[30662113−211]A=LU=\begin{bmatrix}3&0&6\\6&2&11\\3&-2&11\end{bmatrix}, andAxA\mathbf{x} has first entry18−12=618-12=6, second36−7−22=736-7-22=7, third18+7−22=318+7-22=3. That isb\mathbf{b} ✓.

By the end you can
  • State the order of the two triangular solves and why that order is forced
  • Carry out both stages exactly on a 2x2 and a 3x3 system
  • Check the answer in the original system A, not in U
Check yourself

L=[100110111]L=\begin{bmatrix}1&0&0\\1&1&0\\1&1&1\end{bmatrix},U=[111011001]U=\begin{bmatrix}1&1&1\\0&1&1\\0&0&1\end{bmatrix},b=(4,5,6)\mathbf{b}=(4,5,6).

(a) What isc\mathbf{c}? (b) What isx\mathbf{x}? (c) What isAA?

Answers

(a) Forward:c1=4c_1=4;4+c2=54+c_2=5 soc2=1c_2=1;4+1+c3=64+1+c_3=6 soc3=1c_3=1. Soc=(4,1,1)\mathbf{c}=(4,1,1).

(b) Back:x3=1x_3=1;x2+1=1x_2+1=1 sox2=0x_2=0;x1+0+1=4x_1+0+1=4 sox1=3x_1=3. Sox=(3,0,1)\mathbf{x}=(3,0,1).

(c) Multiply:A=LU=[111122123]A=LU=\begin{bmatrix}1&1&1\\1&2&2\\1&2&3\end{bmatrix}.

Check:Ax=(3+0+1, 3+0+2, 3+0+3)=(4,5,6)A\mathbf{x}=(3+0+1,\,3+0+2,\,3+0+3)=(4,5,6) ✓.

Work out where to start — free, no accountAnswer six real questions — free, no account