? invert_by_lu;

Calculate

? invert_by_lu;

Calculate

### invert_by_lu

Run Example
```(%i1)a:matrix([1,2],[3,4]);
[ 1  2 ]
(%o1)                              [      ]
[ 3  4 ]
(%i2) b:matrix([5,6],[7,8]);
[ 5  6 ]
(%o2)                              [      ]
[ 7  8 ]
(%i3) a.b;
[ 19  22 ]
(%o3)                             [        ]
[ 43  50 ]
(%i4) determinant(a);
(%o4)                                 - 2
(%i5) invert_by_lu (a);
[ - 2   1  ]
[          ]
(%o5)                            [  3     1 ]
[  -   - - ]
[  2     2 ]
(%i6) invert_by_lu (b);
[ - 4   3  ]
[          ]
(%o6)                            [  7     5 ]
[  -   - - ]
[  2     2 ]
(%i7) ```
Run Example
```? invert_by_lu;

-- Function: invert_by_lu (<M>, <(rng generalring)>)
Invert a matrix <M> by using the LU factorization.  The LU
factorization is done using the ring <rng>.

(%o1)                                true
(%i2) ```
Run Example
```a:matrix([a,b],[c,d]);
[ a  b ]
(%o1)                              [      ]
[ c  d ]
(%i2) b:matrix([e,f],[g,h]);
[ e  f ]
(%o2)                              [      ]
[ g  h ]
(%i3) a.b;
[ b g + a e  b h + a f ]
(%o3)                      [                      ]
[ d g + c e  d h + c f ]
(%i4) determinant(a);
(%o4)                              a d - b c
(%i5) invert_by_lu (a) ;
[     b c                        ]
[ ----------- + 1                ]
[        b c                     ]
[ a (d - ---)                    ]
[         a               b      ]
[ ---------------  - ----------- ]
[        a                  b c  ]
(%o5)                 [                    a (d - ---) ]
[                            a   ]
[                                ]
[         c              1       ]
[  - -----------      -------    ]
[           b c           b c    ]
[    a (d - ---)      d - ---    ]
[            a             a     ]
(%i6) ```

### Related Help

Help for Invert_by_lu