A=
1 1 1 1 0
0 1 2 2 1
0 -1 a-3 -2 b
3 2 1 a -1
r3-3r1
1 1 1 1 0
0 1 2 2 1
0 -1 a-3 -2 b
0 -1 -2 a-3 -1
r3+r2,r4+r2
1 1 1 1 0
0 1 2 2 1
0 0 a-1 0 b+1
0 0 0 a-1 0
因为 r(A)=2, 所以 a=1,b=-1
A=
1 1 1 1 0
0 1 2 2 1
0 -1 a-3 -2 b
3 2 1 a -1
r3-3r1
1 1 1 1 0
0 1 2 2 1
0 -1 a-3 -2 b
0 -1 -2 a-3 -1
r3+r2,r4+r2
1 1 1 1 0
0 1 2 2 1
0 0 a-1 0 b+1
0 0 0 a-1 0
因为 r(A)=2, 所以 a=1,b=-1