This repository has been archived by the owner on Aug 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
/
determinant-cofactors.xml
1163 lines (1088 loc) · 51.4 KB
/
determinant-cofactors.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!--********************************************************************
Copyright 2017 Georgia Institute of Technology
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation. A copy of
the license is included in gfdl.xml.
*********************************************************************-->
<section xml:id="determinants-cofactors">
<title>Cofactor Expansions</title>
<objectives>
<ol>
<li>Learn to recognize which methods are best suited to compute the determinant of a given matrix.</li>
<li><em>Recipes:</em> the determinant of a <m>3\times 3</m> matrix, compute the determinant using cofactor expansions.</li>
<li><em>Vocabulary words:</em> <term>minor</term>, <term>cofactor</term>.</li>
</ol>
</objectives>
<introduction>
<p>
In this section, we give a recursive formula for the determinant of a matrix, called a <em>cofactor expansion</em>. The formula is recursive in that we will compute the determinant of an <m>n\times n</m> matrix <em>assuming</em> we already know how to compute the determinant of an <m>(n-1)\times(n-1)</m> matrix.
</p>
<p>
At the end is a supplementary subsection on Cramer<rsq/>s rule and a cofactor formula for the inverse of a matrix.
</p>
</introduction>
<subsection>
<title>Cofactor Expansions</title>
<p>
A recursive formula must have a starting point. For cofactor expansions, the starting point is the case of <m>1\times 1</m> matrices. The definition of determinant directly implies that
<me>\det\mat a=a.</me>
To describe cofactor expansions, we need to introduce some notation.
</p>
<definition xml:id="det-cofact-defn-minor">
<idx><h>Matrix</h><h>minor of</h></idx>
<idx><h>Minor</h><see>Matrix</see></idx>
<idx><h>Matrix</h><h>cofactor of</h></idx>
<idx><h>Cofactor</h><see>Matrix</see></idx>
<notation><usage>A_{ij}</usage><description>Minor of a matrix</description></notation>
<notation><usage>C_{ij}</usage><description>Cofactor of a matrix</description></notation>
<statement>
<p>Let <m>A</m> be an <m>n\times n</m> matrix.
<ol>
<li>
The <m>(i,j)</m> <term>minor,</term> denoted <m>A_{ij}</m>, is the <m>(n-1)\times (n-1)</m> matrix obtained from <m>A</m> by deleting the <m>i</m>th row and the <m>j</m>th column.
</li>
<li>
The <m>(i,j)</m> <term>cofactor</term> <m>C_{ij}</m> is defined in terms of the minor by
<me>C_{ij}=(-1)^{i+j}\det(A_{ij}).</me>
</li>
</ol>
</p>
</statement>
</definition>
<p>
<idx><h>Matrix</h><h>cofactor of</h><h>sign of</h></idx>
Note that the signs of the cofactors follow a <q>checkerboard pattern.</q> Namely, <m>(-1)^{i+j}</m> is pictured in this matrix:
<me>\def\a{\textcolor{seq-green}{+}} \def\b{\textcolor{seq-blue}{-}}
\mat{\a,\b,\a,\b ; \b,\a,\b,\a ; \a,\b,\a,\b; \b,\a,\b,\a}.</me>
</p>
<example>
<statement>
<p>
For
<me>A= \mat{1 2 3;4 5 6;7 8 9},</me>
compute <m>A_{23}</m> and <m>C_{23}.</m>
</p>
</statement>
<solution>
<p>
<latex-code><![CDATA[
\begin{tikzpicture}[all nodes={}]
\node at (0, 0) [anchor=east] {$A_{23} = {}\;$};
\matrix (a) at (0, 0) [math matrix, anchor=west,
every matrix/.append style={nodes={minimum width=.6em, minimum height=.6em}}
] {
1 \& 2 \& 3 \\ 4 \& 5 \& 6 \\ 7 \& 8 \& 9 \\
};
\node at (a.east) [anchor=west] (a23) {$\;{} = \mat{1 2 ; 7 8}$};
\node at (a23.east) [anchor=west, xshift=1em]
{$C_{23} = (-1)^{2+3}\det\mat{1 2; 7 8} = (-1)(-6) = 6$};
\begin{scope}[every node/.style={
seq-green, draw, thick, circle, inner sep=1pt, opacity=1},
decoration={zigzag,segment length=1.5mm}, seq-red, thick, opacity=.7,
line join=round]
\node[fit=(a-2-3)] {};
\draw[decorate] (a-2-1.west) -- (a-2-3.east);
\draw[decorate] (a-1-3.north) -- (a-3-3.south);
\end{scope}
\end{tikzpicture}
]]>
</latex-code>
</p>
</solution>
</example>
<p>
The cofactors <m>C_{ij}</m> of an <m>n\times n</m> matrix are determinants of <m>(n-1)\times(n-1)</m> submatrices. Hence the following theorem is in fact a recursive procedure for computing the determinant.
</p>
<theorem xml:id="det-cofact-expansion">
<title>Cofactor expansion</title>
<idx><h>Determinant</h><h>computation of</h><h>cofactor expansion</h></idx>
<idx><h>Matrix</h><h>cofactor of</h><h>and determinants</h></idx>
<statement>
<p>
Let <m>A</m> be an <m>n\times n</m> matrix with entries <m>a_{ij}</m>.
<ol>
<li>
For any <m>i = 1,2,\ldots,n</m>, we have
<me>
\det(A) = \sum_{j=1}^n a_{ij}C_{ij}
= a_{i1}C_{i1} + a_{i2}C_{i2} + \cdots + a_{in}C_{in}.
</me>
This is called <term>cofactor expansion along the <m>i</m>th row.</term>
</li>
<li>
For any <m>j = 1,2,\ldots,n</m>, we have
<me>
\det(A) = \sum_{i=1}^n a_{ij}C_{ij}
= a_{1j}C_{1j} + a_{2j}C_{2j} + \cdots + a_{nj}C_{nj}.
</me>
This is called <term>cofactor expansion along the <m>j</m>th column.</term>
</li>
</ol>
</p>
</statement>
<proof>
<p>
First we will prove that cofactor expansion along the first column computes the determinant. Define a function <m>d\colon\{n\times n\text{ matrices}\}\to\R</m> by
<me>d(A) = \sum_{i=1}^n (-1)^{i+1} a_{i1}\det(A_{i1}).</me>
We want to show that <m>d(A) = \det(A)</m>. Instead of showing that <m>d</m> satisfies the four <xref ref="det-defn-the-defn">defining properties of the determinant</xref>, we will prove that it satsifies the three <xref ref="det-defn-use-multi">alternative defining properties</xref>, which were shown to be equivalent.
<ol>
<li>
<p>
We claim that <m>d</m> is multilinear in the rows of <m>A</m>. Let <m>A</m> be the matrix with rows <m>v_1,v_2,\ldots,v_{i-1},v+w,v_{i+1},\ldots,v_n</m>:
<me>
A = \mat{a_{11} a_{12} a_{13};
b_1+c_1 b_2+c_2 b_3+c_3;
a_{31} a_{32} a_{33}}.
</me>
Here we let <m>b_i</m> and <m>c_i</m> be the entries of <m>v</m> and <m>w</m>, respectively. Let <m>B</m> and <m>C</m> be the matrices with rows <m>v_1,v_2,\ldots,v_{i-1},v,v_{i+1},\ldots,v_n</m> and <m>v_1,v_2,\ldots,v_{i-1},w,v_{i+1},\ldots,v_n</m>, respectively:
<me>
B = \mat[r]{a_{11} a_{12} a_{13};
b_1 b_2 b_3;
a_{31} a_{32} a_{33}} \qquad
C = \mat{a_{11} a_{12} a_{13};
c_1 c_2 c_3;
a_{31} a_{32} a_{33}}.
</me>
We wish to show <m>d(A) = d(B) + d(C)</m>. For <m>i'\neq i</m>, the <m>(i',1)</m>-cofactor of <m>A</m> is the sum of the <m>(i',1)</m>-cofactors of <m>B</m> and <m>C</m>, by multilinearity of the determinants of <m>(n-1)\times(n-1)</m> matrices:
<me>
\begin{split}
(-1)^{3+1}\det(A_{31})
\amp= (-1)^{3+1}\det\mat{a_{12} a_{13}; b_2+c_2 b_3+c_3} \\
\amp= (-1)^{3+1}\det\mat{a_{12} a_{13}; b_2 b_3}
+ (-1)^{3+1}\det\mat{a_{12} a_{13}; c_2 c_3} \\
\amp= (-1)^{3+1}\det(B_{31}) + (-1)^{3+1}\det(C_{31}).
\end{split}
</me>
On the other hand, the <m>(i,1)</m>-cofactors of <m>A,B,</m> and <m>C</m> are all the same:
<me>
\begin{split}
(-1)^{2+1} \det(A_{21})
\amp= (-1)^{2+1} \det\mat{a_{12} a_{13}; a_{32} a_{33}} \\
\amp= (-1)^{2+1} \det(B_{21}) = (-1)^{2+1} \det(C_{21}).
\end{split}
</me>
Now we compute
<me>
\begin{split}
d(A) \amp=
(-1)^{i+1} (b_i + c_i)\det(A_{i1})
+ \sum_{i'\neq i} (-1)^{i'+1} a_{i1}\det(A_{i'1}) \\
\amp= (-1)^{i+1} b_i\det(B_{i1}) + (-1)^{i+1} c_i\det(C_{i1}) \\
\amp\qquad\qquad+ \sum_{i'\neq i} (-1)^{i'+1}
a_{i1}\bigl(\det(B_{i'1}) + \det(C_{i'1})\bigr) \\
\amp= \left[(-1)^{i+1} b_i\det(B_{i1}) + \sum_{i'\neq i}
(-1)^{i'+1} a_{i1}\det(B_{i'1})\right] \\
\amp\qquad\qquad+ \left[(-1)^{i+1} c_i\det(C_{i1}) + \sum_{i'\neq i}
(-1)^{i'+1} a_{i1}\det(C_{i'1})\right] \\
\amp= d(B) + d(C),
\end{split}
</me>
as desired. This shows that <m>d(A)</m> satisfies the first <xref ref="linear-trans-defn" text="title">defining property</xref> in the rows of <m>A</m>.
</p>
<p>
We still have to show that <m>d(A)</m> satisfies the second <xref ref="linear-trans-defn" text="title">defining property</xref> in the rows of <m>A</m>. Let <m>B</m> be the matrix obtained by scaling the <m>i</m>th row of <m>A</m> by a factor of <m>c</m>:
<me>
A = \mat{a_{11} a_{12} a_{13}; a_{21} a_{22} a_{23}; a_{31} a_{32} a_{33}}
\qquad
B = \mat{a_{11} a_{12} a_{13}; ca_{21} ca_{22} ca_{23}; a_{31} a_{32} a_{33}}.
</me>
We wish to show that <m>d(B) = c\,d(A)</m>.
For <m>i'\neq i</m>, the <m>(i',1)</m>-cofactor of <m>B</m> is <m>c</m> times the <m>(i',1)</m>-cofactor of <m>A</m>, by multilinearity of the determinants of <m>(n-1)\times(n-1)</m>-matrices:
<me>
\begin{split}
(-1)^{3+1}\det(B_{31})
\amp= (-1)^{3+1}\det\mat{a_{12} a_{13}; ca_{22} ca_{23}} \\
\amp= (-1)^{3+1}\cdot c\det\mat{a_{12} a_{13}; a_{22} a_{23}}
= (-1)^{3+1}\cdot c\det(A_{31}).
\end{split}
</me>
On the other hand, the <m>(i,1)</m>-cofactors of <m>A</m> and <m>B</m> are the same:
<me>
(-1)^{2+1} \det(B_{21})
= (-1)^{2+1} \det\mat{a_{12} a_{13}; a_{32} a_{33}}
= (-1)^{2+1} \det(A_{21}).
</me>
Now we compute
<me>
\begin{split}
d(B) \amp= (-1)^{i+1}ca_{i1}\det(B_{i1})
+ \sum_{i'\neq i}(-1)^{i'+1} a_{i'1}\det(B_{i'1}) \\
\amp= (-1)^{i+1}ca_{i1}\det(A_{i1})
+ \sum_{i'\neq i}(-1)^{i'+1} a_{i'1}\cdot c\det(A_{i'1}) \\
\amp= c\left[(-1)^{i+1}ca_{i1}\det(A_{i1})
+ \sum_{i'\neq i}(-1)^{i'+1} a_{i'1} \det(A_{i'1})\right] \\
\amp= c\,d(A),
\end{split}
</me>
as desired. This completes the proof that <m>d(A)</m> is multilinear in the rows of <m>A</m>.
</p>
</li>
<li>
Now we show that <m>d(A) = 0</m> if <m>A</m> has two identical rows. Suppose that rows <m>i_1,i_2</m> of <m>A</m> are identical, with <m>i_1 \lt i_2</m>:
<me>
A = \mat{a_{11} a_{12} a_{13} a_{14};
a_{21} a_{22} a_{23} a_{24};
a_{31} a_{32} a_{33} a_{34};
a_{11} a_{12} a_{13} a_{14}}.
</me>
If <m>i\neq i_1,i_2</m> then the <m>(i,1)</m>-cofactor of <m>A</m> is equal to zero, since <m>A_{i1}</m> is an <m>(n-1)\times(n-1)</m> matrix with identical rows:
<me>
(-1)^{2+1}\det(A_{21}) = (-1)^{2+1}
\det\mat{a_{12} a_{13} a_{14};
a_{32} a_{33} a_{34};
a_{12} a_{13} a_{14}} = 0.
</me>
The <m>(i_1,1)</m>-minor can be transformed into the <m>(i_2,1)</m>-minor using <m>i_2 - i_1 - 1</m> row swaps:
<latex-code><![CDATA[
\begin{tikzpicture}
\matrix[math matrix] (A) {
a_{22} \& a_{23} \& a_{24} \\
a_{32} \& a_{33} \& a_{34} \\
a_{12} \& a_{13} \& a_{14} \\
};
\draw[<->] ($(A-2-3.east)+(3.5mm,0)$) to[bend left=50] ($(A-3-3.east)+(3.5mm,0)$);
\node[draw=seq-green, rounded corners, inner sep=1mm, fit=(A-3-1) (A-3-3)] {};
\matrix[math matrix, right=1.5cm of A] (B) {
a_{22} \& a_{23} \& a_{24} \\
a_{12} \& a_{13} \& a_{14} \\
a_{32} \& a_{33} \& a_{34} \\
};
\draw[<->] ($(B-1-3.east)+(3.5mm,0)$) to[bend left=50] ($(B-2-3.east)+(3.5mm,0)$);
\node[draw=seq-green, rounded corners, inner sep=1mm, fit=(B-2-1) (B-2-3)] {};
\matrix[math matrix, right=1.5cm of B] (C) {
a_{12} \& a_{13} \& a_{14} \\
a_{22} \& a_{23} \& a_{24} \\
a_{32} \& a_{33} \& a_{34} \\
};
\node[draw=seq-green, rounded corners, inner sep=1mm, fit=(C-1-1) (C-1-3)] {};
\node[left=2mm of A] {$A_{11} = {}$};
\node[right=2mm of C] {${} = A_{41}$};
\end{tikzpicture}
]]></latex-code>
Therefore,
<me>
(-1)^{i_1+1}\det(A_{i_11})
= (-1)^{i_1+1}\cdot(-1)^{i_2 - i_1 - 1}\det(A_{i_21})
= -(-1)^{i_2+1}\det(A_{i_21}).
</me>
The two remaining cofactors cancel out, so <m>d(A) = 0</m>, as desired.
</li>
<li>
It remains to show that <m>d(I_n) = 1</m>. The first is the only one nonzero term in the cofactor expansion of the identity:
<me>
d(I_n) = 1\cdot(-1)^{1+1}\det(I_{n-1}) = 1.
</me>
</li>
</ol>
This proves that <m>\det(A) = d(A)</m>, i.e., that cofactor expansion along the first column computes the determinant.
</p>
<p>
Now we show that cofactor expansion along the <m>j</m>th column also computes the determinant. By performing <m>j-1</m> column swaps, one can move the <m>j</m>th column of a matrix to the first column, keeping the other columns in order. For example, here we move the third column to the first, using two column swaps:
<latex-code><![CDATA[
\begin{tikzpicture}
\matrix[math matrix] (A) {
a_{11} \& a_{12} \& a_{13} \& a_{14} \\
a_{21} \& a_{22} \& a_{23} \& a_{24} \\
a_{31} \& a_{32} \& a_{33} \& a_{34} \\
a_{41} \& a_{42} \& a_{43} \& a_{44} \\
};
\draw[<->] ($(A-1-2.north)+(0,1.5mm)$) to[bend left=50] ($(A-1-3.north)+(0,1.5mm)$);
\node[draw=seq-green, rounded corners, inner sep=1mm, fit=(A-1-3) (A-4-3)] {};
\matrix[math matrix, right=1.5cm of A.east] (B) {
a_{11} \& a_{13} \& a_{12} \& a_{14} \\
a_{21} \& a_{23} \& a_{22} \& a_{24} \\
a_{31} \& a_{33} \& a_{32} \& a_{34} \\
a_{41} \& a_{43} \& a_{42} \& a_{44} \\
};
\draw[<->] ($(B-1-1.north)+(0,1.5mm)$) to[bend left=50] ($(B-1-2.north)+(0,1.5mm)$);
\node[draw=seq-green, rounded corners, inner sep=1mm, fit=(B-1-2) (B-4-2)] {};
\matrix[math matrix, right=1.5cm of B] (C) {
a_{13} \& a_{12} \& a_{11} \& a_{14} \\
a_{23} \& a_{22} \& a_{21} \& a_{24} \\
a_{33} \& a_{32} \& a_{31} \& a_{34} \\
a_{43} \& a_{42} \& a_{41} \& a_{44} \\
};
\node[draw=seq-green, rounded corners, inner sep=1mm, fit=(C-1-1) (C-4-1)] {};
\end{tikzpicture}
]]></latex-code>
Let <m>B</m> be the matrix obtained by moving the <m>j</m>th column of <m>A</m> to the first column in this way. Then the <m>(i,j)</m> minor <m>A_{ij}</m> is equal to the <m>(i,1)</m> minor <m>B_{i1}</m>, since deleting the <m>i</m>th column of <m>A</m> is the same as deleting the first column of <m>B</m>. By construction, the <m>(i,j)</m>-entry <m>a_{ij}</m> of <m>A</m> is equal to the <m>(i,1)</m>-entry <m>b_{i1}</m> of <m>B</m>. Since we know that we can compute determinants by expanding along the first column, we have
<me>
\det(B) = \sum_{i=1}^n (-1)^{i+1} b_{i1}\det(B_{i1})
= \sum_{i=1}^n (-1)^{i+1} a_{ij}\det(A_{ij}).
</me>
Since <m>B</m> was obtained from <m>A</m> by performing <m>j-1</m> column swaps, we have
<me>
\begin{split}
\det(A) = (-1)^{j-1}\det(B) \amp=
(-1)^{j-1}\sum_{i=1}^n (-1)^{i+1} a_{ij}\det(A_{ij}) \\
\amp= \sum_{i=1}^n (-1)^{i+j} a_{ij}\det(A_{ij}).
\end{split}
</me>
This proves that cofactor expansion along the <m>i</m>th column computes the determinant of <m>A</m>.
</p>
<p>
By the <xref ref="det-defn-trans-prop">transpose property</xref>, the cofactor expansion along the <m>i</m>th row of <m>A</m> is the same as the cofactor expansion along the <m>i</m>th column of <m>A^T</m>. Again by the transpose property, we have <m>\det(A)=\det(A^T)</m>, so expanding cofactors along a row also computes the determinant.
</p>
</proof>
</theorem>
<p>
Note that the theorem actually gives <m>2n</m> different formulas for the determinant: one for each row and one for each column. For instance, the formula for cofactor expansion along the first column is
<me>
\begin{split}
\det(A) = \sum_{i=1}^n a_{i1}C_{i1}
\amp= a_{11}C_{11} + a_{21}C_{21} + \cdots + a_{n1}C_{n1} \\
\amp= a_{11}\det(A_{11}) - a_{21}\det(A_{21}) + a_{31}\det(A_{31}) - \cdots \pm a_{n1}\det(A_{n1}).
\end{split}
</me>
Remember, the determinant of a matrix is just a number, defined by the four <xref ref="det-defn-the-defn">defining properties</xref>, so to be clear:
</p>
<bluebox>
<p>
You obtain the same number by expanding cofactors along <m>any</m> row or column.
</p>
</bluebox>
<p>
Now that we have a recursive formula for the determinant, we can finally prove the <xref ref="det-defn-unique">existence theorem</xref>.
</p>
<proof>
<p>
Let us review what we actually proved in <xref ref="determinants-definitions-properties"/>. We showed that if <m>\det\colon\{n\times n\text{ matrices}\}\to\R</m> is any function satisfying the four <xref ref="det-defn-the-defn" text="title">defining properties of the determinant</xref> (or the three <xref ref="det-defn-use-multi" text="title">alternative defining properties</xref>), then it also satisfies all of the wonderful properties proved in that section. In particular, since <m>\det</m> can be computed using row reduction by this <xref ref="det-defn-ref-compute"/>, it is uniquely characterized by the defining properties. What we did not prove was the existence of such a function, since we did not know that two different row reduction procedures would always compute the same answer.
</p>
<p>
Consider the function <m>d</m> defined by cofactor expansion along the first row:
<me>d(A) = \sum_{i=1}^n (-1)^{i+1} a_{i1}\det(A_{i1}).</me>
If we assume that the determinant exists for <m>(n-1)\times(n-1)</m> matrices, then there is no question that the function <m>d</m> exists, since we gave a formula for it. Moreover, we showed in the proof of the <xref ref="det-cofact-expansion"/> above that <m>d</m> satisfies the three alternative defining properties of the determinant, again only assuming that the determinant exists for <m>(n-1)\times(n-1)</m> matrices. This proves the existence of the determinant for <m>n\times n</m> matrices!
</p>
<p>
This is an example of a proof by <em>mathematical induction.</em> We start by noticing that <m>\det\mat a = a</m> satisfies the four defining properties of the determinant of a <m>1\times 1</m> matrix. Then we showed that the determinant of <m>n\times n</m> matrices exists, assuming the determinant of <m>(n-1)\times(n-1)</m> matrices exists. This implies that all determinants exist, by the following chain of logic:
<me>
1\times 1\text{ exists} \;\implies\;
2\times 2\text{ exists} \;\implies\;
3\times 3\text{ exists} \;\implies\; \cdots.
</me>
</p>
</proof>
<example>
<statement>
<p>Find the determinant of
<me>A= \mat{2 1 3;-1 2 1;-2 2 3}.</me>
</p>
</statement>
<solution>
<p>
We make the somewhat arbitrary choice to expand along the first row. The minors and cofactors are
<latex-code><![CDATA[
\begin{tikzpicture}[every matrix/.append style={nodes={
text width=1em, text height=.66em, text depth=.5ex, align=center}}]]
\matrix (a) at (0, 0) [math matrix, anchor=west] {
2 \& 1 \& 3 \\
-1 \& 2 \& 1 \\
-2 \& 2 \& 3 \\
};
\node [left=1mm of a] (A11) {$A_{11} = {}\;$};
\node [right=1mm of a] (a11)
{$\;{} = \mat{2 1; 2 3}$};
\node [right=1.5em of a11] (C11)
{$C_{11} = +\det\mat{2 1; 2 3} = 4$};
\matrix (b) at (a.south west) [math matrix, anchor=north west,
yshift=-.5em] {
2 \& 1 \& 3 \\
-1 \& 2 \& 1 \\
-2 \& 2 \& 3 \\
};
\node [left=1mm of b] (A12) {$A_{12} = {}\;$};
\node [right=1mm of b] (a12)
{$\;{} = \mat{-1 1; -2 3}$};
\node at (C11.west |- a12.east) [anchor=west] (C12)
{$C_{12} = -\det\mat{-1 1; -2 3} = 1$};
\matrix (c) at (b.south west) [math matrix, anchor=north west,
yshift=-.5em] {
2 \& 1 \& 3 \\
-1 \& 2 \& 1 \\
-2 \& 2 \& 3 \\
};
\node [left=1mm of c] (A13) {$A_{13} = {}\;$};
\node [right=1mm of c] (a13)
{$\;{} = \mat{-1 2; -2 2}$};
\node at (C12.west |- a13.east) [anchor=west] (C13)
{$C_{13} = +\det\mat{-1 2; -2 2} = 2$.};
\begin{scope}[every node/.style={
seq-green, draw, thick, circle, inner sep=0pt, opacity=1},
decoration={zigzag,segment length=2mm, amplitude=.5em}, seq-red, thick, opacity=.7,
line join=round]
\node[fit=(a-1-1)] {};
\draw[decorate] (a-1-1.west) -- (a-1-3.east);
\draw[decorate] (a-1-1.north) -- (a-3-1.south);
\node[fit=(b-1-2)] {};
\draw[decorate] (b-1-1.west) -- (b-1-3.east);
\draw[decorate] (b-1-2.north) -- (b-3-2.south);
\node[fit=(c-1-3)] {};
\draw[decorate] (c-1-1.west) -- (c-1-3.east);
\draw[decorate] (c-1-3.north) -- (c-3-3.south);
\end{scope}
\end{tikzpicture}
]]></latex-code>
Thus,
<me>\det(A)=a_{11}C_{11}+a_{12}C_{12}+a_{13}C_{13} =(2)(4)+(1)(1)+(3)(2)=15.</me>
</p>
</solution>
</example>
<specialcase hide-type="true" xml:id="det-cofactor-22">
<title>The determinant of a <m>2\times 2</m> matrix</title>
<idx><h>Determinant</h><h>of a <m>2\times 2</m> matrix</h></idx>
<p>
Let us compute (again) the determinant of a general <m>2\times2</m> matrix
<me>A=\mat{a b;c d}.</me>
The minors are
<latex-code><![CDATA[
\begin{tikzpicture}[all nodes={},
every matrix/.append style={nodes={
text width=.7em, text height=.66em, text depth=.5ex}}]
\matrix (a) at (0, 0) [math matrix, anchor=west] {
a \& b \\ c \& d \\
};
\node [left=1mm of a] {$A_{11} = {}\;$};
\node [right=1mm of a] (a22) {$\;{} = \mat d$};
\matrix (b) [math matrix, right=4cm of a] {
a \& b \\ c \& d \\
};
\node [left=1mm of b] (A12) {$A_{12} = {}\;$};
\node [right=1mm of b] {$\;{} = \mat c$};
\matrix (c) at (a.south west) [math matrix, anchor=north west, yshift=-1em] {
a \& b \\ c \& d \\
};
\node [left=1mm of c] {$A_{21} = {}\;$};
\node [right=1mm of c] (a12) {$\;{} = \mat b$};
\matrix (d) at (b.south west) [math matrix, anchor=north west, yshift=-1em] {
a \& b \\ c \& d \\
};
\node [left=1mm of d] (A22) {$A_{22} = {}\;$};
\node [right=1mm of d] {$\;{} = \mat a$.};
\begin{scope}[every node/.style={
seq-green, draw, thick, circle, inner sep=1pt, opacity=1},
decoration={zigzag,segment length=1.5mm}, seq-red, thick, opacity=.7,
line join=round]
\node[fit=(a-1-1)] {};
\draw[decorate] (a-1-1.west) -- (a-1-2.east);
\draw[decorate] (a-1-1.north) -- (a-2-1.south);
\node[fit=(b-1-2)] {};
\draw[decorate] (b-1-1.west) -- (b-1-2.east);
\draw[decorate] (b-1-2.north) -- (b-2-2.south);
\node[fit=(c-2-1)] {};
\draw[decorate] (c-2-1.west) -- (c-2-2.east);
\draw[decorate] (c-2-1.south) -- (c-1-1.north);
\node[fit=(d-2-2)] {};
\draw[decorate] (d-2-1.west) -- (d-2-2.east);
\draw[decorate] (d-1-2.north) -- (d-2-2.south);
\end{scope}
\end{tikzpicture}
]]>
</latex-code>
The minors are all <m>1\times 1</m> matrices. As we have seen that the determinant of a <m>1\times1</m> matrix is just the number inside of it, the cofactors are therefore
<md>
<mrow>C_{11} &= {+\det(A_{11}) = d} &
C_{12} &= {-\det(A_{12}) = -c}</mrow>
<mrow>C_{21} &= {-\det(A_{21}) = -b} &
C_{22} &= {+\det(A_{22}) = a}</mrow>
</md>
Expanding cofactors along the first column, we find that
<me>\det(A)=aC_{11}+cC_{21} = ad - bc,</me>
which agrees with the formulas in this <xref ref="matrix-inv-def-det"/> and this <xref ref="det-defn-22-again"/>.
</p>
</specialcase>
<specialcase hide-type="true" xml:id="det-cofactor-33">
<title>The determinant of a <m>3\times 3</m> matrix</title>
<p>
We can also use cofactor expansions to find a formula for the determinant of a <m>3\times 3</m> matrix. Let is compute the determinant of
<me>A = \mat{a_{11} a_{12} a_{13}; a_{21} a_{22} a_{23}; a_{31} a_{32} a_{33}}</me>
by expanding along the first row. The minors and cofactors are:
<latex-code><![CDATA[
\begin{tikzpicture}[every matrix/.append style={nodes={
text width=1.2em, text height=.66em, text depth=.5ex}}]]
\matrix (a) at (0, 0) [math matrix, anchor=west] {
a_{11} \& a_{12} \& a_{13} \\
a_{21} \& a_{22} \& a_{23} \\
a_{31} \& a_{32} \& a_{33} \\
};
\node [left=1mm of a] (A11) {$A_{11} = {}\;$};
\node [right=1mm of a] (a11)
{$\;{} = \mat{a_{22} a_{23}; a_{32} a_{33}}$};
\node [right=1em of a11] (C11)
{$C_{11} = +\det\mat{a_{22} a_{23}; a_{32} a_{33}}$};
\matrix (b) at (a.south west) [math matrix, anchor=north west,
yshift=-.5em] {
a_{11} \& a_{12} \& a_{13} \\
a_{21} \& a_{22} \& a_{23} \\
a_{31} \& a_{32} \& a_{33} \\
};
\node [left=1mm of b] (A12) {$A_{12} = {}\;$};
\node [right=1mm of b] (a12)
{$\;{} = \mat{a_{21} a_{23}; a_{31} a_{33}}$};
\node at (C11.west |- a12.east) [anchor=west] (C12)
{$C_{12} = -\det\mat{a_{21} a_{23}; a_{31} a_{33}}$};
\matrix (c) at (b.south west) [math matrix, anchor=north west,
yshift=-.5em] {
a_{11} \& a_{12} \& a_{13} \\
a_{21} \& a_{22} \& a_{23} \\
a_{31} \& a_{32} \& a_{33} \\
};
\node [left=1mm of c] (A13) {$A_{13} = {}\;$};
\node [right=1mm of c] (a13)
{$\;{} = \mat{a_{21} a_{22}; a_{31} a_{32}}$};
\node at (C12.west |- a13.east) [anchor=west] (C13)
{$C_{13} = +\det\mat{a_{21} a_{22}; a_{31} a_{32}}$};
\begin{scope}[every node/.style={
seq-green, draw, thick, circle, inner sep=0pt, opacity=1},
decoration={zigzag,segment length=1.5mm}, seq-red, thick, opacity=.7,
line join=round]
\node[fit=(a-1-1)] {};
\draw[decorate] (a-1-1.west) -- (a-1-3.east);
\draw[decorate] (a-1-1.north) -- (a-3-1.south);
\node[fit=(b-1-2)] {};
\draw[decorate] (b-1-1.west) -- (b-1-3.east);
\draw[decorate] (b-1-2.north) -- (b-3-2.south);
\node[fit=(c-1-3)] {};
\draw[decorate] (c-1-1.west) -- (c-1-3.east);
\draw[decorate] (c-1-3.north) -- (c-3-3.south);
\end{scope}
\end{tikzpicture}
]]>
</latex-code>
The determinant is:
<md>
<mrow>\det(A) \amp= a_{11}C_{11} + a_{12}C_{12} + a_{13}C_{13}</mrow>
<mrow>\amp= a_{11}\det\mat{a_{22} a_{23}; a_{32} a_{33}}
- a_{12}\det\mat{a_{21} a_{23}; a_{31} a_{33}}
+ a_{13}\det\mat{a_{21} a_{22}; a_{31} a_{32}}
</mrow>
<mrow>\amp=
a_{11}(a_{22}a_{33}-a_{23}a_{32})
- a_{12}(a_{21}a_{33}-a_{23}a_{31})
+ a_{13}(a_{21}a_{32}-a_{22}a_{31})
</mrow>
<mrow>\amp=
a_{11}a_{22}a_{33} + a_{12}a_{23}a_{31} + a_{13}a_{21}a_{32}
-a_{13}a_{22}a_{31} - a_{11}a_{23}a_{32} - a_{12}a_{21}a_{33}.
</mrow>
</md>
</p>
</specialcase>
<p>
The formula for the determinant of a <m>3\times 3</m> matrix looks too complicated to memorize outright. Fortunately, there is the following mnemonic device.
</p>
<bluebox>
<title>Recipe: Computing the Determinant of a <m>3\times 3</m> Matrix</title>
<idx><h>Determinant</h><h>of a <m>3\times 3</m> matrix</h></idx>
<p>
To compute the determinant of a <m>3\times 3</m> matrix, first draw a larger matrix with the first two columns repeated on the right. Then add the products of the downward diagonals together, and subtract the products of the upward diagonals:
<latex-code><![CDATA[
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\[
\det\mat{a_{11} a_{12} a_{13}; a_{21} a_{22} a_{23}; a_{31} a_{32} a_{33}}
= \begin{aligned}
\amp\textcolor{seq-green}{
a_{11}a_{22}a_{33} + a_{12}a_{23}a_{31} + a_{13}a_{21}a_{32}} \\
\amp\quad
\textcolor{seq-blue}{
-a_{13}a_{22}a_{31} - a_{11}a_{23}a_{32} - a_{12}a_{21}a_{33}}
\end{aligned}
\]
\centering
\begin{tikzpicture}[baseline=(a-2-1.base)]
\matrix (a) [matrix of math nodes, nodes={minimum width=2em}]
{ a_{11} \& a_{12} \& a_{13} \& a_{11} \& a_{12} \\
a_{21} \& a_{22} \& a_{23} \& a_{21} \& a_{22} \\
a_{31} \& a_{32} \& a_{33} \& a_{31} \& a_{32} \\
};
\begin{pgfonlayer}{background}
\draw[seq-green!30!white, line cap=round, line width=1em]
($(-3pt,3pt)+(a-1-1.center)$) -- ($(3pt,-3pt)+(a-3-3.center)$)
($(-3pt,3pt)+(a-1-2.center)$) -- ($(3pt,-3pt)+(a-3-4.center)$)
($(-3pt,3pt)+(a-1-3.center)$) -- ($(3pt,-3pt)+(a-3-5.center)$);
\end{pgfonlayer}
\node (minus) [right=2mm of a] {$-$};
\matrix (b) [matrix of math nodes, nodes={minimum width=2em}, right=2mm of minus]
{ a_{11} \& a_{12} \& a_{13} \& a_{11} \& a_{12} \\
a_{21} \& a_{22} \& a_{23} \& a_{21} \& a_{22} \\
a_{31} \& a_{32} \& a_{33} \& a_{31} \& a_{32} \\
};
\begin{pgfonlayer}{background}
\draw[seq-blue!30!white, line cap=round, line width=1em]
($(3pt,3pt)+(b-1-3.center)$) -- ($(-3pt,-3pt)+(b-3-1.center)$)
($(3pt,3pt)+(b-1-4.center)$) -- ($(-3pt,-3pt)+(b-3-2.center)$)
($(3pt,3pt)+(b-1-5.center)$) -- ($(-3pt,-3pt)+(b-3-3.center)$);
\end{pgfonlayer}
\end{tikzpicture}
]]></latex-code>
</p>
</bluebox>
<p>
Alternatively, it is not necessary to repeat the first two columns if you allow your diagonals to <q>wrap around</q> the sides of a matrix, like in <url href="https://en.wikipedia.org/wiki/Pac-Man">Pac-Man</url> or <url href="https://en.wikipedia.org/wiki/Asteroids_(video_game)">Asteroids</url>.
</p>
<example>
<statement>
<p>
Find the determinant of <m>A=\mat{1 3 5; 2 0 -1; 4 -3 1}</m>.
</p>
</statement>
<solution>
<p>
We repeat the first two columns on the right, then add the products of the downward diagonals and subtract the products of the upward diagonals:
<latex-code><![CDATA[
\centering
\begin{tikzpicture}
\matrix (a) [matrix of math nodes, nodes={minimum width=2em}]
{ 1 \& 3 \& 5 \& 1 \& 3 \\
2 \& 0 \& -1 \& 2 \& 0 \\
4 \& -3 \& 1 \& 4 \& -3 \\
};
\begin{pgfonlayer}{background}
\draw[seq-green!30!white, line cap=round, line width=1em]
($(-3pt,3pt)+(a-1-1.center)$) -- ($(3pt,-3pt)+(a-3-3.center)$)
($(-3pt,3pt)+(a-1-2.center)$) -- ($(3pt,-3pt)+(a-3-4.center)$)
($(-3pt,3pt)+(a-1-3.center)$) -- ($(3pt,-3pt)+(a-3-5.center)$);
\end{pgfonlayer}
\node (minus) [right=2mm of a] {$-$};
\matrix (b) [matrix of math nodes, nodes={minimum width=2em}, right=2mm of minus]
{ 1 \& 3 \& 5 \& 1 \& 3 \\
2 \& 0 \& -1 \& 2 \& 0 \\
4 \& -3 \& 1 \& 4 \& -3 \\
};
\begin{pgfonlayer}{background}
\draw[seq-blue!30!white, line cap=round, line width=1em]
($(3pt,3pt)+(b-1-3.center)$) -- ($(-3pt,-3pt)+(b-3-1.center)$)
($(3pt,3pt)+(b-1-4.center)$) -- ($(-3pt,-3pt)+(b-3-2.center)$)
($(3pt,3pt)+(b-1-5.center)$) -- ($(-3pt,-3pt)+(b-3-3.center)$);
\end{pgfonlayer}
\end{tikzpicture}
\[
\det\mat{1 3 5; 2 0 -1; 4 -3 1}
= \begin{aligned}
\amp\textcolor{seq-green}{(1)(0)(1)+(3)(-1)(4)+(5)(2)(-3)} \\
\amp\quad\textcolor{seq-blue}{{}-(5)(0)(4)-(1)(-1)(-3)-(3)(2)(1)}
\end{aligned}
= -51.
\]
]]></latex-code>
</p>
</solution>
</example>
<p>
Cofactor expansions are most useful when computing the determinant of a matrix that has a row or column with several zero entries. Indeed, if the <m>(i,j)</m> entry of <m>A</m> is zero, then there is no reason to compute the <m>(i,j)</m> cofactor. In the following example we compute the determinant of a matrix with two zeros in the fourth column by expanding cofactors along the fourth column.
</p>
<example>
<statement>
<p>Find the determinant of
<me>A= \mat{2 5 -3 -2;-2 -3 2 -5;1 3 -2 0;-1 6 4 0}.</me>
</p>
</statement>
<solution>
<p>
The fourth column has two zero entries. We expand along the fourth column to find
<me>
\begin{split}
\det(A) \amp= 2\det\mat{-2 -3 2;1 3 -2;-1 6 4}
-5 \det \mat{2 5 -3;1 3 -2;-1 6 4} \\
\amp\qquad - 0\det(\text{don't care}) + 0\det(\text{don't care}).
\end{split}
</me>
We only have to compute two cofactors. We can find these determinants using any method we wish; for the sake of illustration, we will expand cofactors on one and use the formula for the <m>3\times 3</m> determinant on the other.
</p>
<p>
Expanding along the first column, we compute
<md>
<mrow>
& \det \mat{-2 -3 2;1 3 -2;-1 6 4}
</mrow>
<mrow>
& \quad= -2 \det \mat{3 -2;6 4} -\det \mat{-3 2;6 4} -\det \mat{-3 2;3 -2}
</mrow>
<mrow>
& \quad= -2 (24) -(-24) -0=-48+24+0=-24.
</mrow>
</md>
Using the formula for the <m>3\times 3</m> determinant, we have
<me>
\det\mat{2 5 -3; 1 3 -2; -1 6 4}
= \begin{aligned}
\amp\textcolor{seq-green}{(2)(3)(4) + (5)(-2)(-1)+(-3)(1)(6)} \\
\amp\quad\textcolor{seq-blue}{{}-(2)(-2)(6)-(5)(1)(4)-(-3)(3)(-1)}
\end{aligned}
= 11.
</me>
Thus, we find that
<me>\det(A)= 2(-24)-5(11)=-103.</me>
</p>
</solution>
</example>
<p>
Cofactor expansions are also very useful when computing the determinant of a matrix with unknown entries. Indeed, it is inconvenient to row reduce in this case, because one cannot be sure whether an entry containing an unknown is a pivot or not.
</p>
<example>
<statement>
<p>
Compute the determinant of this matrix containing the unknown <m>\lambda</m>:
<me>
A = \mat{-\lambda, 2 7 12; 3 1-\lambda, 2 -4; 0 1 -\lambda, 7; 0 0 0 2-\lambda}.
</me>
</p>
</statement>
<solution>
<p>
First we expand cofactors along the fourth row:
<me>
\begin{split}
\det(A) \amp= 0\det\mat\cdots + 0\det\mat\cdots + 0\det\mat\cdots \\
\amp\qquad+
(2-\lambda)\det\mat{-\lambda, 2 7; 3 1-\lambda, 2; 0 1 -\lambda}.
\end{split}
</me>
We only have to compute one cofactor. To do so, first we clear the <m>(3,3)</m>-entry by performing the column replacement <m>C_3 = C_3 + \lambda C_2</m>, which does not change the determinant:
<me>
\det\mat{-\lambda, 2 7; 3 1-\lambda, 2; 0 1 -\lambda}
= \det\mat{-\lambda, 2 7+2\lambda; 3 1-\lambda, 2+\lambda(1-\lambda); 0 1 0}.
</me>
Now we expand cofactors along the third row to find
<me>
\begin{split}
\det\mat{-\lambda, 2 7+2\lambda; 3 1-\lambda, 2+\lambda(1-\lambda); 0 1 0}
\amp= (-1)^{2+3}\det\mat{-\lambda, 7+2\lambda; 3 2+\lambda(1-\lambda)} \\
\amp= -\biggl(-\lambda\bigl(2+\lambda(1-\lambda)\bigr) - 3(7+2\lambda) \biggr) \\
\amp= -\lambda^3 + \lambda^2 + 8\lambda + 21.
\end{split}
</me>
Therefore, we have
<me>
\det(A) = (2-\lambda)(-\lambda^3 + \lambda^2 + 8\lambda + 21)
= \lambda^4 - 3\lambda^3 - 6\lambda^2 - 5\lambda + 42.
</me>
</p>
</solution>
</example>
<p>
It is often most efficient to use a combination of several techniques when computing the determinant of a matrix. Indeed, when expanding cofactors on a matrix, one can compute the determinants of the cofactors in whatever way is most convenient. Or, one can perform row and column operations to clear some entries of a matrix before expanding cofactors, as in the previous example.
</p>
<bluebox>
<title>Summary: methods for computing determinants</title>
<idx><h>Determinant</h><h>methods of computation</h></idx>
<p>
We have several ways of computing determinants:
<ol>
<li>
<p><em>Special formulas for <m>2\times 2</m> and <m>3\times 3</m> matrices.</em></p>
<p>
This is usually the best way to compute the determinant of a small matrix, except for a <m>3\times 3</m> matrix with several zero entries.
</p>
</li>
<li>
<p><em>Cofactor expansion.</em></p>
<p>
This is usually most efficient when there is a row or column with several zero entries, or if the matrix has unknown entries.
</p>
</li>
<li>
<p><em>Row and column operations.</em></p>
<p>
This is generally the fastest when presented with a large matrix which does not have a row or column with a lot of zeros in it.
</p>
</li>
<li>
<p><em>Any combination of the above.</em></p>
<p>
Cofactor expansion is recursive, but one can compute the determinants of the minors using whatever method is most convenient. Or, you can perform row and column operations to clear some entries of a matrix before expanding cofactors.
</p>
</li>
</ol>
Remember, <em>all methods for computing the determinant yield the same number.</em>
</p>
</bluebox>
</subsection>
<subsection hidden="true" xml:id="det-cofact-cramer-ss">
<title>Cramer<rsq/>s Rule and Matrix Inverses</title>
<p>
Recall from this <xref ref="matrix-inv-22"/> that one can compute the determinant of a <m>2\times 2</m> matrix using the rule
<me>A = \mat{d -b; -c a} \quad\implies\quad
A\inv = \frac 1{\det(A)}\mat{d -b; -c a}.</me>
We computed the cofactors of a <m>2\times 2</m> matrix in this <xref ref="det-cofactor-22"/>; using <m>C_{11}=d,\,C_{12}=-c,\,C_{21}=-b,\,C_{22}=a</m>, we can rewrite the above formula as
<me>A\inv = \frac 1{\det(A)}\mat{C_{11} C_{21}; C_{12} C_{22}}.</me>
It turns out that this formula generalizes to <m>n\times n</m> matrices.
</p>
<theorem xml:id="det-cofact-inv-cramer">
<idx><h>Determinant</h><h>and computing inverses</h></idx>
<idx><h>Cramer<rsq/>s rule</h><h>and computing inverses</h></idx>
<idx><h>Invertible matrix</h><h>computation</h><h>using Cramer<rsq/> rule</h></idx>
<statement>
<p>
Let <m>A</m> be an invertible <m>n\times n</m> matrix, with cofactors <m>C_{ij}</m>. Then
<men xml:id="det-cofact-inv-cramer-fn">
A\inv = \frac 1{\det(A)}
\mat{C_{11} C_{21} \cdots, C_{n-1,1} C_{n1};
C_{12} C_{22} \cdots, C_{n-1,2} C_{n2};
\vdots, \vdots, \ddots, \vdots, \vdots;
C_{1,n-1} C_{2,n-1} \cdots, C_{n-1,n-1} C_{n,n-1};
C_{1n} C_{2n} \cdots, C_{n-1,n} C_{nn}}.
</men>
</p>
</statement>
</theorem>
<p>
<notation><usage>\adj(A)</usage><description>Adjugate matrix</description></notation>
The matrix of cofactors is sometimes called the <term>adjugate matrix</term> of <m>A</m>, and is denoted <m>\adj(A)</m>:
<me>
\adj(A) = \mat{C_{11} C_{21} \cdots, C_{n-1,1} C_{n1};
C_{12} C_{22} \cdots, C_{n-1,2} C_{n2};
\vdots, \vdots, \ddots, \vdots, \vdots;
C_{1,n-1} C_{2,n-1} \cdots, C_{n-1,n-1} C_{n,n-1};
C_{1n} C_{2n} \cdots, C_{n-1,n} C_{nn}}.
</me>
Note that the <m>(i,j)</m> cofactor <m>C_{ij}</m> goes in the <m>(j,i)</m> entry the adjugate matrix, not the <m>(i,j)</m> entry: the adjugate matrix is the <em>transpose</em> of the cofactor matrix.
</p>
<remark>
<p>
In fact, one always has
<m>A\cdot\adj(A) = \adj(A)\cdot A = \det(A)I_n,</m>
whether or not <m>A</m> is invertible.
</p>
</remark>
<example>
<statement>
<p>
Use the <xref ref="det-cofact-inv-cramer"/> to compute <m>A\inv</m>, where
<me>A = \mat{1 0 1; 0 1 1; 1 1 0}.</me>
</p>
</statement>
<solution>
<p>
The minors are:
<latex-code>
\begin{align*}
A_{11} \amp= \mat{1 1; 1 0} \amp
A_{12} \amp= \mat{0 1; 1 0} \amp
A_{13} \amp= \mat{0 1; 1 1} \\
A_{21} \amp= \mat{0 1; 1 0} \amp
A_{22} \amp= \mat{1 1; 1 0} \amp
A_{23} \amp= \mat{1 0; 1 1} \\
A_{31} \amp= \mat{0 1; 1 1} \amp
A_{32} \amp= \mat{1 1; 0 1} \amp
A_{33} \amp= \mat{1 0; 0 1}
\end{align*}
</latex-code>
The cofactors are:
<latex-code>
\begin{align*}
C_{11} \amp= -1 \amp C_{12} \amp= \phantom-1 \amp C_{13} \amp= -1 \\
C_{21} \amp= \phantom-1 \amp C_{22} \amp= -1 \amp C_{23} \amp= -1 \\
C_{31} \amp= -1 \amp C_{32} \amp= -1 \amp C_{33} \amp= \phantom-1
\end{align*}
</latex-code>
Expanding along the first row, we compute the determinant to be
<me>
\det(A) = 1\cdot C_{11} + 0\cdot C_{12} + 1\cdot C_{13} = -2.
</me>
Therefore, the inverse is
<me>
A\inv = \frac 1{\det(A)}
\mat{C_{11} C_{21} C_{31}; C_{12} C_{22} C_{32}; C_{13} C_{23} C_{33}}
= -\frac12\mat[r]{-1 1 -1; 1 -1 -1; -1 -1 1}.
</me>
</p>
</solution>
</example>
<p>
It is clear from the previous example that <xref ref="det-cofact-inv-cramer-fn"/> is a very inefficient way of computing the inverse of a matrix, compared to augmenting by the identity matrix and row reducing, as in this <xref ref="matrix-inv-computing"/>. However, it has its uses.
<ul>
<li>
If a matrix has unknown entries, then it is difficult to compute its inverse using row reduction, for the same reason it is difficult to compute the determinant that way: one cannot be sure whether an entry containing an unknown is a pivot or not.
</li>
<li>
This formula is useful for theoretical purposes. Notice that the only denominators in <xref ref="det-cofact-inv-cramer-fn"/> occur when dividing by the determinant: computing cofactors only involves multiplication and addition, never division. This means, for instance, that if the determinant is very small, then any measurement error in the entries of the matrix is greatly magnified when computing the inverse. In this way, <xref ref="det-cofact-inv-cramer-fn"/> is useful in error analysis.
</li>
</ul>
</p>
<p>
The proof of the <xref ref="det-cofact-inv-cramer"/> uses an interesting trick called <em>Cramer<rsq/>s Rule</em>, which gives a formula for the entries of the solution of an invertible matrix equation.
</p>
<theorem hide-type="true" xml:id="det-cofact-cramers-rule">
<title>Cramer<rsq/>s Rule</title>
<idx><h>Cramer<rsq/>s rule</h></idx>
<statement>
<p>
Let <m>x = (x_1,x_2,\ldots,x_n)</m> be the solution of <m>Ax=b</m>, where <m>A</m> is an invertible <m>n\times n</m> matrix and <m>b</m> is a vector in <m>\R^n</m>. Let <m>A_i</m> be the matrix obtained from <m>A</m> by replacing the <m>i</m>th column by <m>b</m>. Then
<me>
x_i = \frac{\det(A_i)}{\det(A)}.
</me>
</p>
</statement>
<proof>
<p>
First suppose that <m>A</m> is the identity matrix, so that <m>x = b</m>. Then the matrix <m>A_i</m> looks like this:
<me>
\mat{1 0 b_1 0; 0 1 b_2 0; 0 0 b_3 0; 0 0 b_4 1}.
</me>
Expanding cofactors along the <m>i</m>th row, we see that <m>\det(A_i)=b_i</m>, so in this case,
<me>x_i = b_i = \det(A_i) = \frac{\det(A_i)}{\det(A)}.</me>
</p>
<p>
Now let <m>A</m> be a general <m>n\times n</m> matrix. One way to solve <m>Ax=b</m> is to row reduce the augmented matrix <m>(\,A\mid b\,)</m>; the result is <m>(\,I_n\mid x\,).</m> By the case we handled above, it is enough to check that the quantity <m>\det(A_i)/\det(A)</m> does not change when we do a row operation to <m>(\,A\mid b\,)</m>, since <m>\det(A_i)/\det(A) = x_i</m> when <m>A = I_n</m>.
<ol>