Student[LinearAlgebra] - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Linear Algebra : Computation : Standard : Student/LinearAlgebra/MatrixInverse

Student[LinearAlgebra]

 MatrixInverse
 compute the inverse of a square Matrix or the Moore-Penrose pseudo-inverse of a Matrix

 Calling Sequence MatrixInverse(A, options)

Parameters

 A - square Matrix options - (optional) parameters; for a complete list, see LinearAlgebra[MatrixInverse]

Description

 • The MatrixInverse(A) function, where A is a nonsingular square Matrix, returns the Matrix inverse ${A}^{\mathrm{-1}}$. If A is recognized as a singular Matrix, an error message is returned.
 • If A is a nonsingular $nxn$ Matrix, the inverse ${A}^{\mathrm{-1}}$ is computed such that $A·{A}^{\mathrm{-1}}=I$, where I is the $nxn$ identity Matrix.

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{LinearAlgebra}\right]\right):$
 > $M≔⟨⟨a,c⟩|⟨b,d⟩⟩$
 ${M}{≔}\left[\begin{array}{cc}{a}& {b}\\ {c}& {d}\end{array}\right]$ (1)

To compute the inverse of the 2x2 matrix, M, by hand:

 > $\frac{1}{ad-bc}⟨⟨d,-c⟩|⟨-b,a⟩⟩$
 $\left[\begin{array}{cc}\frac{{d}}{{a}{}{d}{-}{b}{}{c}}& {-}\frac{{b}}{{a}{}{d}{-}{b}{}{c}}\\ {-}\frac{{c}}{{a}{}{d}{-}{b}{}{c}}& \frac{{a}}{{a}{}{d}{-}{b}{}{c}}\end{array}\right]$ (2)
 > $\mathrm{M_I}≔\mathrm{MatrixInverse}\left(M\right)$
 ${\mathrm{M_I}}{≔}\left[\begin{array}{cc}\frac{{d}}{{a}{}{d}{-}{b}{}{c}}& {-}\frac{{b}}{{a}{}{d}{-}{b}{}{c}}\\ {-}\frac{{c}}{{a}{}{d}{-}{b}{}{c}}& \frac{{a}}{{a}{}{d}{-}{b}{}{c}}\end{array}\right]$ (3)
 > $\mathrm{simplify}\left(M·\mathrm{M_I}\right)$
 $\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]$ (4)

The MatrixInverse command will not return a result for a non-square Matrix.

 > $P≔⟨⟨1,2⟩|⟨3,4⟩|⟨1,7⟩⟩$
 ${P}{≔}\left[\begin{array}{ccc}{1}& {3}& {1}\\ {2}& {4}& {7}\end{array}\right]$ (5)

For non-square matrices, use the Pseudoinverse command.

 > $\mathrm{Pseudoinverse}\left(P\right)$
 $\left[\begin{array}{cc}\frac{{9}}{{106}}& \frac{{1}}{{318}}\\ \frac{{41}}{{106}}& {-}\frac{{19}}{{318}}\\ {-}\frac{{13}}{{53}}& \frac{{28}}{{159}}\end{array}\right]$ (6)
 > $P·\mathrm{Pseudoinverse}\left(P\right)$
 $\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]$ (7)

Compatibility

 • The Student[LinearAlgebra][MatrixInverse] command was introduced in Maple 2020.