TH

ระบบสมการเชิงเส้นเป็นหนึ่งในหัวข้อสำคัญของคณิตศาสตร์ มักนำมาประยุกต์ใช้ในการแก้ปัญหาหลายตัวแปรในชีวิตจริงและวิทยาการคอมพิวเตอร์ การนำ เมทริกซ์ (Matrix) เข้ามาช่วย จะทำให้เราสามารถจัดรูปและคำนวณหาระบบคำตอบได้อย่างเป็นระเบียบ รวดเร็ว และเป็นระบบ โดยทั่วไปเราสามารถเลือกใช้วิธีแก้สมการได้หลากหลาย เช่น การใช้เมทริกซ์ผกผัน, กฎของคราเมอร์ หรือ การดำเนินการตามแถว (เกาส์-จอร์แดน)

EN

Systems of linear equations are fundamental to mathematics, widely applied in solving multivariable problems across science, engineering, and computer science. Utilizing Matrices enables us to formulate and solve these systems systematically and efficiently. Common approaches include the Inverse Matrix Method, Cramer's Rule, and Row Operations (Gauss-Jordan Elimination).

1

การแปลงระบบสมการเป็นสมการเมทริกซ์ Converting to a Matrix Equation

TH

เมื่อเรามีระบบสมการเชิงเส้นหลายตัวแปร เราสามารถจัดรูปให้อยู่ในรูปสมการเมทริกซ์มาตรฐานได้คือ $AX = B$

  • $A$ : เมทริกซ์สัมประสิทธิ์ — สัมประสิทธิ์หน้าตัวแปร มีมิติ $m \times n$
  • $X$ : เมทริกซ์ตัวแปร — เวกเตอร์หลักของตัวแปรไม่ทราบค่า มีมิติ $n \times 1$
  • $B$ : เมทริกซ์ค่าคงที่ — ค่าคงที่ทางขวามือของสมการ มีมิติ $m \times 1$

📌 รูปแบบทั่วไปสำหรับระบบ $m$ สมการ และ $n$ ตัวแปร:

