# Why WolframAlpha does LU decomposition with pivoting even when it isn't needed?

I want to do LU decomposition with $A$:

$A= \left[ {\begin{array}{cc} 1 & 2 & 3 & 4 \\ -9 & 8 & -15 & 4 \\ 2 & 13 & -21 & 7 \\ 4 & -5 & 5 & 3 \end{array} } \right]$

My answer is this, which the result is approximation because of limitations of floating point data. $A$ can be done LU decomposition without pivoting.

But WolframAlpha gives me different solution. They do LU decomposition with pivoting. I don't know why WolframAlpha calculate LU decomposition with pivoting even pivoting isn't needed.

• Try this calculator: gregthatcher.com/Mathematics/LU_Factorization.aspx – Moo May 16 '18 at 17:26
• $$\left( \begin{array}{ccc} 1 & 0 & 0 \\ -9 & 1 & 0 \\ 2 & \frac{9}{26} & 1 \\ \end{array} \right).\left( \begin{array}{cccc} 1 & 2 & 3 & 4 \\ 0 & 26 & 12 & 40 \\ 0 & 0 & -\frac{405}{13} & -\frac{193}{13} \\ 4 & -5 & 5 & 3 \\ \end{array} \right)=\left( \begin{array}{cccc} 1 & 2 & 3 & 4 \\ -9 & 8 & -15 & 4 \\ 2 & 13 & -21 & 7 \\ 4 & -5 & 5 & 3 \\ \end{array} \right)$$ – Moo May 16 '18 at 17:31
• Oh this calculates LU rather than PLU. And.. no reason why WolframAlpha using pivot without any ground? – oddman621 May 17 '18 at 1:24
• It is just the way they coded up their routine - even the professional Mathematica does it that way. I coded my own variant and produced the results above - as well as the site I provided. This is not bad to calculate by hand for such a small matrix. – Moo May 17 '18 at 1:35
• Seems unclear. You mean the result(LU or PLU) depends on what algorithms are used? – oddman621 May 17 '18 at 2:47