1、第三章 线性方程组张祥朝光科学与工程系1circle6 线性方程组的解法,九章算术中已作了比较完整的论述。其中所述方法相当于现代的高斯消元法。circle6 在西方,线性方程组的研究是在莱布尼茨开创的。他曾研究含两个未知量的三个线性方程组组成的方程组。circle6 1857年,德国Grassmann分析了线性无关,维度,以及内积circle6 1888年,意大利Peano给出了向量的严格定义21. 一般形式3. 向量方程的形式2. 增广矩阵的形式4. 向量组线性组合的形式1 2 31 2 33 4 52 1x x xx x x+ = + = 3 4 1 51 1 2 1 一、线性方程组的表达
2、式方程组可简化为AX = b 1233 4 1 51 1 2 1xxx = 1 2 33 4 1 51 1 2 1x x x + + = 二、线性方程组的解的判定设有n个未知数m个方程的线性方程组11 1 12 2 1 121 1 22 2 2 21 1 2 2,.n nn nm m mn n ma x a x a x ba x a x a x ba x a x a x b+ + + = + + + = + + + =midhorizellipsismidhorizellipsismidhorizellipsismidhorizellipsismidhorizellipsismidhorize
3、llipsismidhorizellipsis定义:线性方程组如果有解,就称它是相容的(consistent);如果无解,m、n不一定相等!就称它是不相容的问题1:方程组是否有解?问题2:若方程组有解,则解是否唯一?问题3:若方程组有解且不唯一,则如何掌握解的全体?定义:如果常数b全为零,方程组成为齐次的(homogeneous),否则成为非齐次的(inhomogeneous) 使方程组中的每个等式都成立的一个序数组 称为方程组的一个解。全体解的集合称为解集。 任意方程组U中个方程分别乘常数相加再得到的新方程(或方程组W)称为原方程组U的线性组合。 U的解一定是W的解。 若W可以通过线性组合变
4、回U,则W的解也是U的解,UW是同解变形。),( ,21 nccc midhorizellipsis 如果线性方程组的解不唯一,方程组的全部解的表达式称为通解,其中一个解称为特解。 零解肯定是齐次线性方程组的解,称为平凡解。 非齐次线性方程组不一定有解。5 线性方程组的系数组成的矩阵g36称为系数矩阵。 g12620bg17688为一g13425,加g14796g36g12116g13831,g15386组成的新矩阵称为增广矩阵。 g12620增广矩阵g12697g16305g10774等g16305变g12252,为同解变形。 g12664g15550形矩阵:若g55不为零,每个非零g163
5、05g14960方g13788有零g16305,且g11736非零g16305g10932g17684到g16883g11131一个非零g17035 g15386g17083的g10369g12070g13659g17668tttt midhorizellipsis, jjj midhorizellipsis g11736g16305g10932g17684g11131一个非零g17035g15353g12437为g12664g15550g17035 若g15386有的g12664g15550g17035都是1,g11736g12664g15550g17035g15386g17083g1342
6、5其g16897g17035g15353都是g19,则称g55为g17679简g12664g15550形矩阵6ppjjjj 321 321 p21定g13262:ng17035线性方程组Ax = bg7482 无解的g10757分g10361g16651g15574g12511是R(A) R(A, b);g7483 有唯一解的g10757分g10361g16651g15574g12511是R(A) = R(A, b) = n ;g7484 有无g16127g11329解的g10757分g10361g16651g15574g12511是R(A) = R(A, b) n 分g15959:g1743
7、6g16329g17413g13848g15574g12511的g10757分性,g12437 R(A) R(A, b) 无解; R(A) = R(A, b) = n 唯一解; R(A) = R(A, b) n 无g14607g11329解g13992g13781checkbld 无解 R(A) R(A, b) ;checkbld 唯一解 R(A) = R(A, b) = n;checkbld 无g14607g11329解 R(A) = R(A, b) n 证明:设R(A) = r ,为叙述方便,不妨设B= (A, b) 的行最简形矩阵为11 1, 121 2, 2,1 ,1 0 00 1 0
8、0 0 10 0 0 0 0n rn rr r n r rb b db b db b dBd = midhorizellipsis midhorizellipsismidhorizellipsis midhorizellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis verte
9、llipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis midhorizellipsistildenosptildenosptildenosptildenospmidhorizellipsis midhorizellipsis第一步:往证R(A) R(A, b) 无解若R(A) R(A, b) ,即R(A, b) = R(A)1,则dr+1= 1 于是第r +1 行对应矛盾
10、方程0 = 1,故原线性方程组无解1( 1)0 0 0 0 0 00 0 0 0 0 0rm n+ + midhorizellipsis midhorizellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellip
11、sis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis midhorizellipsisR(A)R(A, b)R(A)1 前r列 后n -r列11 1,21 2,1 ,0 00 00 0n rn rr r n rb bb bb bmidhorizellipsismidhorizellipsisvertellipsis vertellipsisvertellipsis vertellipsisvertellipsis vertelli
12、psisvertellipsis vertellipsismidhorizellipsismidhorizellipsismidhorizellipsisvertellipsis vertellipsisvertellipsis vertellipsisvertellipsis vertellipsisvertellipsis vertellipsismidhorizellipsis12000ndddvertellipsisvertellipsisvertellipsisvertellipsisvertellipsisvertellipsisvertellipsisvertellipsis1
13、0 00 1 00 0 10 0 00 0 00 0 0B=midhorizellipsismidhorizellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsismidhorizellipsistildenosptildenosptildenosptildenospmidhorizellipsismidhorizellipsisve
14、rtellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsismidhorizellipsis前r行后mr行121 0 00 1 00 0 1 nddd midhorizellipsismidhorizellipsisvertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertelli
15、psis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis对应的线性方程组为1 1,x dx d= =前r列( 1)m n +第二步:往证R(A) = R(A, b) = n 唯一解若R(A) = R(A, b) = n,故原线性方程组有唯一解则dr+1 = 0 且bij都不出现.即r = n,后n - r列2 2.n nx d =midhorizellips
16、ismidhorizellipsis前r列 后n - r列11 1, 121 2, 2,1 ,1( 1)1 0 00 1 00 0 10 0 0 0 00 0 0 0 0 00 0 0 0 0 0n rn rr r n r rrm nb b db b db b dBd+ + = midhorizellipsis midhorizellipsismidhorizellipsis midhorizellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vert
17、ellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis midhorizellipsistildenosptildenosptildenosptildenospmidhorizellipsis
18、midhorizellipsismidhorizellipsis midhorizellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertell
19、ipsis vertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis midhorizellipsis第三步:往证R(A) = R(A, b) n 无穷多解若R(A) = R(A, b) n ,即r n ,则dr+1 = 0 .对应的线性方程组为1 11 1 1, 12 21 1 2, 21 1 ,.r n r nr n r nr r r r n r n rx b x b x dx b x b x dx b x b x d+ + + + + + = + + + = + + + =midhorizellipsismid
20、horizellipsismidhorizellipsismidhorizellipsismidhorizellipsisBtildenosp1 11 1 1, 12 21 1 2, 21 1 ,.r n r nr n r nr r r r n r n rx b x b x dx b x b x dx b x b x d+ + + + + + = + + + = + + + =midhorizellipsismidhorizellipsismidhorizellipsismidhorizellipsismidhorizellipsis1 11 1 1, 12 21 1 2, 2,r n r n
21、r n r nx b x b x dx b x b x d+ + = + = +midhorizellipsismidhorizellipsismidhorizellipsismidhorizellipsis令xr+1, , xn作自由变量,则线性方程1 1 , .r r r r n r n rx b x b x d+ = + midhorizellipsis再令xr+1= c1, xr+2= c2, , xn= cn-r,则1 11 1 1, 11 1 ,1 1n r n rr r r n r n r rrn n rx b c b c dx b c b c dx cx c + + += mi
22、dhorizellipsisvertellipsis vertellipsisvertellipsis vertellipsisvertellipsis vertellipsisvertellipsis vertellipsismidhorizellipsisvertellipsis downslopeellipsisvertellipsisvertellipsisvertellipsis11 1, 11 ,1 1 0 00 1 0n rr r n r rn rb b db b dc c = + + + vertellipsis vertellipsis vertellipsisvertell
23、ipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsismidhorizellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis组的通解非齐次线性方程组无解否是否是( ) ( )
24、R A R B=( )R A n=无限多个解唯一解包含n-R(A) 个自由变量的通解例:求解非齐次线性方程组1 2 3 41 2 3 41 2 3 41 2 3 42 2,2 4,4 6 2 2 4,3 6 9 7 9.x x x xx x x xx x x xx x x x + = + + = + = + + =解: 2 1 1 1 2 1 0 1 0 41 1 2 1 4 0 1 1 0 34 6 2 2 4 0 0 0 1 33 6 9 7 9 0 0 0 0 0rB = R(A) = R(A, b) = 3 4,故原线性方程组有无穷多解2 1 1 1 2 1 0 1 0 41 1 2
25、1 4 0 1 1 0 34 6 2 2 4 0 0 0 1 33 6 9 7 9 0 0 0 0 0rB = 备注:1 0 0 b b d midhorizellipsis midhorizellipsis有无限多解的充分必要条件是R(A) = R(A, b) = r n ,这时11 1, 121 2, 2,1 ,0 1 00 0 10 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0n rn rr r n r rb b db b d midhorizellipsis midhorizellipsisvertellipsis vertellipsis vertellipsis
26、vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis midhorizellips
27、ismidhorizellipsis midhorizellipsismidhorizellipsis midhorizellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisvertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsisv
28、ertellipsis vertellipsis vertellipsis vertellipsis vertellipsis vertellipsismidhorizellipsis midhorizellipsis还能根据R(A) = R(A, b) = r n判断该线性方程组有无限多解吗?1 0 1 0 40 1 1 0 30 0 0 1 30 0 0 0 0rB x1 x2 x3 x43 41 0 0 1 40 1 0 1 30 0 1 0 30 0 0 0 0c c x1 x2 x4 x31 32 344,3,3.x xx xx = = =1 32 344,3,3.x xx xx =
29、 = =同解2 1 1 1 2 1 0 1 0 41 1 2 1 4 0 1 1 0 34 6 2 2 4 0 0 0 1 33 6 9 7 9 0 0 0 0 0rB = 解(续):即得与原方程组同解的方程组 1 32 34,3,3.x xx xx = = = 令x3做自由变量,则方程组的通解可表示为41 32 344,3,3.x xx xx= + = + = 12341 41 31 00 3xx cxx = + 例:求解非齐次线性方程组1 2 3 41 2 3 41 2 3 42 3 1,3 5 3 2,2 2 2 3.x x x xx x x xx x x x + = + = + + =
30、1 2 3 1 1 1 2 3 1 13 1 5 3 2 0 5 4 0 12 1 2 2 3 0 0 0 0 2rB = 解:R(A) = 2,R(A, b) = 3 ,故原线性方程组无解例:求解齐次线性方程组1 2 3 41 2 3 41 2 3 42 2 0,2 2 2 0,4 3 0.x x x xx x x xx x x x+ + + = + = =提问:为什么只对系数矩阵A 进行初等行变换变为行最简形矩阵?答:因为齐次线性方程组AX = 0 的常数项都等于零,于是必有R(A, 0) =R(A) ,所以可从R(A) 判断齐次线性方程组的解的情况例:设有线性方程组问取何值时,此方程组有
31、(1) 唯一解;(2) 无解;(3) 有无1 2 31 2 31 2 3(1 ) 0,(1 ) 3,(1 ) .x x xx x xx x x + + + = + + + = + + + =限多个解?并在有无限多解时求其通解定理:n元线性方程组AX= b 无解的充分必要条件是R(A) R(A, b); 有唯一解的充分必要条件是R(A) = R(A, b) = n ; 有无限多解的充分必要条件是R(A) = R(A, b) n 1 1 1 01 1 1 31 1 1B + = + + 解法1:对增广矩阵作初等行变换把它变为行阶梯形矩阵1 1 1 0+ 1 1 1r r + 1 1 1 31 1
32、1 + + 1 3 1 1 1 31 1 1 0+ + 2 13 1(1 )1 1 1 0 30 (2 ) (1 )r rr r + + + 3 21 1 1 0 30 0 (3 ) (1 )(3 )r r + + + + 附注:checkbld 对含参数的矩阵作初等变换时,由于 +1, +3 等因式可能等于零,故不宜进行下列的变换:2 111r r + 2 (1 )r + 3 ( 3)r +checkbld 如果作了这样的变换,则需对 +1 = 0(或 +3 = 0)的情况另作讨论1 1 1 0 1 1 11 1 1 3 0 31 1 1 0 0 (3 ) (1 )(3 )rB + + =
33、+ + + + 分析: 讨论方程组的解的情况,就是讨论参数取何值时,r2 、r3是非零行 在r2 、r3中,有5 处地方出现了 ,要g15130这5 g11735g17035g15353等于零, = 0,3,g76303,1 g15126g12459g14960g13788有必要对这4 g11735可能取值g17489g16668进行讨论,g16105从方程组有g15881g16668解g14796g151591 1 1 0 1 1 11 1 1 3 0 31 1 1 0 0 (3 ) (1 )(3 )rB + + = + + + + 于是 g11090l 0 g14579l g76303 时
34、,R(A) = R(B) = 3 ,有g15881g16668解 g11090l = 0 时,R(A) = 1,R(B) = 2 ,无解 g11090l = g76303 时,R(A) = R(B) = 2 ,有无限多解1 1 1 01 1 1 31 1 1B + = + + 解g114652:因为系数矩阵A是方阵,所以方程组有g15881g16668解的充分必要条件是|A| 0 21 1 1| | 1 1 1 (3 )1 1 1A += + = +于是g11090l 0 g14579l g76303 时,方程组有g15881g16668解g11090 = 0 时,R(A) = 1,R(B)
35、= 2 ,方程组无解1 1 1 0 1 1 1 01 1 1 3 0 0 0 11 1 1 0 0 0 0 0rB = 2 1 1 0 1 0 1 1r g11090 = g76303 时,R(A) = R(B) = 2 ,方程组有无限多g11735解,g14405通解为1 2 1 3 0 1 1 21 1 2 3 0 0 0 0B = 1231 11 21 0xx cx = + g11273g13262:ng17035齐次线性方程组AX = 0 有非零解的充分必要条件是R(A) n 定理:矩阵方程AX = B有解的充分必要条件是R(A) = R(A, B) 证明:设A是mn矩阵,B是ml矩阵
36、,X是nl矩阵.把X和B按列分块,记作X = ( x1, x2, , xl ) ,B = ( b1, b2, , bl )则即矩阵方程AX = B有解 线性方程组Axi = bi有解R(A) = R( A, bi )1 2( , , , )nAX A x x x= midhorizellipsis 1 2( , , , )nAx Ax Ax= midhorizellipsis1 2( , , , )nb b b B= =midhorizellipsis设R(A) = r ,A 的行最简形矩阵为 ,则 有r个非零行,且 的后mr行全是零再设从而 Atildenosp AtildenospAtil
37、denosp1 2 1 2( , ) ( , , , , )( , , , , )rl lA B A b b b A b b b=tildenosp tildenosp tildenosp tildenospmidhorizellipsis midhorizellipsis( , )( , )ri iA b A btildenosp tildenosp矩阵方程AX = B有解 线性方程组Axi = bi有解R(A) = R( A, b ) i 的后mr个元素全是零的后mr行全是零R(A) = R(A, B) ibtildenosp 1 2( , , , )lb b btildenosp tildenosp tildenospmidhorizellipsis定理:设AB = C,则R(C) minR(A), R(B) 证明:因为AB = C,所以矩阵方程AX = C有解X = B,于是R(A) = R(A, C) R(C) R(A, C) ,故R(C) R(A) 又(AB)T = CT,即BTAT = CT,所以矩阵方程BTX= CT 有解X = AT ,同理可得,R(C) R(B) 综上所述,可知R(C) minR(A), R(B)