$$ \begin{cases} {\color{#1565c0}a_{11}}{\color{#e65100}x_1} + {\color{#1565c0}a_{12}}{\color{#e65100}x_2} + \cdots + {\color{#1565c0}a_{1n}}{\color{#e65100}x_n} = {\color{#2e7d32}b_1} \\ {\color{#1565c0}a_{21}}{\color{#e65100}x_1} + {\color{#1565c0}a_{22}}{\color{#e65100}x_2} + \cdots + {\color{#1565c0}a_{2n}}{\color{#e65100}x_n} = {\color{#2e7d32}b_2} \\ \quad\vdots \\ {\color{#1565c0}a_{m1}}{\color{#e65100}x_1} + {\color{#1565c0}a_{m2}}{\color{#e65100}x_2} + \cdots + {\color{#1565c0}a_{mn}}{\color{#e65100}x_n} = {\color{#2e7d32}b_m} \end{cases} $$
$\Downarrow$
$$ \underbrace{\begin{bmatrix} {\color{#1565c0}a_{11}} & {\color{#1565c0}a_{12}} & \cdots & {\color{#1565c0}a_{1n}} \\ {\color{#1565c0}a_{21}} & {\color{#1565c0}a_{22}} & \cdots & {\color{#1565c0}a_{2n}} \\ \vdots & \vdots & \ddots & \vdots \\ {\color{#1565c0}a_{m1}} & {\color{#1565c0}a_{m2}} & \cdots & {\color{#1565c0}a_{mn}} \end{bmatrix}}_{\mathbf{\color{#1565c0}A}\ (m \times n)} \underbrace{\begin{bmatrix} {\color{#e65100}x_1} \\ {\color{#e65100}x_2} \\ \vdots \\ {\color{#e65100}x_n} \end{bmatrix}}_{\mathbf{\color{#e65100}X}\ (n \times 1)} = \underbrace{\begin{bmatrix} {\color{#2e7d32}b_1} \\ {\color{#2e7d32}b_2} \\ \vdots \\ {\color{#2e7d32}b_m} \end{bmatrix}}_{\mathbf{\color{#2e7d32}B}\ (m \times 1)} $$
EN

Any system of linear equations can be systematically written in standard matrix form: $AX = B$

  • $A$ : Coefficient Matrix — coefficients of the variables with dimension $m \times n$
  • $X$ : Variable Matrix — column vector of unknown variables with dimension $n \times 1$
  • $B$ : Constant Matrix — right-hand side constant terms with dimension $m \times 1$

📌 General Form for Any System of $m$ Equations & $n$ Variables:

$$ \begin{cases} {\color{#1565c0}a_{11}}{\color{#e65100}x_1} + {\color{#1565c0}a_{12}}{\color{#e65100}x_2} + \cdots + {\color{#1565c0}a_{1n}}{\color{#e65100}x_n} = {\color{#2e7d32}b_1} \\ {\color{#1565c0}a_{21}}{\color{#e65100}x_1} + {\color{#1565c0}a_{22}}{\color{#e65100}x_2} + \cdots + {\color{#1565c0}a_{2n}}{\color{#e65100}x_n} = {\color{#2e7d32}b_2} \\ \quad\vdots \\ {\color{#1565c0}a_{m1}}{\color{#e65100}x_1} + {\color{#1565c0}a_{m2}}{\color{#e65100}x_2} + \cdots + {\color{#1565c0}a_{mn}}{\color{#e65100}x_n} = {\color{#2e7d32}b_m} \end{cases} $$
$\Downarrow$
$$ \underbrace{\begin{bmatrix} {\color{#1565c0}a_{11}} & {\color{#1565c0}a_{12}} & \cdots & {\color{#1565c0}a_{1n}} \\ {\color{#1565c0}a_{21}} & {\color{#1565c0}a_{22}} & \cdots & {\color{#1565c0}a_{2n}} \\ \vdots & \vdots & \ddots & \vdots \\ {\color{#1565c0}a_{m1}} & {\color{#1565c0}a_{m2}} & \cdots & {\color{#1565c0}a_{mn}} \end{bmatrix}}_{\mathbf{\color{#1565c0}A}\ (m \times n)} \underbrace{\begin{bmatrix} {\color{#e65100}x_1} \\ {\color{#e65100}x_2} \\ \vdots \\ {\color{#e65100}x_n} \end{bmatrix}}_{\mathbf{\color{#e65100}X}\ (n \times 1)} = \underbrace{\begin{bmatrix} {\color{#2e7d32}b_1} \\ {\color{#2e7d32}b_2} \\ \vdots \\ {\color{#2e7d32}b_m} \end{bmatrix}}_{\mathbf{\color{#2e7d32}B}\ (m \times 1)} $$
Example 1.1

จงแปลงระบบสมการต่อไปนี้ให้อยู่ในรูปสมการเมทริกซ์ $AX = B$

$$ \begin{aligned} 2x + 3y &= 8 &\quad \text{--- (1)} \\ 5x - y &= 3 &\quad \text{--- (2)} \end{aligned} $$

วิธีแปลง:

  • ดึงสัมประสิทธิ์หน้า $x$ และ $y$ มาสร้างเมทริกซ์ $A$: $\displaystyle A = \begin{bmatrix} {\color{#1565c0}2} & {\color{#1565c0}3} \\ {\color{#1565c0}5} & {\color{#1565c0}-1} \end{bmatrix}$
  • เมทริกซ์ตัวแปร $X$: $\displaystyle X = \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix}$
  • เมทริกซ์ค่าคงที่ $B$: $\displaystyle B = \begin{bmatrix} {\color{#2e7d32}8} \\ {\color{#2e7d32}3} \end{bmatrix}$
$$ \begin{bmatrix} {\color{#1565c0}2} & {\color{#1565c0}3} \\ {\color{#1565c0}5} & {\color{#1565c0}-1} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}8} \\ {\color{#2e7d32}3} \end{bmatrix} $$

Convert the following system of linear equations into the matrix equation form $AX = B$.

$$ \begin{aligned} 2x + 3y &= 8 &\quad \text{--- (1)} \\ 5x - y &= 3 &\quad \text{--- (2)} \end{aligned} $$

Solution:

  • Extract coefficients into matrix $A$: $\displaystyle A = \begin{bmatrix} {\color{#1565c0}2} & {\color{#1565c0}3} \\ {\color{#1565c0}5} & {\color{#1565c0}-1} \end{bmatrix}$
  • Variable matrix $X$: $\displaystyle X = \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix}$
  • Constant matrix $B$: $\displaystyle B = \begin{bmatrix} {\color{#2e7d32}8} \\ {\color{#2e7d32}3} \end{bmatrix}$
$$ \begin{bmatrix} {\color{#1565c0}2} & {\color{#1565c0}3} \\ {\color{#1565c0}5} & {\color{#1565c0}-1} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}8} \\ {\color{#2e7d32}3} \end{bmatrix} $$
Example 1.2

จงแปลงระบบสมการต่อไปนี้ให้อยู่ในรูปสมการเมทริกซ์

$$ \begin{aligned} 4x - 7y &= 11 &\quad \text{--- (1)} \\ 3y &= 6 &\quad \text{--- (2)} \end{aligned} $$

ข้อสังเกต: ในสมการที่ (2) ไม่มีตัวแปร $x$ ให้ใส่สัมประสิทธิ์เป็น $0x$

$$ \begin{bmatrix} {\color{#1565c0}4} & {\color{#1565c0}-7} \\ {\color{#1565c0}0} & {\color{#1565c0}3} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}11} \\ {\color{#2e7d32}6} \end{bmatrix} $$

Express the system in matrix equation form.

$$ \begin{aligned} 4x - 7y &= 11 &\quad \text{--- (1)} \\ 3y &= 6 &\quad \text{--- (2)} \end{aligned} $$

Notice: In equation (2), $x$ is missing, so its coefficient is $0$.

$$ \begin{bmatrix} {\color{#1565c0}4} & {\color{#1565c0}-7} \\ {\color{#1565c0}0} & {\color{#1565c0}3} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}11} \\ {\color{#2e7d32}6} \end{bmatrix} $$
Example 1.3

จงแปลงระบบสมการต่อไปนี้ให้อยู่ในรูปสมการเมทริกซ์

$$ \begin{aligned} 3x &= 5y + 7 &\quad \text{--- (1)} \\ 2y - x + 4 &= 0 &\quad \text{--- (2)} \end{aligned} $$

จัดรูปสมการ (1) และ (2) ให้อยู่ในรูปมาตรฐาน ($ax + by = c$):

$$ \begin{aligned} 3x - 5y &= 7 &\quad \text{--- (1)} \\ -x + 2y &= -4 &\quad \text{--- (2)} \end{aligned} $$

ดังนั้น รูปสมการเมทริกซ์คือ:

$$ \begin{bmatrix} {\color{#1565c0}3} & {\color{#1565c0}-5} \\ {\color{#1565c0}-1} & {\color{#1565c0}2} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}7} \\ {\color{#2e7d32}-4} \end{bmatrix} $$

Convert the system into matrix form.

$$ \begin{aligned} 3x &= 5y + 7 &\quad \text{--- (1)} \\ 2y - x + 4 &= 0 &\quad \text{--- (2)} \end{aligned} $$

Rearrange equations (1) and (2) to standard form ($ax + by = c$):

$$ \begin{aligned} 3x - 5y &= 7 &\quad \text{--- (1)} \\ -x + 2y &= -4 &\quad \text{--- (2)} \end{aligned} $$

Thus, the matrix equation is:

$$ \begin{bmatrix} {\color{#1565c0}3} & {\color{#1565c0}-5} \\ {\color{#1565c0}-1} & {\color{#1565c0}2} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}7} \\ {\color{#2e7d32}-4} \end{bmatrix} $$
Example 1.4

จงแปลงระบบสมการต่อไปนี้ให้อยู่ในรูปสมการเมทริกซ์

$$ \begin{aligned} x + 2y - z &= 4 &\quad \text{--- (1)} \\ 2x - y + 3z &= 9 &\quad \text{--- (2)} \\ 3x + y + 2z &= 13 &\quad \text{--- (3)} \end{aligned} $$

แยกองค์ประกอบจากสมการ (1), (2), (3):

  • $A$ (ขนาด $3 \times 3$): สัมประสิทธิ์ของ $x, y, z$
  • $X$ (ขนาด $3 \times 1$): ตัวแปร $\begin{bmatrix} x & y & z \end{bmatrix}^T$
  • $B$ (ขนาด $3 \times 1$): ค่าคงที่ $\begin{bmatrix} 4 & 9 & 13 \end{bmatrix}^T$
$$ \begin{bmatrix} {\color{#1565c0}1} & {\color{#1565c0}2} & {\color{#1565c0}-1} \\ {\color{#1565c0}2} & {\color{#1565c0}-1} & {\color{#1565c0}3} \\ {\color{#1565c0}3} & {\color{#1565c0}1} & {\color{#1565c0}2} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \\ {\color{#e65100}z} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}4} \\ {\color{#2e7d32}9} \\ {\color{#2e7d32}13} \end{bmatrix} $$

Write the 3-variable linear system as a matrix equation.

$$ \begin{aligned} x + 2y - z &= 4 &\quad \text{--- (1)} \\ 2x - y + 3z &= 9 &\quad \text{--- (2)} \\ 3x + y + 2z &= 13 &\quad \text{--- (3)} \end{aligned} $$

Components from equations (1), (2), (3):

  • $A$ ($3 \times 3$): Coefficients of $x, y, z$
  • $X$ ($3 \times 1$): Variable column vector $\begin{bmatrix} x & y & z \end{bmatrix}^T$
  • $B$ ($3 \times 1$): Constant column vector $\begin{bmatrix} 4 & 9 & 13 \end{bmatrix}^T$
$$ \begin{bmatrix} {\color{#1565c0}1} & {\color{#1565c0}2} & {\color{#1565c0}-1} \\ {\color{#1565c0}2} & {\color{#1565c0}-1} & {\color{#1565c0}3} \\ {\color{#1565c0}3} & {\color{#1565c0}1} & {\color{#1565c0}2} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \\ {\color{#e65100}z} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}4} \\ {\color{#2e7d32}9} \\ {\color{#2e7d32}13} \end{bmatrix} $$
Example 1.5

จงแปลงระบบสมการต่อไปนี้ให้อยู่ในรูปสมการเมทริกซ์

$$ \begin{aligned} x + z &= 5 &\quad \text{--- (1)} \\ 2y - z &= 1 &\quad \text{--- (2)} \\ 3x - 4y &= -2 &\quad \text{--- (3)} \end{aligned} $$

เติมตัวแปรที่หายไปด้วย $0$:

$$ \begin{aligned} 1x + {\color{#1565c0}0y} + 1z &= 5 &\quad \text{--- (1)} \\ {\color{#1565c0}0x} + 2y - 1z &= 1 &\quad \text{--- (2)} \\ 3x - 4y + {\color{#1565c0}0z} &= -2 &\quad \text{--- (3)} \end{aligned} $$

จะได้รูปสมการเมทริกซ์คือ:

$$ \begin{bmatrix} {\color{#1565c0}1} & {\color{#1565c0}0} & {\color{#1565c0}1} \\ {\color{#1565c0}0} & {\color{#1565c0}2} & {\color{#1565c0}-1} \\ {\color{#1565c0}3} & {\color{#1565c0}-4} & {\color{#1565c0}0} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \\ {\color{#e65100}z} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}5} \\ {\color{#2e7d32}1} \\ {\color{#2e7d32}-2} \end{bmatrix} $$

Convert the linear system into matrix equation form.

$$ \begin{aligned} x + z &= 5 &\quad \text{--- (1)} \\ 2y - z &= 1 &\quad \text{--- (2)} \\ 3x - 4y &= -2 &\quad \text{--- (3)} \end{aligned} $$

Fill missing terms with $0$:

$$ \begin{aligned} 1x + {\color{#1565c0}0y} + 1z &= 5 &\quad \text{--- (1)} \\ {\color{#1565c0}0x} + 2y - 1z &= 1 &\quad \text{--- (2)} \\ 3x - 4y + {\color{#1565c0}0z} &= -2 &\quad \text{--- (3)} \end{aligned} $$

The resulting matrix equation is:

$$ \begin{bmatrix} {\color{#1565c0}1} & {\color{#1565c0}0} & {\color{#1565c0}1} \\ {\color{#1565c0}0} & {\color{#1565c0}2} & {\color{#1565c0}-1} \\ {\color{#1565c0}3} & {\color{#1565c0}-4} & {\color{#1565c0}0} \end{bmatrix} \begin{bmatrix} {\color{#e65100}x} \\ {\color{#e65100}y} \\ {\color{#e65100}z} \end{bmatrix} = \begin{bmatrix} {\color{#2e7d32}5} \\ {\color{#2e7d32}1} \\ {\color{#2e7d32}-2} \end{bmatrix} $$
2

วิธีที่ 1: การใช้เมทริกซ์ผกผัน Method 1: Inverse Matrix Method

TH

จากสมการเมทริกซ์มาตรฐาน $AX = B$ เมื่อเมทริกซ์สัมประสิทธิ์ $A$ เป็นเมทริกซ์จัตุรัสและมีตัวผกผัน ($\det(A) \neq 0$) เราสามารถหาผลเฉลยของระบบสมการได้โดยการคูณด้วย เมทริกซ์ผกผัน ${\color{#1565c0}A^{-1}}$ ทางด้านซ้ายของทั้งสองข้าง

  • $A^{-1}$ : เมทริกซ์ผกผันของ $A$ — เมทริกซ์ที่สอดคล้องกับ $A^{-1}A = I$ มีมิติ $n \times n$
  • $X$ : เมทริกซ์ตัวแปร — เวกเตอร์ผลเฉลยที่ต้องการหา มีมิติ $n \times 1$
  • $B$ : เมทริกซ์ค่าคงที่ — ค่าคงที่ทางขวามือของสมการ มีมิติ $n \times 1$

📌 ที่มาของสูตรและการจัดรูปหาผลเฉลย:

$$ \begin{aligned} {\color{#1565c0}A}{\color{#e65100}X} &= {\color{#2e7d32}B} \\ {\color{#1565c0}A^{-1}}({\color{#1565c0}A}{\color{#e65100}X}) &= {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} \\ ({\color{#1565c0}A^{-1}}{\color{#1565c0}A}){\color{#e65100}X} &= {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} \\ {\color{#1565c0}I}{\color{#e65100}X} &= {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} \end{aligned} $$
$\Downarrow$
$$ {\color{#e65100}X} = {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} $$

⚠️ ข้อจำกัดสำคัญ: วิธีนี้ใช้ได้เฉพาะกรณีที่เมทริกซ์ $A$ เป็น เมทริกซ์จัตุรัส ($n \times n$) และ $\det(A) \neq 0$ (เมทริกซ์ไม่เอกฐาน / Non-singular Matrix) เท่านั้น หาก $\det(A) = 0$ จะหา $A^{-1}$ ไม่ได้

EN

From the standard matrix equation $AX = B$, when the coefficient matrix $A$ is square and invertible ($\det(A) \neq 0$), we can solve for the unknowns by multiplying both sides on the left by the Inverse Matrix ${\color{#1565c0}A^{-1}}$.

  • $A^{-1}$ : Inverse Matrix of $A$ — matrix satisfying $A^{-1}A = I$ with dimension $n \times n$
  • $X$ : Variable Matrix — solution column vector to find with dimension $n \times 1$
  • $B$ : Constant Matrix — right-hand side constant terms with dimension $n \times 1$

📌 Derivation & Solution Formula:

$$ \begin{aligned} {\color{#1565c0}A}{\color{#e65100}X} &= {\color{#2e7d32}B} \\ {\color{#1565c0}A^{-1}}({\color{#1565c0}A}{\color{#e65100}X}) &= {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} \\ ({\color{#1565c0}A^{-1}}{\color{#1565c0}A}){\color{#e65100}X} &= {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} \\ {\color{#1565c0}I}{\color{#e65100}X} &= {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} \end{aligned} $$
$\Downarrow$
$$ {\color{#e65100}X} = {\color{#1565c0}A^{-1}}{\color{#2e7d32}B} $$

⚠️ Important Constraint: This method is valid only when $A$ is a square matrix ($n \times n$) and $\det(A) \neq 0$ (Non-singular matrix). If $\det(A) = 0$, $A^{-1}$ does not exist.

Example 2.1

$\text{จงแก้ระบบสมการ } 2x+y=5 \text{ และ } x-y=1$

$$ \begin{aligned} A &= \begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix}, B = \begin{bmatrix} 5 \\ 1 \end{bmatrix} \\ \det(A) &= (2)(-1) - (1)(1) \\&= -3 \\ A^{-1} &= \frac{1}{-3} \begin{bmatrix} -1 & -1 \\ -1 & 2 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-3} \begin{bmatrix} -1 & -1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} 5 \\ 1 \end{bmatrix} \\ &= \frac{1}{-3} \begin{bmatrix} -5-1 \\ -5+2 \end{bmatrix} \\ &= \frac{1}{-3} \begin{bmatrix} -6 \\ -3 \end{bmatrix} \\&= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=2, y=1$

$\text{Solve the system: } 2x+y=5 \text{ and } x-y=1$

$$ \begin{aligned} A &= \begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix}, B = \begin{bmatrix} 5 \\ 1 \end{bmatrix} \\ \det(A) &= (2)(-1) - (1)(1) \\&= -3 \\ A^{-1} &= \frac{1}{-3} \begin{bmatrix} -1 & -1 \\ -1 & 2 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-3} \begin{bmatrix} -1 & -1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} 5 \\ 1 \end{bmatrix} \\ &= \frac{1}{-3} \begin{bmatrix} -5-1 \\ -5+2 \end{bmatrix} \\ &= \frac{1}{-3} \begin{bmatrix} -6 \\ -3 \end{bmatrix} \\&= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=2, y=1$

Example 2.2

$\text{จงแก้ระบบสมการ } 3x-2y=4 \text{ และ } x+y=3$

$$ \begin{aligned} A &= \begin{bmatrix} 3 & -2 \\ 1 & 1 \end{bmatrix}, B = \begin{bmatrix} 4 \\ 3 \end{bmatrix} \\ \det(A) &= (3)(1) - (-2)(1) \\&= 5 \\ A^{-1} &= \frac{1}{5} \begin{bmatrix} 1 & 2 \\ -1 & 3 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{5} \begin{bmatrix} 1 & 2 \\ -1 & 3 \end{bmatrix} \begin{bmatrix} 4 \\ 3 \end{bmatrix} \\ &= \frac{1}{5} \begin{bmatrix} 4+6 \\ -4+9 \end{bmatrix} \\ &= \frac{1}{5} \begin{bmatrix} 10 \\ 5 \end{bmatrix} \\&= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=2, y=1$

$\text{Solve the system: } 3x-2y=4 \text{ and } x+y=3$

$$ \begin{aligned} A &= \begin{bmatrix} 3 & -2 \\ 1 & 1 \end{bmatrix}, B = \begin{bmatrix} 4 \\ 3 \end{bmatrix} \\ \det(A) &= (3)(1) - (-2)(1) \\&= 5 \\ A^{-1} &= \frac{1}{5} \begin{bmatrix} 1 & 2 \\ -1 & 3 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{5} \begin{bmatrix} 1 & 2 \\ -1 & 3 \end{bmatrix} \begin{bmatrix} 4 \\ 3 \end{bmatrix} \\ &= \frac{1}{5} \begin{bmatrix} 4+6 \\ -4+9 \end{bmatrix} \\ &= \frac{1}{5} \begin{bmatrix} 10 \\ 5 \end{bmatrix} \\&= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=2, y=1$

Example 2.3

$\text{จงแก้ระบบสมการ } x+2y=4 \text{ และ } 3x-y=5$

$$ \begin{aligned} A &= \begin{bmatrix} 1 & 2 \\ 3 & -1 \end{bmatrix}, B = \begin{bmatrix} 4 \\ 5 \end{bmatrix} \\ \det(A) &= (1)(-1) - (2)(3) \\&= -7 \\ A^{-1} &= \frac{1}{-7} \begin{bmatrix} -1 & -2 \\ -3 & 1 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-7} \begin{bmatrix} -1 & -2 \\ -3 & 1 \end{bmatrix} \begin{bmatrix} 4 \\ 5 \end{bmatrix} \\ &= \frac{1}{-7} \begin{bmatrix} -4-10 \\ -12+5 \end{bmatrix} \\ &= \frac{1}{-7} \begin{bmatrix} -14 \\ -7 \end{bmatrix} \\&= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=2, y=1$

$\text{Solve the system: } x+2y=4 \text{ and } 3x-y=5$

$$ \begin{aligned} A &= \begin{bmatrix} 1 & 2 \\ 3 & -1 \end{bmatrix}, B = \begin{bmatrix} 4 \\ 5 \end{bmatrix} \\ \det(A) &= (1)(-1) - (2)(3) \\&= -7 \\ A^{-1} &= \frac{1}{-7} \begin{bmatrix} -1 & -2 \\ -3 & 1 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-7} \begin{bmatrix} -1 & -2 \\ -3 & 1 \end{bmatrix} \begin{bmatrix} 4 \\ 5 \end{bmatrix} \\ &= \frac{1}{-7} \begin{bmatrix} -4-10 \\ -12+5 \end{bmatrix} \\ &= \frac{1}{-7} \begin{bmatrix} -14 \\ -7 \end{bmatrix} \\&= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=2, y=1$

Example 2.4

$\text{จงแก้ระบบสมการ } 4x+3y=10 \text{ และ } 2x-y=0$

$$ \begin{aligned} A &= \begin{bmatrix} 4 & 3 \\ 2 & -1 \end{bmatrix}, B = \begin{bmatrix} 10 \\ 0 \end{bmatrix} \\ \det(A) &= (4)(-1) - (3)(2) \\&= -10 \\ A^{-1} &= \frac{1}{-10} \begin{bmatrix} -1 & -3 \\ -2 & 4 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-10} \begin{bmatrix} -1 & -3 \\ -2 & 4 \end{bmatrix} \begin{bmatrix} 10 \\ 0 \end{bmatrix} \\ &= \frac{1}{-10} \begin{bmatrix} -10+0 \\ -20+0 \end{bmatrix} \\ &= \frac{1}{-10} \begin{bmatrix} -10 \\ -20 \end{bmatrix} \\&= \begin{bmatrix} 1 \\ 2 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=1, y=2$

$\text{Solve the system: } 4x+3y=10 \text{ and } 2x-y=0$

$$ \begin{aligned} A &= \begin{bmatrix} 4 & 3 \\ 2 & -1 \end{bmatrix}, B = \begin{bmatrix} 10 \\ 0 \end{bmatrix} \\ \det(A) &= (4)(-1) - (3)(2) \\&= -10 \\ A^{-1} &= \frac{1}{-10} \begin{bmatrix} -1 & -3 \\ -2 & 4 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-10} \begin{bmatrix} -1 & -3 \\ -2 & 4 \end{bmatrix} \begin{bmatrix} 10 \\ 0 \end{bmatrix} \\ &= \frac{1}{-10} \begin{bmatrix} -10+0 \\ -20+0 \end{bmatrix} \\ &= \frac{1}{-10} \begin{bmatrix} -10 \\ -20 \end{bmatrix} \\&= \begin{bmatrix} 1 \\ 2 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=1, y=2$

Example 2.5

จงแก้ระบบสมการ 3 ตัวแปรต่อไปนี้ โดยวิธีเมทริกซ์ผกผัน

$$ \begin{aligned} x + y + z &= 6 &\quad \text{--- (1)} \\ 2y + 5z &= -4 &\quad \text{--- (2)} \\ 2x + 5y - z &= 27 &\quad \text{--- (3)} \end{aligned} $$
$$ \begin{aligned} A &= \begin{bmatrix} 1 & 1 & 1 \\ 0 & 2 & 5 \\ 2 & 5 & -1 \end{bmatrix}, B = \begin{bmatrix} 6 \\ -4 \\ 27 \end{bmatrix} \\ \det(A) &= 1(-2 - 25) - 1(0 - 10) + 1(0 - 4) \\&= -27 + 10 - 4 \\&= -21 \\ \operatorname{adj}(A) &= \begin{bmatrix} -27 & 6 & 3 \\ 10 & -3 & -5 \\ -4 & -3 & 2 \end{bmatrix} \\ A^{-1} &= \frac{1}{-21} \begin{bmatrix} -27 & 6 & 3 \\ 10 & -3 & -5 \\ -4 & -3 & 2 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-21} \begin{bmatrix} -27 & 6 & 3 \\ 10 & -3 & -5 \\ -4 & -3 & 2 \end{bmatrix} \begin{bmatrix} 6 \\ -4 \\ 27 \end{bmatrix} \\ &= \frac{1}{-21} \begin{bmatrix} -162 - 24 + 81 \\ 60 + 12 - 135 \\ -24 + 12 + 54 \end{bmatrix} \\ &= \frac{1}{-21} \begin{bmatrix} -105 \\ -63 \\ 42 \end{bmatrix} \\&= \begin{bmatrix} 5 \\ 3 \\ -2 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=5, y=3, z=-2$

Solve the following 3-variable system using the Inverse Matrix Method:

$$ \begin{aligned} x + y + z &= 6 &\quad \text{--- (1)} \\ 2y + 5z &= -4 &\quad \text{--- (2)} \\ 2x + 5y - z &= 27 &\quad \text{--- (3)} \end{aligned} $$
$$ \begin{aligned} A &= \begin{bmatrix} 1 & 1 & 1 \\ 0 & 2 & 5 \\ 2 & 5 & -1 \end{bmatrix}, B = \begin{bmatrix} 6 \\ -4 \\ 27 \end{bmatrix} \\ \det(A) &= 1(-2 - 25) - 1(0 - 10) + 1(0 - 4) \\&= -27 + 10 - 4 \\&= -21 \\ \operatorname{adj}(A) &= \begin{bmatrix} -27 & 6 & 3 \\ 10 & -3 & -5 \\ -4 & -3 & 2 \end{bmatrix} \\ A^{-1} &= \frac{1}{-21} \begin{bmatrix} -27 & 6 & 3 \\ 10 & -3 & -5 \\ -4 & -3 & 2 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{-21} \begin{bmatrix} -27 & 6 & 3 \\ 10 & -3 & -5 \\ -4 & -3 & 2 \end{bmatrix} \begin{bmatrix} 6 \\ -4 \\ 27 \end{bmatrix} \\ &= \frac{1}{-21} \begin{bmatrix} -162 - 24 + 81 \\ 60 + 12 - 135 \\ -24 + 12 + 54 \end{bmatrix} \\ &= \frac{1}{-21} \begin{bmatrix} -105 \\ -63 \\ 42 \end{bmatrix} \\&= \begin{bmatrix} 5 \\ 3 \\ -2 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=5, y=3, z=-2$

Example 2.6

จงแก้ระบบสมการ 3 ตัวแปรต่อไปนี้ โดยวิธีเมทริกซ์ผกผัน

$$ \begin{aligned} x + 2y - z &= 2 &\quad \text{--- (1)} \\ 3x + 8y + 9z &= 10 &\quad \text{--- (2)} \\ 2x - y + 2z &= 9 &\quad \text{--- (3)} \end{aligned} $$
$$ \begin{aligned} A &= \begin{bmatrix} 1 & 2 & -1 \\ 3 & 8 & 9 \\ 2 & -1 & 2 \end{bmatrix}, B = \begin{bmatrix} 2 \\ 10 \\ 9 \end{bmatrix} \\ \det(A) &= 1(16 - (-9)) - 2(6 - 18) - 1(-3 - 16) \\&= 25 + 24 + 19 \\&= 68 \\ \operatorname{adj}(A) &= \begin{bmatrix} 25 & -3 & 26 \\ 12 & 4 & -12 \\ -19 & 5 & 2 \end{bmatrix} \\ A^{-1} &= \frac{1}{68} \begin{bmatrix} 25 & -3 & 26 \\ 12 & 4 & -12 \\ -19 & 5 & 2 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{68} \begin{bmatrix} 25 & -3 & 26 \\ 12 & 4 & -12 \\ -19 & 5 & 2 \end{bmatrix} \begin{bmatrix} 2 \\ 10 \\ 9 \end{bmatrix} \\ &= \frac{1}{68} \begin{bmatrix} 50 - 30 + 234 \\ 24 + 40 - 108 \\ -38 + 50 + 18 \end{bmatrix} \\ &= \frac{1}{68} \begin{bmatrix} 254 \\ -44 \\ 30 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=\frac{127}{34}, y=-\frac{11}{17}, z=\frac{15}{34}$

Solve the following 3-variable system using the Inverse Matrix Method:

$$ \begin{aligned} x + 2y - z &= 2 &\quad \text{--- (1)} \\ 3x + 8y + 9z &= 10 &\quad \text{--- (2)} \\ 2x - y + 2z &= 9 &\quad \text{--- (3)} \end{aligned} $$
$$ \begin{aligned} A &= \begin{bmatrix} 1 & 2 & -1 \\ 3 & 8 & 9 \\ 2 & -1 & 2 \end{bmatrix}, B = \begin{bmatrix} 2 \\ 10 \\ 9 \end{bmatrix} \\ \det(A) &= 1(16 - (-9)) - 2(6 - 18) - 1(-3 - 16) \\&= 25 + 24 + 19 \\&= 68 \\ \operatorname{adj}(A) &= \begin{bmatrix} 25 & -3 & 26 \\ 12 & 4 & -12 \\ -19 & 5 & 2 \end{bmatrix} \\ A^{-1} &= \frac{1}{68} \begin{bmatrix} 25 & -3 & 26 \\ 12 & 4 & -12 \\ -19 & 5 & 2 \end{bmatrix} \\ X &= A^{-1}B \\ &= \frac{1}{68} \begin{bmatrix} 25 & -3 & 26 \\ 12 & 4 & -12 \\ -19 & 5 & 2 \end{bmatrix} \begin{bmatrix} 2 \\ 10 \\ 9 \end{bmatrix} \\ &= \frac{1}{68} \begin{bmatrix} 50 - 30 + 234 \\ 24 + 40 - 108 \\ -38 + 50 + 18 \end{bmatrix} \\ &= \frac{1}{68} \begin{bmatrix} 254 \\ -44 \\ 30 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=\frac{127}{34}, y=-\frac{11}{17}, z=\frac{15}{34}$

Example 2.7

จงแก้ระบบสมการ 3 ตัวแปรต่อไปนี้ โดยวิธีเมทริกซ์ผกผัน

$$ \begin{aligned} x + y + z &= 3 &\quad \text{--- (1)} \\ x + 2y + 3z &= 0 &\quad \text{--- (2)} \\ x + 3y + 4z &= -2 &\quad \text{--- (3)} \end{aligned} $$
$$ \begin{aligned} A &= \begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 1 & 3 & 4 \end{bmatrix}, B = \begin{bmatrix} 3 \\ 0 \\ -2 \end{bmatrix} \\ \det(A) &= 1(8 - 9) - 1(4 - 3) + 1(3 - 2) \\&= -1 - 1 + 1 \\&= -1 \\ \operatorname{adj}(A) &= \begin{bmatrix} -1 & -1 & 1 \\ -1 & 3 & -2 \\ 1 & -2 & 1 \end{bmatrix} \\ A^{-1} &= \frac{1}{-1} \begin{bmatrix} -1 & -1 & 1 \\ -1 & 3 & -2 \\ 1 & -2 & 1 \end{bmatrix} \\&= \begin{bmatrix} 1 & 1 & -1 \\ 1 & -3 & 2 \\ -1 & 2 & -1 \end{bmatrix} \\ X &= A^{-1}B \\ &= \begin{bmatrix} 1 & 1 & -1 \\ 1 & -3 & 2 \\ -1 & 2 & -1 \end{bmatrix} \begin{bmatrix} 3 \\ 0 \\ -2 \end{bmatrix} \\ &= \begin{bmatrix} 3 + 0 + 2 \\ 3 + 0 - 4 \\ -3 + 0 + 2 \end{bmatrix} \\&= \begin{bmatrix} 5 \\ -1 \\ -1 \end{bmatrix} \end{aligned} $$

$\text{ดังนั้น } x=5, y=-1, z=-1$

Solve the following 3-variable system using the Inverse Matrix Method:

$$ \begin{aligned} x + y + z &= 3 &\quad \text{--- (1)} \\ x + 2y + 3z &= 0 &\quad \text{--- (2)} \\ x + 3y + 4z &= -2 &\quad \text{--- (3)} \end{aligned} $$
$$ \begin{aligned} A &= \begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 1 & 3 & 4 \end{bmatrix}, B = \begin{bmatrix} 3 \\ 0 \\ -2 \end{bmatrix} \\ \det(A) &= 1(8 - 9) - 1(4 - 3) + 1(3 - 2) \\&= -1 - 1 + 1 \\&= -1 \\ \operatorname{adj}(A) &= \begin{bmatrix} -1 & -1 & 1 \\ -1 & 3 & -2 \\ 1 & -2 & 1 \end{bmatrix} \\ A^{-1} &= \frac{1}{-1} \begin{bmatrix} -1 & -1 & 1 \\ -1 & 3 & -2 \\ 1 & -2 & 1 \end{bmatrix} \\&= \begin{bmatrix} 1 & 1 & -1 \\ 1 & -3 & 2 \\ -1 & 2 & -1 \end{bmatrix} \\ X &= A^{-1}B \\ &= \begin{bmatrix} 1 & 1 & -1 \\ 1 & -3 & 2 \\ -1 & 2 & -1 \end{bmatrix} \begin{bmatrix} 3 \\ 0 \\ -2 \end{bmatrix} \\ &= \begin{bmatrix} 3 + 0 + 2 \\ 3 + 0 - 4 \\ -3 + 0 + 2 \end{bmatrix} \\&= \begin{bmatrix} 5 \\ -1 \\ -1 \end{bmatrix} \end{aligned} $$

$\text{Thus, } x=5, y=-1, z=-1$

3

วิธีที่ 2: กฎของคราเมอร์ Method 2: Cramer's Rule

TH

กฎของคราเมอร์ (Cramer's Rule) เป็นวิธีการหาผลเฉลยของระบบสมการเชิงเส้นโดยใช้ ดีเทอร์มิแนนต์ (Determinant) ซึ่งช่วยให้เราสามารถหาค่าของตัวแปรแต่ละตัวได้โดยตรง โดยไม่ต้องหาเมทริกซ์ผกผันทั้งหมด

  • $\det(A)$ : ดีเทอร์มิแนนต์ของเมทริกซ์สัมประสิทธิ์ — ดีเทอร์มิแนนต์ของเมทริกซ์หลัก โดยมีเงื่อนไขสำคัญคือ $\det(A) \neq 0$
  • $A_i$ : เมทริกซ์แทนที่หลักที่ $i$ — เมทริกซ์ที่เกิดจากการนำ เมทริกซ์ค่าคงที่ $B$ ไปแทนที่ในหลักที่ $i$ ของเมทริกซ์ $A$
  • $x_i$ : ค่าของตัวแปรลำดับที่ $i$ — คำตอบของตัวแปรตัวที่ $i$ (เช่น $x_1, x_2, \dots, x_n$ หรือ $x, y, z$)

📌 สูตรคำนวณและโครงสร้างเมทริกซ์ $A_i$:

$$ \begin{aligned} {\color{#1565c0}A} &= \begin{bmatrix} a_{11} & \cdots & {\color{#e65100}a_{1i}} & \cdots & a_{1n} \\ a_{21} & \cdots & {\color{#e65100}a_{2i}} & \cdots & a_{2n} \\ \vdots & \ddots & \vdots & \ddots & \vdots \\ a_{n1} & \cdots & {\color{#e65100}a_{ni}} & \cdots & a_{nn} \end{bmatrix}, \quad {\color{#2e7d32}B} = \begin{bmatrix} {\color{#2e7d32}b_1} \\ {\color{#2e7d32}b_2} \\ \vdots \\ {\color{#2e7d32}b_n} \end{bmatrix} \\[12pt] &\qquad\qquad\qquad\Downarrow \\[12pt] {\color{#e65100}A_i} &= \begin{bmatrix} a_{11} & \cdots & {\color{#2e7d32}b_1} & \cdots & a_{1n} \\ a_{21} & \cdots & {\color{#2e7d32}b_2} & \cdots & a_{2n} \\ \vdots & \ddots & \vdots & \ddots & \vdots \\ a_{n1} & \cdots & {\color{#2e7d32}b_n} & \cdots & a_{nn} \end{bmatrix} \end{aligned} $$
$\Downarrow$
$$ {\color{#e65100}x_i} = \frac{\det({\color{#e65100}A_i})}{\det({\color{#1565c0}A})} $$

⚠️ ข้อจำกัดสำคัญ: กฎของคราเมอร์ใช้ได้เฉพาะกรณีที่ระบบสมการมี จำนวนสมการเท่ากับจำนวนตัวแปร ($n \times n$) และ $\det(A) \neq 0$ เท่านั้น หาก $\det(A) = 0$ ตัวส่วนจะเป็นศูนย์ ทำให้ไม่สามารถใช้สูตรนี้หาคำตอบได้

EN

Cramer's Rule is an explicit formula for solving a system of linear equations using Determinants, allowing each variable to be calculated directly without computing the full inverse matrix.

  • $\det(A)$ : Determinant of Coefficient Matrix — determinant of the main matrix under the condition that $\det(A) \neq 0$
  • $A_i$ : Matrix with Column $i$ Replaced — matrix formed by replacing the $i$-th column of $A$ with the Constant Matrix $B$
  • $x_i$ : Value of the $i$-th Variable — the solution for the $i$-th variable (such as $x_1, x_2, \dots, x_n$ or $x, y, z$)

📌 Formula & Matrix $A_i$ Substitution Structure:

$$ \begin{aligned} {\color{#1565c0}A} &= \begin{bmatrix} a_{11} & \cdots & {\color{#e65100}a_{1i}} & \cdots & a_{1n} \\ a_{21} & \cdots & {\color{#e65100}a_{2i}} & \cdots & a_{2n} \\ \vdots & \ddots & \vdots & \ddots & \vdots \\ a_{n1} & \cdots & {\color{#e65100}a_{ni}} & \cdots & a_{nn} \end{bmatrix}, \quad {\color{#2e7d32}B} = \begin{bmatrix} {\color{#2e7d32}b_1} \\ {\color{#2e7d32}b_2} \\ \vdots \\ {\color{#2e7d32}b_n} \end{bmatrix} \\[12pt] &\qquad\qquad\qquad\Downarrow \\[12pt] {\color{#e65100}A_i} &= \begin{bmatrix} a_{11} & \cdots & {\color{#2e7d32}b_1} & \cdots & a_{1n} \\ a_{21} & \cdots & {\color{#2e7d32}b_2} & \cdots & a_{2n} \\ \vdots & \ddots & \vdots & \ddots & \vdots \\ a_{n1} & \cdots & {\color{#2e7d32}b_n} & \cdots & a_{nn} \end{bmatrix} \end{aligned} $$
$\Downarrow$
$$ {\color{#e65100}x_i} = \frac{\det({\color{#e65100}A_i})}{\det({\color{#1565c0}A})} $$

⚠️ Important Constraint: Cramer's Rule applies only when the system has an equal number of equations and variables ($n \times n$) and $\det(A) \neq 0$. If $\det(A) = 0$, the denominator is zero and the rule cannot be used.

Example 3.1

$\text{จงแก้ระบบสมการ } x+y=5 \text{ และ } 2x-y=4$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 1 & 1 \\ 2 & -1 \end{vmatrix} \\&= -1 - 2 \\&= -3 \\ \det(A_x) &= \begin{vmatrix} 5 & 1 \\ 4 & -1 \end{vmatrix} \\&= -5 - 4 \\&= -9 \\ \det(A_y) &= \begin{vmatrix} 1 & 5 \\ 2 & 4 \end{vmatrix} \\&= 4 - 10 \\&= -6 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{-9}{-3} \\&= 3 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{-6}{-3} \\&= 2 \end{aligned} $$

$\text{Solve the system: } x+y=5 \text{ and } 2x-y=4$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 1 & 1 \\ 2 & -1 \end{vmatrix} \\&= -1 - 2 \\&= -3 \\ \det(A_x) &= \begin{vmatrix} 5 & 1 \\ 4 & -1 \end{vmatrix} \\&= -5 - 4 \\&= -9 \\ \det(A_y) &= \begin{vmatrix} 1 & 5 \\ 2 & 4 \end{vmatrix} \\&= 4 - 10 \\&= -6 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{-9}{-3} \\&= 3 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{-6}{-3} \\&= 2 \end{aligned} $$
Example 3.2

$\text{จงแก้ระบบสมการ } 3x-y=7 \text{ และ } 2x+3y=1$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 3 & -1 \\ 2 & 3 \end{vmatrix} \\&= 9 - (-2) \\&= 11 \\ \det(A_x) &= \begin{vmatrix} 7 & -1 \\ 1 & 3 \end{vmatrix} \\&= 21 - (-1) \\&= 22 \\ \det(A_y) &= \begin{vmatrix} 3 & 7 \\ 2 & 1 \end{vmatrix} \\&= 3 - 14 \\&= -11 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{22}{11} \\&= 2 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{-11}{11} \\&= -1 \end{aligned} $$

$\text{Solve the system: } 3x-y=7 \text{ and } 2x+3y=1$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 3 & -1 \\ 2 & 3 \end{vmatrix} \\&= 9 - (-2) \\&= 11 \\ \det(A_x) &= \begin{vmatrix} 7 & -1 \\ 1 & 3 \end{vmatrix} \\&= 21 - (-1) \\&= 22 \\ \det(A_y) &= \begin{vmatrix} 3 & 7 \\ 2 & 1 \end{vmatrix} \\&= 3 - 14 \\&= -11 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{22}{11} \\&= 2 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{-11}{11} \\&= -1 \end{aligned} $$
Example 3.3

$\text{จงแก้ระบบสมการ } 4x-3y=2 \text{ และ } x+2y=6$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 4 & -3 \\ 1 & 2 \end{vmatrix} \\&= 8 - (-3) \\&= 11 \\ \det(A_x) &= \begin{vmatrix} 2 & -3 \\ 6 & 2 \end{vmatrix} \\&= 4 - (-18) \\&= 22 \\ \det(A_y) &= \begin{vmatrix} 4 & 2 \\ 1 & 6 \end{vmatrix} \\&= 24 - 2 \\&= 22 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{22}{11} \\&= 2 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{22}{11} \\&= 2 \end{aligned} $$

$\text{Solve the system: } 4x-3y=2 \text{ and } x+2y=6$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 4 & -3 \\ 1 & 2 \end{vmatrix} \\&= 8 - (-3) \\&= 11 \\ \det(A_x) &= \begin{vmatrix} 2 & -3 \\ 6 & 2 \end{vmatrix} \\&= 4 - (-18) \\&= 22 \\ \det(A_y) &= \begin{vmatrix} 4 & 2 \\ 1 & 6 \end{vmatrix} \\&= 24 - 2 \\&= 22 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{22}{11} \\&= 2 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{22}{11} \\&= 2 \end{aligned} $$
Example 3.4

$\text{จงแก้ระบบสมการ } 2x+5y=9 \text{ และ } 3x-2y=4$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 2 & 5 \\ 3 & -2 \end{vmatrix} \\&= -4 - 15 \\&= -19 \\ \det(A_x) &= \begin{vmatrix} 9 & 5 \\ 4 & -2 \end{vmatrix} \\&= -18 - 20 \\&= -38 \\ \det(A_y) &= \begin{vmatrix} 2 & 9 \\ 3 & 4 \end{vmatrix} \\&= 8 - 27 \\&= -19 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{-38}{-19} \\&= 2 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{-19}{-19} \\&= 1 \end{aligned} $$

$\text{Solve the system: } 2x+5y=9 \text{ and } 3x-2y=4$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 2 & 5 \\ 3 & -2 \end{vmatrix} \\&= -4 - 15 \\&= -19 \\ \det(A_x) &= \begin{vmatrix} 9 & 5 \\ 4 & -2 \end{vmatrix} \\&= -18 - 20 \\&= -38 \\ \det(A_y) &= \begin{vmatrix} 2 & 9 \\ 3 & 4 \end{vmatrix} \\&= 8 - 27 \\&= -19 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{-38}{-19} \\&= 2 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{-19}{-19} \\&= 1 \end{aligned} $$
Example 3.5

$\text{จงแก้ระบบสมการ } 5x+2y=12 \text{ และ } -2x+y=6$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 5 & 2 \\ -2 & 1 \end{vmatrix} \\&= 5 - (-4) \\&= 9 \\ \det(A_x) &= \begin{vmatrix} 12 & 2 \\ 6 & 1 \end{vmatrix} \\&= 12 - 12 \\&= 0 \\ \det(A_y) &= \begin{vmatrix} 5 & 12 \\ -2 & 6 \end{vmatrix} \\&= 30 - (-24) \\&= 54 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{0}{9} \\&= 0 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{54}{9} \\&= 6 \end{aligned} $$

$\text{Solve the system: } 5x+2y=12 \text{ and } -2x+y=6$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 5 & 2 \\ -2 & 1 \end{vmatrix} \\&= 5 - (-4) \\&= 9 \\ \det(A_x) &= \begin{vmatrix} 12 & 2 \\ 6 & 1 \end{vmatrix} \\&= 12 - 12 \\&= 0 \\ \det(A_y) &= \begin{vmatrix} 5 & 12 \\ -2 & 6 \end{vmatrix} \\&= 30 - (-24) \\&= 54 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{0}{9} \\&= 0 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{54}{9} \\&= 6 \end{aligned} $$
Example 3.6

$\text{จงแก้ระบบสมการ } x+y+z=6, \ 2x-y+z=3 \text{ และ } x+2y-z=2$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 1 & 1 & 1 \\ 2 & -1 & 1 \\ 1 & 2 & -1 \end{vmatrix} \\&= 1(1 - 2) - 1(-2 - 1) + 1(4 - (-1)) \\&= -1 + 3 + 5 \\&= 7 \\ \det(A_x) &= \begin{vmatrix} 6 & 1 & 1 \\ 3 & -1 & 1 \\ 2 & 2 & -1 \end{vmatrix} \\&= 6(1 - 2) - 1(-3 - 2) + 1(6 - (-2)) \\&= -6 + 5 + 8 \\&= 7 \\ \det(A_y) &= \begin{vmatrix} 1 & 6 & 1 \\ 2 & 3 & 1 \\ 1 & 2 & -1 \end{vmatrix} \\&= 1(-3 - 2) - 6(-2 - 1) + 1(4 - 3) \\&= -5 + 18 + 1 \\&= 14 \\ \det(A_z) &= \begin{vmatrix} 1 & 1 & 6 \\ 2 & -1 & 3 \\ 1 & 2 & 2 \end{vmatrix} \\&= 1(-2 - 6) - 1(4 - 3) + 6(4 - (-1)) \\&= -8 - 1 + 30 \\&= 21 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{7}{7} \\&= 1 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{14}{7} \\&= 2 \\ z &= \frac{\det(A_z)}{\det(A)} \\&= \frac{21}{7} \\&= 3 \end{aligned} $$

$\text{Solve the system: } x+y+z=6, \ 2x-y+z=3 \text{ and } x+2y-z=2$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 1 & 1 & 1 \\ 2 & -1 & 1 \\ 1 & 2 & -1 \end{vmatrix} \\&= 1(1 - 2) - 1(-2 - 1) + 1(4 - (-1)) \\&= -1 + 3 + 5 \\&= 7 \\ \det(A_x) &= \begin{vmatrix} 6 & 1 & 1 \\ 3 & -1 & 1 \\ 2 & 2 & -1 \end{vmatrix} \\&= 6(1 - 2) - 1(-3 - 2) + 1(6 - (-2)) \\&= -6 + 5 + 8 \\&= 7 \\ \det(A_y) &= \begin{vmatrix} 1 & 6 & 1 \\ 2 & 3 & 1 \\ 1 & 2 & -1 \end{vmatrix} \\&= 1(-3 - 2) - 6(-2 - 1) + 1(4 - 3) \\&= -5 + 18 + 1 \\&= 14 \\ \det(A_z) &= \begin{vmatrix} 1 & 1 & 6 \\ 2 & -1 & 3 \\ 1 & 2 & 2 \end{vmatrix} \\&= 1(-2 - 6) - 1(4 - 3) + 6(4 - (-1)) \\&= -8 - 1 + 30 \\&= 21 \\ x &= \frac{\det(A_x)}{\det(A)} \\&= \frac{7}{7} \\&= 1 \\ y &= \frac{\det(A_y)}{\det(A)} \\&= \frac{14}{7} \\&= 2 \\ z &= \frac{\det(A_z)}{\det(A)} \\&= \frac{21}{7} \\&= 3 \end{aligned} $$
Example 3.7

$\text{จงแก้ระบบสมการ } x+2y+z=4, \ 2x-y+z=1 \text{ และ } 3x+y+2z=7$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 1 & 2 & 1 \\ 2 & -1 & 1 \\ 3 & 1 & 2 \end{vmatrix} \\&= 1(-2 - 1) - 2(4 - 3) + 1(2 - (-3)) \\&= -3 - 2 + 5 \\&= 0 \quad (\text{ไม่สามารถใช้กฎของคราเมอร์ได้}) \end{aligned} $$

⚠️ เนื่องจาก $\det(A) = 0$ จึงไม่สามารถหาคำตอบด้วยกฎของคราเมอร์ได้ (ต้องตรวจสอบด้วยการดำเนินการตามแถวว่าระบบสมการนี้ไม่มีคำตอบ หรือมีคำตอบนับไม่ถ้วน)

$\text{Solve the system: } x+2y+z=4, \ 2x-y+z=1 \text{ and } 3x+y+2z=7$

$$ \begin{aligned} \det(A) &= \begin{vmatrix} 1 & 2 & 1 \\ 2 & -1 & 1 \\ 3 & 1 & 2 \end{vmatrix} \\&= 1(-2 - 1) - 2(4 - 3) + 1(2 - (-3)) \\&= -3 - 2 + 5 \\&= 0 \quad (\text{Cramer's Rule cannot be used}) \end{aligned} $$

⚠️ Since $\det(A) = 0$, Cramer's Rule cannot be applied (Gaussian elimination must be used to check whether the system has no solution or infinitely many solutions).

4

วิธีที่ 3: การดำเนินการตามแถว Method 3: Gauss-Jordan Elimination

TH

การแก้ระบบสมการเชิงเส้นด้วย การดำเนินการตามแถวขั้นมูลฐาน (Elementary Row Operations: EROs) ทำได้โดยนำระบบสมการมาจัดให้อยู่ในรูป เมทริกซ์แต่งเติม (Augmented Matrix) $\displaystyle [{\color{#1565c0}A} \mid {\color{#2e7d32}B}]$ แล้วแปลงรูปเมทริกซ์จนกระทั่งฝั่งซ้ายกลายเป็น เมทริกซ์เอกลักษณ์ ($I$)

  • $A$ : เมทริกซ์สัมประสิทธิ์ — สัมประสิทธิ์ของตัวแปรในระบบสมการ มีมิติ $m \times n$
  • $B$ : เมทริกซ์ค่าคงที่ — เวกเตอร์ของค่าคงที่ทางขวามือ มีมิติ $m \times 1$
  • $[A \mid B]$ : เมทริกซ์แต่งเติม — การนำเมทริกซ์ $A$ และ $B$ มาเขียนต่อกัน มีมิติ $m \times (n + 1)$
  • $X$ : เมทริกซ์ผลเฉลย — ค่าของตัวแปรที่จะปรากฏในหลักสุดท้ายหลังแปลงเป็นรูปแบบขั้นบันไดลดรูป มีมิติ $n \times 1$

📌 กระบวนการแปลงเมทริกซ์แต่งเติม (Gauss-Jordan Elimination):

$$ [{\color{#1565c0}A} \mid {\color{#2e7d32}B}] = \left[\begin{array}{cccc|c} {\color{#1565c0}a_{11}} & {\color{#1565c0}a_{12}} & \cdots & {\color{#1565c0}a_{1n}} & {\color{#2e7d32}b_1} \\ {\color{#1565c0}a_{21}} & {\color{#1565c0}a_{22}} & \cdots & {\color{#1565c0}a_{2n}} & {\color{#2e7d32}b_2} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ {\color{#1565c0}a_{m1}} & {\color{#1565c0}a_{m2}} & \cdots & {\color{#1565c0}a_{mn}} & {\color{#2e7d32}b_m} \end{array}\right] $$
$\Downarrow \quad \text{ใช้การดำเนินการตามแถว : } R_i \leftrightarrow R_j,\ cR_i,\ R_i + cR_j \text{}$
$$ [{\color{#1565c0}A} \mid {\color{#2e7d32}B}] \;\sim\; [{\color{#1565c0}I} \mid {\color{#e65100}X}] = \left[\begin{array}{cccc|c} 1 & 0 & \cdots & 0 & {\color{#e65100}x_1} \\ 0 & 1 & \cdots & 0 & {\color{#e65100}x_2} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \cdots & 1 & {\color{#e65100}x_n} \end{array}\right] $$

💡 จุดเด่นของวิธีนี้: สามารถใช้หาคำตอบได้กับระบบสมการเชิงเส้นทุกรูปแบบ ไม่จำเป็นว่าต้องมีจำนวนสมการเท่ากับจำนวนตัวแปร และยังบอกได้ชัดเจนว่าระบบสมการนั้นมีคำตอบเดียว, มีคำตอบนับไม่ถ้วน หรือไม่มีคำตอบ

EN

Solving a system of linear equations using Elementary Row Operations (EROs) is performed by formulating the system into an Augmented Matrix $\displaystyle [{\color{#1565c0}A} \mid {\color{#2e7d32}B}]$ and transforming the left side into the Identity Matrix ($I$).

  • $A$ : Coefficient Matrix — coefficients of variables with dimension $m \times n$
  • $B$ : Constant Matrix — column vector of right-hand constants with dimension $m \times 1$
  • $[A \mid B]$ : Augmented Matrix — combining $A$ and $B$ side by side with dimension $m \times (n + 1)$
  • $X$ : Solution Vector — values of unknown variables obtained in the last column after reaching reduced row echelon form with dimension $n \times 1$

📌 Augmented Matrix Transformation Process (Gauss-Jordan Elimination):

$$ [{\color{#1565c0}A} \mid {\color{#2e7d32}B}] = \left[\begin{array}{cccc|c} {\color{#1565c0}a_{11}} & {\color{#1565c0}a_{12}} & \cdots & {\color{#1565c0}a_{1n}} & {\color{#2e7d32}b_1} \\ {\color{#1565c0}a_{21}} & {\color{#1565c0}a_{22}} & \cdots & {\color{#1565c0}a_{2n}} & {\color{#2e7d32}b_2} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ {\color{#1565c0}a_{m1}} & {\color{#1565c0}a_{m2}} & \cdots & {\color{#1565c0}a_{mn}} & {\color{#2e7d32}b_m} \end{array}\right] $$
$\Downarrow \quad \text{Apply Row Operations: } R_i \leftrightarrow R_j,\ cR_i,\ R_i + cR_j$
$$ [{\color{#1565c0}A} \mid {\color{#2e7d32}B}] \;\sim\; [{\color{#1565c0}I} \mid {\color{#e65100}X}] = \left[\begin{array}{cccc|c} 1 & 0 & \cdots & 0 & {\color{#e65100}x_1} \\ 0 & 1 & \cdots & 0 & {\color{#e65100}x_2} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \cdots & 1 & {\color{#e65100}x_n} \end{array}\right] $$

💡 Advantage: This method applies universally to any system of linear equations (even when the number of equations does not equal the number of variables) and clearly identifies unique, infinite, or no solution cases.

Example 4.1

$\text{จงแก้ระบบสมการ } x+y=3 \text{ และ } x-y=1$

$$ \begin{aligned} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 1 & -1 & 1 \end{array}\right] &\xrightarrow{R_2 - R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & -2 & -2 \end{array}\right] \\ &\xrightarrow{-\frac{1}{2}R_2} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 1 & 1 \end{array}\right] \\ &\xrightarrow{R_1 - R_2} \left[\begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right] \end{aligned} $$

$\text{ดังนั้น } x=2, y=1$

$\text{Solve the system: } x+y=3 \text{ and } x-y=1$

$$ \begin{aligned} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 1 & -1 & 1 \end{array}\right] &\xrightarrow{R_2 - R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & -2 & -2 \end{array}\right] \\ &\xrightarrow{-\frac{1}{2}R_2} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 1 & 1 \end{array}\right] \\ &\xrightarrow{R_1 - R_2} \left[\begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right] \end{aligned} $$

$\text{Thus, } x=2, y=1$

Example 4.2

$\text{จงแก้ระบบสมการ } 2x+y=4 \text{ และ } x-y=-1$

$$ \begin{aligned} \left[\begin{array}{cc|c} 2 & 1 & 4 \\ 1 & -1 & -1 \end{array}\right] &\xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 1 & -1 & -1 \\ 2 & 1 & 4 \end{array}\right] \\ &\xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & -1 & -1 \\ 0 & 3 & 6 \end{array}\right] \\ &\xrightarrow{\frac{1}{3}R_2} \left[\begin{array}{cc|c} 1 & -1 & -1 \\ 0 & 1 & 2 \end{array}\right] \\ &\xrightarrow{R_1 + R_2} \left[\begin{array}{cc|c} 1 & 0 & 1 \\ 0 & 1 & 2 \end{array}\right] \end{aligned} $$

$\text{ดังนั้น } x=1, y=2$

$\text{Solve the system: } 2x+y=4 \text{ and } x-y=-1$

$$ \begin{aligned} \left[\begin{array}{cc|c} 2 & 1 & 4 \\ 1 & -1 & -1 \end{array}\right] &\xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 1 & -1 & -1 \\ 2 & 1 & 4 \end{array}\right] \\ &\xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & -1 & -1 \\ 0 & 3 & 6 \end{array}\right] \\ &\xrightarrow{\frac{1}{3}R_2} \left[\begin{array}{cc|c} 1 & -1 & -1 \\ 0 & 1 & 2 \end{array}\right] \\ &\xrightarrow{R_1 + R_2} \left[\begin{array}{cc|c} 1 & 0 & 1 \\ 0 & 1 & 2 \end{array}\right] \end{aligned} $$

$\text{Thus, } x=1, y=2$

Example 4.3

$\text{จงแก้ระบบสมการ } x+2y=5 \text{ และ } 3x-y=1$

$$ \begin{aligned} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 3 & -1 & 1 \end{array}\right] &\xrightarrow{R_2 - 3R_1} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 0 & -7 & -14 \end{array}\right] \\ &\xrightarrow{-\frac{1}{7}R_2} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 0 & 1 & 2 \end{array}\right] \\ &\xrightarrow{R_1 - 2R_2} \left[\begin{array}{cc|c} 1 & 0 & 1 \\ 0 & 1 & 2 \end{array}\right] \end{aligned} $$

$\text{ดังนั้น } x=1, y=2$

$\text{Solve the system: } x+2y=5 \text{ and } 3x-y=1$

$$ \begin{aligned} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 3 & -1 & 1 \end{array}\right] &\xrightarrow{R_2 - 3R_1} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 0 & -7 & -14 \end{array}\right] \\ &\xrightarrow{-\frac{1}{7}R_2} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 0 & 1 & 2 \end{array}\right] \\ &\xrightarrow{R_1 - 2R_2} \left[\begin{array}{cc|c} 1 & 0 & 1 \\ 0 & 1 & 2 \end{array}\right] \end{aligned} $$

$\text{Thus, } x=1, y=2$

Example 4.4

$\text{จงแก้ระบบสมการ } 2x-3y=1 \text{ และ } x+y=3$

$$ \begin{aligned} \left[\begin{array}{cc|c} 2 & -3 & 1 \\ 1 & 1 & 3 \end{array}\right] &\xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 2 & -3 & 1 \end{array}\right] \\ &\xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & -5 & -5 \end{array}\right] \\ &\xrightarrow{-\frac{1}{5}R_2} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 1 & 1 \end{array}\right] \\ &\xrightarrow{R_1 - R_2} \left[\begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right] \end{aligned} $$

$\text{ดังนั้น } x=2, y=1$

$\text{Solve the system: } 2x-3y=1 \text{ and } x+y=3$

$$ \begin{aligned} \left[\begin{array}{cc|c} 2 & -3 & 1 \\ 1 & 1 & 3 \end{array}\right] &\xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 2 & -3 & 1 \end{array}\right] \\ &\xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & -5 & -5 \end{array}\right] \\ &\xrightarrow{-\frac{1}{5}R_2} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 1 & 1 \end{array}\right] \\ &\xrightarrow{R_1 - R_2} \left[\begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right] \end{aligned} $$

$\text{Thus, } x=2, y=1$

Example 4.5

$\text{จงแก้ระบบสมการ } x+3y=7 \text{ และ } 2x-y=0$

$$ \begin{aligned} \left[\begin{array}{cc|c} 1 & 3 & 7 \\ 2 & -1 & 0 \end{array}\right] &\xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 3 & 7 \\ 0 & -7 & -14 \end{array}\right] \\ &\xrightarrow{-\frac{1}{7}R_2} \left[\begin{array}{cc|c} 1 & 3 & 7 \\ 0 & 1 & 2 \end{array}\right] \\ &\xrightarrow{R_1 - 3R_2} \left[\begin{array}{cc|c} 1 & 0 & 1 \\ 0 & 1 & 2 \end{array}\right] \end{aligned} $$

$\text{ดังนั้น } x=1, y=2$

$\text{Solve the system: } x+3y=7 \text{ and } 2x-y=0$

$$ \begin{aligned} \left[\begin{array}{cc|c} 1 & 3 & 7 \\ 2 & -1 & 0 \end{array}\right] &\xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 3 & 7 \\ 0 & -7 & -14 \end{array}\right] \\ &\xrightarrow{-\frac{1}{7}R_2} \left[\begin{array}{cc|c} 1 & 3 & 7 \\ 0 & 1 & 2 \end{array}\right] \\ &\xrightarrow{R_1 - 3R_2} \left[\begin{array}{cc|c} 1 & 0 & 1 \\ 0 & 1 & 2 \end{array}\right] \end{aligned} $$

$\text{Thus, } x=1, y=2$

Example 4.6

$\text{จงแก้ระบบสมการ } x+y+z=6, \ x-y+z=2 \text{ และ } 2x+y-z=1$

$$ \begin{aligned} \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 1 & -1 & 1 & 2 \\ 2 & 1 & -1 & 1 \end{array}\right] &\xrightarrow{\substack{R_2 - R_1 \\ R_3 - 2R_1}} \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -2 & 0 & -4 \\ 0 & -1 & -3 & -11 \end{array}\right] \\ &\xrightarrow{-\frac{1}{2}R_2} \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 0 & 2 \\ 0 & -1 & -3 & -11 \end{array}\right] \\ &\xrightarrow{\substack{R_1 - R_2 \\ R_3 + R_2}} \left[\begin{array}{ccc|c} 1 & 0 & 1 & 4 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & -3 & -9 \end{array}\right] \\ &\xrightarrow{-\frac{1}{3}R_3} \left[\begin{array}{ccc|c} 1 & 0 & 1 & 4 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 1 & 3 \end{array}\right] \\ &\xrightarrow{R_1 - R_3} \left[\begin{array}{ccc|c} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 1 & 3 \end{array}\right] \end{aligned} $$

$\text{ดังนั้น } x=1, y=2, z=3$

$\text{Solve the system: } x+y+z=6, \ x-y+z=2 \text{ and } 2x+y-z=1$

$$ \begin{aligned} \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 1 & -1 & 1 & 2 \\ 2 & 1 & -1 & 1 \end{array}\right] &\xrightarrow{\substack{R_2 - R_1 \\ R_3 - 2R_1}} \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -2 & 0 & -4 \\ 0 & -1 & -3 & -11 \end{array}\right] \\ &\xrightarrow{-\frac{1}{2}R_2} \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 0 & 2 \\ 0 & -1 & -3 & -11 \end{array}\right] \\ &\xrightarrow{\substack{R_1 - R_2 \\ R_3 + R_2}} \left[\begin{array}{ccc|c} 1 & 0 & 1 & 4 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & -3 & -9 \end{array}\right] \\ &\xrightarrow{-\frac{1}{3}R_3} \left[\begin{array}{ccc|c} 1 & 0 & 1 & 4 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 1 & 3 \end{array}\right] \\ &\xrightarrow{R_1 - R_3} \left[\begin{array}{ccc|c} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 1 & 3 \end{array}\right] \end{aligned} $$

$\text{Thus, } x=1, y=2, z=3$

Example 4.7

$\text{จงแก้ระบบสมการ } x+2y+z=8, \ 2x-y+z=3 \text{ และ } 3x+y+2z=11$

$$ \begin{aligned} \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 2 & -1 & 1 & 3 \\ 3 & 1 & 2 & 11 \end{array}\right] &\xrightarrow{\substack{R_2 - 2R_1 \\ R_3 - 3R_1}} \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & -5 & -1 & -13 \\ 0 & -5 & -1 & -13 \end{array}\right] \\ &\xrightarrow{R_3 - R_2} \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & -5 & -1 & -13 \\ 0 & 0 & 0 & 0 \end{array}\right] \end{aligned} $$

⚠️ แถวสุดท้ายเป็น $0 = 0$ ทั้งแถว แสดงว่าระบบสมการนี้ มีคำตอบนับไม่ถ้วน (Infinitely Many Solutions) โดยสามารถกำหนดให้ $z = t$ ($t \in \mathbb{R}$) และหาค่า $x, y$ ในรูปของตัวแปรเสริม $t$ ได้

$\text{ดังนั้น ระบบสมการมีคำตอบมากมายนับไม่ถ้วน}$

$\text{Solve the system: } x+2y+z=8, \ 2x-y+z=3 \text{ and } 3x+y+2z=11$

$$ \begin{aligned} \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 2 & -1 & 1 & 3 \\ 3 & 1 & 2 & 11 \end{array}\right] &\xrightarrow{\substack{R_2 - 2R_1 \\ R_3 - 3R_1}} \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & -5 & -1 & -13 \\ 0 & -5 & -1 & -13 \end{array}\right] \\ &\xrightarrow{R_3 - R_2} \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & -5 & -1 & -13 \\ 0 & 0 & 0 & 0 \end{array}\right] \end{aligned} $$

⚠️ The bottom row consists entirely of zeros ($0 = 0$), indicating that the system has infinitely many solutions. Setting $z = t$ ($t \in \mathbb{R}$), solutions can be expressed parametrically.

$\text{Thus, the system has infinitely many solutions.}$

คำศัพท์ที่น่าสนใจ Key Vocabulary

คำศัพท์คณิตศาสตร์ภาษาอังกฤษ พร้อมรากศัพท์

คำศัพท์ รากศัพท์ / Root ความหมาย / Meaning
Matrix mater (mother, source) เมทริกซ์ · กลุ่มของจำนวนที่เรียงเป็นรูปสี่เหลี่ยมมุมฉากในวงเล็บ
System of Equations syn- (together) + histanai (to set up) ระบบสมการ · ชุดของสมการเชิงเส้นหลายสมการที่ต้องหาคำตอบร่วมกัน
Coefficient co- (together) + efficere (to produce) สัมประสิทธิ์ · ตัวเลขที่คูณอยู่กับตัวแปรในสมการ
Variable variare (to change) ตัวแปร · สัญลักษณ์ที่ใช้แทนจำนวนที่ไม่ทราบค่า เช่น x, y
Inverse in- (in) + vertere (to turn) ตัวผกผัน · เมทริกซ์ที่เมื่อนำมาคูณกับเมทริกซ์เดิมแล้วได้เมทริกซ์เอกลักษณ์ (Identity)
Determinant determinare (to bound, limit) ดีเทอร์มิแนนต์ · ค่าสเกลาร์ที่คำนวณจากเมทริกซ์จัตุรัส ใช้บ่งบอกสมบัติของเมทริกซ์
Cramer's Rule Gabriel Cramer (Swiss mathematician) กฎของคราเมอร์ · ทฤษฎีบททางพีชคณิตเชิงเส้นสำหรับการแก้ระบบสมการโดยใช้ดีเทอร์มิแนนต์
Row Operation row (line) + operari (to work) การดำเนินการตามแถว · การคูณแถว สลับแถว หรือบวกแถวเพื่อจัดรูปเมทริกซ์
Augmented Matrix augere (to increase) เมทริกซ์แต่งเติม · เมทริกซ์ที่เกิดจากการนำเมทริกซ์สองชุดมาเขียนต่อกัน
Row Echelon Form échelon (step of a ladder) รูปแบบขั้นบันไดตามแถว · รูปแบบของเมทริกซ์ที่ถูกจัดรูปให้อยู่ในรูปคล้ายขั้นบันไดเพื่อให้หาคำตอบได้ง่าย