-3

What is a general formula to find the inverse of a matrix? For example, how do you find the inverse of a 2 by 3 or 4 by 4 matrix?

Vivek A
  • 53
  • 4
    $2\times 3$ matrices have no inverse. – Jacky Chong Oct 01 '16 at 21:46
  • 1
    Welcome to the site. Next time before posting try looking for an answer using Google or use the search feature here.

    https://math.stackexchange.com/questions/991736/explicit-formula-for-inverse-matrix-elements https://math.stackexchange.com/questions/1942241/find-inverse-of-a-linear-transormation-given-its-matrix/1942249#1942249

    – Eman Yalpsid Oct 01 '16 at 21:54
  • @JackyChong *two-sided inverse. There are $2\times 3$ matrices with right inverses, for example. – Glare Oct 01 '16 at 21:56
  • 3
    @Glare The term "inverse", without any additions, is usually taken as double sided inverse of, a fortiori, square matrices. If it was one sided inverses then the question should make this clear. – DonAntonio Oct 01 '16 at 21:58
  • @Glare It's true that $2\times 3$ have right inverse or left inverse. However, when we say inverse it usually means two-sided inverse by the convention of basic course in linear algebra. – Jacky Chong Oct 01 '16 at 21:59
  • 1
    @DonAntonio I absolutely agree with you. I doubt somebody who doesn't know enough linear algebra that they need to ask how to compute inverses would bother with the distinction though (or even be aware of it), so it's certainly helpful to point it out rather than flatly dismissing their question. – Glare Oct 01 '16 at 22:02

2 Answers2

2

The general formula for a square matrix $A$ is $$A^{-1}=\frac1{\det A}\,\operatorname{com}A,$$ where $\operatorname{com}A$ (the comatrix, or adjugate matrix, of $A$) is the transpose of the matrix of cofactors of $A$.

However, this formula is not used in practice, as its complexity, for a matrix of dimension $n$, is $O(n!)$. A much more efficient method is based on the pivot method: you apply elementary row operations on $A$, until it is transformed into the unit matrix. The same row operations, applied to unit matris, yield $A^{-1}$. This method has complexity $O(n^3)$.

Bernard
  • 175,478
  • "Comatrix" seems to be a highly non-standard term for what is more usually called adjugate matrix or classical adjoint matrix, or even just adjoint matrix. – DonAntonio Oct 01 '16 at 22:02
  • It's the term I learnt. It's more telling than ‘adjugate’, in my opinion, as it directly refers to the cofactors. As to ‘adjoint’, it's haighly ambiguous, as it's also used in the context of Hilbert or hermitian spaces – Bernard Oct 01 '16 at 22:12
  • Perhaps, yet you can try to google it and you'll see it hardly appears in some marginal sites. About adjoint I agree with you, and that's why I'd rather use adjugate or classical adjoint. – DonAntonio Oct 01 '16 at 22:16
  • It's quite common in France. – Bernard Oct 01 '16 at 22:18
  • And yet the world, as hard as it may seem to be to accept, includes slightly more than France...No, seriously: the term "comatrix", as you mention, seems to be better and clearer than the usual one, at least for me. – DonAntonio Oct 01 '16 at 22:22
0

$2\times 3$ matrices doesn't have inverse. And in general, $a\times b$ matrices don't, unless $a = b$.

There are two cute general formulas for $2\times 2$ matrices and $3\times 3$.

$$A = \begin{pmatrix} a & b\\ c & d \end{pmatrix} ~~~~~~~~~~~ A^{-1} = \frac{1}{\text{det}\ A}\begin{pmatrix} d & -b\\ -c & a \end{pmatrix} $$

$$B = \begin{pmatrix} a & b & c\\ d & e & f\\ g & h & i \end{pmatrix} ~~~~~~~~~~~ B^{-1} = \frac{1}{\text{det}\ B} \begin{pmatrix} (ei - fh) & (ch - bi) & (bf - ce)\\ (fg - di) & (ai - cg) & (cd - af)\\ (dh - eg) & (bg - ah) & (ae - bd) \end{pmatrix} $$

For a $4\times 4$ matrix you can use the LaPlace expansion.

Enrico M.
  • 26,114