I've been needing to derive some LU factorizations by hand, analytically, and i was wondering if anyone knew if it were possible to get Mathematica to do this symbolically so that I may be able to check my work.

  • 1
    $\begingroup$ does LUDecomposition[Array[Subscript[a, ##] &, {3, 3}]] give what you need? $\endgroup$ – kglr Jun 6 '19 at 8:08
  • $\begingroup$ It is not clear what is meant by "analytically". This is an algorithm at play and it would not readily be expressed as a closed-form formula. $\endgroup$ – Daniel Lichtblau Jun 6 '19 at 16:34

There is a function for this in Mathematica: https://reference.wolfram.com/language/ref/LUDecomposition.html

All their examples are numerical, but it works symbolically as well.

m = {{a1, a2, a3}, {b1, b2, b3}, {c1, c2, c3}};

enter image description here

{lu, p, c} = LUDecomposition[m];
l = lu SparseArray[{i_, j_} /; j < i -> 1, {3, 3}] + IdentityMatrix[3]; 
u = lu SparseArray[{i_, j_} /; j >= i -> 1, {3, 3}];


enter image description here

And if you multiply them together, you get the original matrix back:


enter image description here

| improve this answer | |
  • $\begingroup$ The computation tacitly assumes none of the divisors are zero. (BTW, have you see this sort of thing: lsf = LinearSolve[m]; {lsf@"getU", lsf@"getL"}? $\endgroup$ – Michael E2 Jun 6 '19 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.