# How to find the Inverse of a Matrix [closed]

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?

• $2\times 3$ matrices have no inverse. Oct 1 '16 at 21:46
• Welcome to the site. Next time before posting try looking for an answer using Google or use the search feature here. math.stackexchange.com/questions/991736/… math.stackexchange.com/questions/1942241/… Oct 1 '16 at 21:54
• @JackyChong *two-sided inverse. There are $2\times 3$ matrices with right inverses, for example. Oct 1 '16 at 21:56
• @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. Oct 1 '16 at 21:58
• @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. Oct 1 '16 at 22:02

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)$.

• "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. Oct 1 '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 Oct 1 '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. Oct 1 '16 at 22:16
• It's quite common in France. Oct 1 '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. Oct 1 '16 at 22:22

$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.