LU Decomposition Calculator
Linear Algebra, Matrices
Intro: Computes an LU factorization A = LU (when it exists) by mirroring the row operations used in Gaussian elimination.
Worked example
- Find L and U such that $A = LU$ for $A = [[2, 1],[4, 3]]$.
- We want to factor $A=\begin{pmatrix}2 & 1\\4 & 3\end{pmatrix}$ into $LU$, where L is lower triangular and U is upper triangular.
- Start Gaussian elimination on A. The first pivot is 2 in row 1, column 1.
- To eliminate the 4 below the pivot, we perform row operation: $R_2 \leftarrow R_2 - 2R_1$ (since 4/2 = 2).
- Applying this to A: Row 2: $(4,3) - 2\cdot(2,1) = (4-4, 3-2) = (0,1)$.
- So the resulting U matrix is $U = \begin{pmatrix}2 & 1\\0 & 1\end{pmatrix}$.
- The multiplier we used was m = 2, which becomes the subdiagonal entry in L.
- Thus $L = \begin{pmatrix}1 & 0\\2 & 1\end{pmatrix}$ (1s on the diagonal, 2 in the (2,1) position).
- Check the product: $LU = \begin{pmatrix}1 & 0\\2 & 1\end{pmatrix}\begin{pmatrix}2 & 1\\0 & 1\end{pmatrix} = \begin{pmatrix}2 & 1\\4 & 3\end{pmatrix} = A$.
- Answer: $\boxed{L = \begin{pmatrix}1 & 0\\2 & 1\end{pmatrix},\; U = \begin{pmatrix}2 & 1\\0 & 1\end{pmatrix}.}$
FAQs
What if a pivot is zero?
In that case, a simple LU without row exchanges may not exist. A more general PA=LU decomposition with permutations is required.
Why choose MathGPT?
- Get clear, step-by-step solutions that explain the “why,” not just the answer.
- See the rules used at each step (power, product, quotient, chain, and more).
- Optional animated walk-throughs to make tricky ideas click faster.
- Clean LaTeX rendering for notes, homework, and study guides.
How this calculator works
- Type or paste your function (LaTeX like
\sin,\lnworks too). - Press Generate a practice question button to generate the derivative and the full reasoning.
- Review each step to understand which rule was applied and why.
- Practice with similar problems to lock in the method.