# Should the formula for the inverse of a 2x2 matrix be obvious?

As every MO user knows, and can easily prove, the inverse of the matrix $$\begin{pmatrix} a & b \\\ c & d \end{pmatrix}$$ is $$\dfrac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$$. This can be proved, for example, by writing the inverse as $$\begin{pmatrix} r & s \\ t & u \end{pmatrix}$$ and solving the resulting system of four equations in four variables.

As a grad student, when studying the theory of modular forms, I repeatedly forgot this formula (do you switch the $$a$$ and $$d$$ and invert the sign of $$b$$ and $$c$$ … or was it the other way around?) and continually had to rederive it. Much later, it occurred to me that it was better to remember the formula was obvious in a couple of special cases such as $$\begin{pmatrix} 1 & b \\ 0 & 1 \end{pmatrix}$$, and diagonal matrices, for which the geometric intuition is simple. One can also remember this as a special case of the adjugate matrix.

Is there some way to just write down $$\dfrac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$$, even in the case where $$ad - bc = 1$$, by pure thought—without having to compute? In particular, is there some geometric intuition, in terms of a linear transformation on a two-dimensional vector space, that renders this fact crystal clear?

Or may as well I be asking how to remember why $$43 \times 87$$ is equal to $$3741$$ and not $$3731$$?

• I was just discussing this with a friend; I think this is a great pedagogical question. – Daniel Litt Feb 21 '12 at 2:40
• I remember it in a boring form: the diagonals are easy, so they just change places, while the off-diagonals are special, so they suffer a sign "inversion" -- actually, hardly anything to remember ;-) – Suvrit Feb 21 '12 at 3:23
• Look at it mod $20$. $3\times 7=1$. – Will Sawin Feb 21 '12 at 3:27
• You know you want to get the determinant along the diagonal, which is ad-bc, so you know the first column has to be d,-c. Likewise for the second column. – Jonny Evans Feb 21 '12 at 7:39
• (These look like fine memory aids, but you must mean "mnemonic", not "pneumonic"...) – Noam D. Elkies Dec 29 '13 at 18:05

EDIT (8/14/2020): A couple people have suggested that this answer should come with a warning -- this is a pretty fancy approach to an elementary question, motivated by the fact that I know the OP's interests. Some of the other answers below are probably better if you just want to invert some matrices :). I've also fixed a couple of minor typos.

My favorite way to remember this is to think of $$SL_2(\mathbb{R})$$ as a circle bundle over the upper half-plane, where $$SL_2(\mathbb{R})$$ acts on the upper half-plane via fractional linear transformations; then the map sends an element of $$SL_2(\mathbb{R})$$ to the image of $$i$$ under the corresponding fractional linear transformation. The fiber over a point is the corresponding coset of the stabilizer of $$i$$.

This naturally gives the Iwasawa decomposition of $$SL_2(\mathbb{R})$$ as $$SL_2(\mathbb{R})=NAK$$ where

