# 线性方程组

$\mathbf{A} = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$

$\begin{cases}a_{1,1}x_{1} + a_{1,2}x_{2} + \cdots + a_{1,n}x_{n}= b_{1} \\ a_{2,1}x_{1} + a_{2,2}x_{2} + \cdots + a_{2,n}x_{n}= b_{2} \\ \vdots \quad \quad \quad \vdots \\ a_{m,1}x_{1} + a_{m,2}x_{2} + \cdots + a_{m,n}x_{n}= b_{m} \end{cases}$

$\mathbf{A} \mathbf{x} = \mathbf{b}$

$A= \begin{bmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{bmatrix},\quad \bold{x}= \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix},\quad \bold{b}= \begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{bmatrix}$

## 例子

$\begin{cases}3x_{1} + 5x_{2} = 4 \\ x_{1} + 2x_{2} = 1 \end{cases}$

$\begin{bmatrix} 3 & 5\\ 1 & 2 \end{bmatrix} \cdot \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 4 \\ 1 \end{bmatrix}$

$\begin{cases}3 \times 3 + 5 \times (-1) = 9 - 5 = 4 \\ 3 + 2 \times (-1) = 3 -2 = 1 \end{cases}$

$\begin{cases}x_{1} + x_{2} = 2\\ 2x_{1} + 2x_{2} = 1 \end{cases}$

$\begin{cases}x_{1} + x_{2} = 2 \end{cases}$

$x_1 = 1, \, x_2 = 1$是一组解，而$x_1 = 3, \, x_2 = -1$也是一组解。事实上，解的个数有无限个。

## 线性方程组的解

• 有唯一解的恰定方程组，
• 解不存在的超定方程组，
• 有无穷多解的欠定方程组（也被通俗地称为不定方程组）。

### 一般情况

#### 齐次线性方程组

$A \mathbf{x}=0$

$\begin{cases}3x_{1} + x_{2} + 2 x_{3} = 0 \\ x_{1} - x_{2} + 4 x_{3} = 0\\ 2x_{1} + 3x_{3} = 0 \end{cases}$

$2x_{1} + 3x_{3} = \frac{1}{2}(3x_{1} + x_{2} + 2 x_{3}) + \frac{1}{2}(x_{1} - x_{2} + 4 x_{3})$

## 求解

### 克萊姆法則

$\begin{cases}a_1 x + b_1 y = c_1 \\ a_2 x + b_2 y = c_2 \end{cases}$

$x = \frac{D_x}{D}, \qquad y = \frac{D_y}{D}$

$D = \left| \begin{matrix} a_1 & b_1 \\ a_2 & b_2 \end{matrix} \right|$, $D_x = \left| \begin{matrix} c_1 & b_1 \\ c_2 & b_2 \end{matrix} \right|$,$D_y = \left| \begin{matrix} a_1 & c_1 \\ a_2 & c_2 \end{matrix} \right|$

$\mathbf{A} \mathbf{x} = \mathbf{b}$

$\begin{cases}x_1 = \frac{D_1}{D} \\ x_2 = \frac{D_2}{D} \\ \vdots \qquad \vdots \\ x_n = \frac{D_n}{D}\end{cases}$

$D = \det (A)$,
$\forall 1 \leqslant i \leqslant n, \, \, D_i = \det (A_i)$,

$A_i$是将矩阵$A$的第i纵列换成向量b之后得到的矩阵。