$$K=\left\{\begin{pmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{pmatrix} , ~0\leq\theta<2\pi \right\}$$

$$A=\left\{\begin{pmatrix} r & 0\\ 0 &1/r\end{pmatrix},~ r\in \mathbb{R}\setminus\{0\}\right\}$$

$$N=\left\{\begin{pmatrix} 1 & x \\ 0 & 1\end{pmatrix},~ x\in \mathbb{R}\right\}$$

Here $$K$$ is the stabilizer of $$i$$ in the upper half-plane picture; viewed as acting on the plane via the usual action of $$SL_2(\mathbb{R})$$ on $$\mathbb{R}^2$$ it is just rotation by $$\theta$$ (and likewise if we view the upper half plane as the unit disk, sending $$i$$ to $$0$$ via a fractional linear transformation). $$A$$ is just scaling by $$r^2$$, in the upper half-plane picture, and is stretching in the $$\mathbb{R}^2$$ picture. $$N$$ is translation by $$x$$ in the upper half-plane picture, and is a skew transformation in the $$\mathbb{R}^2$$ picture.

In each case, the inverse is geometrically obvious: for $$K$$, replace $$\theta$$ with $$-\theta$$; for $$A$$ replace $$r$$ with $$1/r$$, and for $$N$$, replace $$x$$ with $$-x$$. Since $$SL_2(\mathbb{R})=NAK$$ this lets us invert every $$2\times 2$$ matrix by "pure thought", at least if you remember the Iwasawa decomposition (which is easy from the geometric picture, I think). Of course this easily extends to $$GL_2$$; if $$A$$ has determinant $$d$$, then $$A^{-1}$$ had better have determinant $$d^{-1}$$.

If you'd like to derive the formula you've written down by "pure thought" it suffices to look at any one of these cases if you remember the general form of the inverse; or you can simply put them all together to give a rigorous derivation.

• This is a spectacular answer. +1, sir. – Frank Thorne Feb 21 '12 at 15:07
• Daniel, you really remember the inversion for 2 x 2 matrices by this method? I remember it the same way I remember the quadratic formula: I burned it into my brain back in high school. What you describe seems more like a way to understand the formula than to remember it. – KConrad Feb 22 '12 at 15:19
• @KConrad: In practice I do actually just recall the formula from memory; but just dredging it up from memory isn't by favorite way to remember it. In my ideal world, perhaps, we would have much less burned into our brains in high school; rather we would develop understanding and intuition (like this and other answers purport to give). On the other hand, I guess, sometimes you just gotta invert some $2\times 2$ matrices, and thinking about the upper half-plane is probably not the easiest way to do that ;-). – Daniel Litt Feb 22 '12 at 18:14
• I also wanted to note that Frank's method of using a few special cases where the geometry was obvious (e.g. unipotents) to remember the general formula actually amounts to a geometric proof of the general formula, if one does enough geometric special cases. – Daniel Litt Feb 22 '12 at 18:19
• Since KConrad entered the discussion, I'll mention that he wrote up a great treatment of the Iwasawa decomposition: math.uconn.edu/~kconrad/blurbs/grouptheory/SL(2,R).pdf – Frank Thorne Feb 23 '12 at 3:55

Think about $\left({\phantom-d\phantom--b\atop-c\phantom{--}a}\right)$ as $tI - A$ where $t=a+d$ is the trace of $A$. Since $A$ satisfies its own characteristic equation (Cayley-Hamilton), we have $A^2 - t A + \Delta \cdot I = 0$ where $\Delta = ad-bc$ is the determinant. Thus $\Delta \cdot I = t A - A^2$. Now divide both sides by $\Delta \cdot A$ to get $A^{-1} = \Delta^{-1}(tI-A)$, QED.

• I sometimes give this and the $3 \times 3$ analog of this formula as an exercise; If A is an invertible $3 \times 3$ matrix then $A^{-1}=\Delta^{-1}(A^2-tA +\frac{t^2-s}{2}I)$ where $s=tr(A^2)$, and secretly I'm assuming $1 \neq =-1$. – Guillermo Mantilla Feb 21 '12 at 6:55
• Noam, you win Linear Algebra. (To supplement this, maybe you could provide an entertaining linear-algebra-related anagram or two.) – Elizabeth S. Q. Goodman Feb 21 '12 at 7:37
• That is awesome. – Frank Thorne Feb 21 '12 at 15:12
• @Elizabeth S. Q. Goodman: thanks! :-) Linear-algebra anagrams, though? My heuristic for finding "list anagrams" via lattice basis reduction is linear algebra of a kind, but that's surely not what you meant. The closest I can come is something like "label ${\bf R} \oplus {\bf R}$ again", which is what a ${\rm GL}_2({\bf R})$ matrix does, and is an anagram of "linear alg$\oplus$bra". Likewise "label ${\bf R}^e/{\bf R}$ again", which works exactly if I may ignore the "/". Otherwise, try posting a "What are some good math anagrams?" question to mathoverflow ... – Noam D. Elkies Feb 26 '12 at 5:49
• [cont'd] ..., asking not to repeat old standards like logarithm/algorithm, $\int/\Delta$, and the Banach-Tarski joke. Make it community wiki, and hope some good examples get posted before the question gets closed. – Noam D. Elkies Feb 26 '12 at 5:49

Recall that the adjugate $\text{adj}(A)$ of a square matrix is a matrix that satisfies $$A \cdot \text{adj}(A) = \text{adj}(A) \cdot A = \det(A).$$

Like the determinant, the adjugate is multiplicative. Categorically, the reason the determinant is multiplicative is that it comes from a functor (the exterior power), so one might expect that the adjugate also comes from a functor, and indeed it does (the same functor!).

More precisely, let $T : V \to V$ be a linear transformation on a finite-dimensional vector space with basis $e_1, ... e_n$. Then the adjugate of the matrix of $T$ with respect to the basis $e_i$ is the matrix of $\Lambda^{n-1}(T) : \Lambda^{n-1}(V) \to \Lambda^{n-1}(V)$ with respect to an appropriate "dual basis" $$(-1)^{i-1} \bigwedge_{j \neq i} e_j$$ of $\Lambda^{n-1}(V)$ (it becomes an actual dual basis if you identify $\Lambda^n(V)$ with the underlying field $k$ by sending $e_1 \wedge ... \wedge e_n$ to $1$). The exterior product $V \times \Lambda^{n-1}(V) \to \Lambda^n(V)$ can then be identified with the dual pairing $V \times V^{\ast} \to k$, and the action of the exterior product on endomorphisms of $V$ and $\Lambda^{n-1}(V)$ can be identified with the composition of endomorphisms of $V$ (remembering that $\text{End}(V)$ is canonically isomorphic to $\text{End}(V^{\ast})$). This categorifies the above statement.

When $n = 2$, the dual basis is $e_2, - e_1$ but $\Lambda^1$ is the identity functor, and the formula follows. The geometric intuition comes from thinking about the exterior product in terms of oriented areas of parallelograms in $\mathbb{R}^2$.

• Yeah, I think "$A^{-1} = \frac{1}{\det(A)}\adj (A)$" is the easiest way to remember, because for a 2x2 matrix computing the adjugate is trivial – William Feb 21 '12 at 5:22
• @Frank: I guess the geometric picture is something like this. Identifying $\Lambda^2(V)$ with $\mathbb{R}$ corresponds to choosing a volume form on $\mathbb{R}^2$, equivalently a symplectic form. So $\text{SL}_2(\mathbb{R})$ is isomorphic to the symplectic group and the inverse and symplectic adjoint coincide for matrices of determinant $1$. Now the symplectic adjoint satisfies $\langle Tv, w \rangle = \langle v, T^{\dagger} w \rangle$ where $\langle , \rangle$ denotes the symplectic form, and plugging $e_1, e_2$ into $v, w$ one can see what this condition means geometrically. – Qiaochu Yuan Feb 21 '12 at 18:26
• This is fantastic! I always thought the adjugate was just another "playing with squares of numbers" trick... I'm pleasantly surprised to see that it has a "deeper meaning." – Vectornaut Feb 22 '12 at 14:37
• This is essentially how I teach Cramer's rule. – Allen Knutson Mar 3 '12 at 23:21
• In particular, the adjugate has two weirdnesses: the size $n-1$ determinants, and the transpose. Those are coming from the $\Lambda^{n-1}$ and the ${}^*$, respectively. – Allen Knutson Oct 7 '15 at 21:29

I remember the inverse by looking at the corresponding linear fractional transformation. It sends $\frac{-d}{c}$ to $\infty$ and $\infty$ to $\frac{a}{c}$, so the inverse had better reverse this; it follows that the $c$ should stay put and the $a$ and $d$ should switch, and so the $b$ and $c$ get negated.

• Strictly speaking this determines the inverse only up to sign, but this is still a good way for remembering the formula. – François Brunault Feb 22 '12 at 16:44
• 1+, this nice! Just for completeness: The linear fractional transformation is $\mathbb{P}^1 \to \mathbb{P}^1$, $z \mapsto \tfrac{az+b}{cz+d}$. – Martin Brandenburg Feb 22 '12 at 20:05
• @Martin: Yes, thank you. @François: Yes, true; I should mention that I was assuming the "switch one pair and negate the other" comment from the original question! – Grant Lakeland Feb 22 '12 at 21:27

This is essentially the same as Tobias Hagge's answer and Jonny Evans's comment, but I thought that writing it up in this way would make things clearer.

Think about the product $$\begin{bmatrix} a & b\\\\ c & d \end{bmatrix} \begin{bmatrix} ? & ?\\\\ ? & ? \end{bmatrix} =\begin{bmatrix} ad-bc & 0\\\\ 0 & ad-bc \end{bmatrix}.$$ Focus on the zero in position $(2,1)$ in the RHS. In order to get it with the row-by-column rule, the first column of the unknown matrix must be $\begin{bmatrix}d\\\\-c\end{bmatrix}$.

(Well, apart from the sign --- you could still get it wrong. But you can check that it is correct by computing the $(1,1)$ entry of the product.)

Now focus on the other zero entry in position (1,2) of the RHS, and you'll see that the second column must be $\begin{bmatrix}-b\\\\a\end{bmatrix}$. Again, if you're confused about the sign, just check the $(2,2)$ entry.

• (Warning: this answer from a numerical linear algebraist/matrix theorist. We guys do not have a dime of geometrical intuition, and like to always think about squares full of numbers.) – Federico Poloni Feb 23 '12 at 8:37
• Geometrically, the off-diagonal elements of the resulting identity matrix being zero translates into the first column of the inverse matrix being orthogonal to the second row of the matrix to be inverted (A) and likewise for the second column of the inverse and the first row of the matrix A. Overall signs are determined by correct orientation of the orthognal vectors to give a normalization by the signed area (determinant) to unity. – Tom Copeland Apr 23 '15 at 20:03
• I.e., an orientation and scaling giving unity for the inner products of the first (second) column of the inverse and first (second) row of A. – Tom Copeland Apr 25 '15 at 16:42

$\bullet$ The sign switch is familiar from complex numbers:

The regular representation of $\mathbb{C}$ over $\mathbb{R}$ is the embedding of $\mathbb{R}$-algebras $\mathbb{C} \to M_2(\mathbb{R})$ defined by $a+ib \mapsto \begin{pmatrix} a & -b \\ b & a \end{pmatrix}$. The inverse of $a+ib$ is the conjugate $a-ib$ divided by the norm $a^2+b^2$, thus the inverse of $\begin{pmatrix} a & -b \\ b & a \end{pmatrix}$ is the adjugate $\begin{pmatrix} a & b \\ -b & a \end{pmatrix}$ divided by the determinant $a^2+b^2$.

$\bullet$ Both the sign switch and the swap of the diagonal entries can be illustrated with quaternions:

The regular representations of $\mathbb{H}$ over $\mathbb{C}$ is the embedding $\mathbb{H} \to M_2(\mathbb{C})$ mapping $u+jv \mapsto \begin{pmatrix} u & v \\ - \overline{v} & \overline{u} \end{pmatrix}$. The inverse of $u + jv$ is the conjugate $\overline{u} - j \overline{v}$ divided by the norm $|u|^2+|v|^2$. Thus, the inverse of $\begin{pmatrix} u & v \\ - \overline{v} & \overline{u} \end{pmatrix}$ is the adjugate $\begin{pmatrix} \overline{u} & -v \\ \overline{v} & u \end{pmatrix}$ divided by the determinant $|u|^2+|v|^2$.

My answer is not very highfaluting, but it is what I use to remember. Switch the diagonals, change the signs of the off-diagonals and divide by the determinant. Since the inverse of a diagonal matrix is easy, the switch should be easy to remember. On the other hand such mnemonics are dangerous. The critical points of a cubic $Ax^3+Bx^2+Cx+D$ are at $\frac{-B\pm\sqrt{B^2-3AC}}{3A}$, or so I remember.

• Isn't that off by exactly a factor of two? Is that the point? – Will Sawin Feb 22 '12 at 22:52
• Yes, it was off by a factor of 2. And I had remembered it incorrectly. I was too lazy to compute it at the time I wrote the post --- the computer was on my lap and the pen was across the room ;). I think that was the point. – Scott Carter Feb 23 '12 at 3:24

Mnemonic: make the product diagonals the determinant, then scale.

The off diagonals are zero because the area of a parallelogram with planar edge vectors $c_1,c_2$ is the length of the scaled projection $|c_1 \cdot i c_2| = |c_2 \cdot i c_1|$, and the mnemonic sets row $r_k$ in the inverse to $(ic_{3 - k})^T$.

It is probably too old question to answer, but I couldn't resist. Consider $M_2\mathbb R$=$\{a+b\iota :a,b\in \mathbb C\}$. Additional relations are present: $\iota^2=1$, $\iota b=\bar b\iota$, which make enough to multiply $2\times 2$ matrices as split quaternions. For reader convenience $\iota=\begin{pmatrix} 1 & 0 \\\ 0 & -1 \end{pmatrix}$.

Now adjugate matrix to $a+b\iota$ is $\bar a-b\iota$. Let's calculate $(a+b\iota)(\bar a-b\iota)=a\bar a-b\bar b+(-ab+ba)\iota=a\bar a-b\bar b$, because complex numbers multiplication is commutative.

The determinant of matrix $a+b\iota$ is $a\bar a-b\bar b$.