Cramers Law 42F087
1. **Problem Statement:** Solve a system of linear equations using Cramer's Law.
2. **Formula:** For a system of $n$ linear equations with $n$ variables, Cramer's Law states that each variable $x_i$ can be found by
$$x_i = \frac{\det(A_i)}{\det(A)}$$
where $A$ is the coefficient matrix, $\det(A)$ is its determinant, and $A_i$ is the matrix formed by replacing the $i$-th column of $A$ with the constants vector.
3. **Important Rules:**
- The determinant $\det(A)$ must be non-zero for a unique solution.
- Calculate determinants carefully using expansion or row operations.
4. **Example:** Solve
$$\begin{cases} 2x + 3y = 5 \\ 4x - y = 1 \end{cases}$$
5. **Step 1:** Write coefficient matrix and constants vector:
$$A = \begin{bmatrix} 2 & 3 \\ 4 & -1 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 5 \\ 1 \end{bmatrix}$$
6. **Step 2:** Calculate $\det(A)$:
$$\det(A) = (2)(-1) - (3)(4) = -2 - 12 = -14$$
7. **Step 3:** Form $A_x$ by replacing first column with $\mathbf{b}$:
$$A_x = \begin{bmatrix} 5 & 3 \\ 1 & -1 \end{bmatrix}$$
Calculate $\det(A_x)$:
$$\det(A_x) = (5)(-1) - (3)(1) = -5 - 3 = -8$$
8. **Step 4:** Form $A_y$ by replacing second column with $\mathbf{b}$:
$$A_y = \begin{bmatrix} 2 & 5 \\ 4 & 1 \end{bmatrix}$$
Calculate $\det(A_y)$:
$$\det(A_y) = (2)(1) - (5)(4) = 2 - 20 = -18$$
9. **Step 5:** Calculate variables:
$$x = \frac{\det(A_x)}{\det(A)} = \frac{-8}{-14} = \frac{4}{7}$$
$$y = \frac{\det(A_y)}{\det(A)} = \frac{-18}{-14} = \frac{9}{7}$$
10. **Answer:** The solution is
$$x = \frac{4}{7}, \quad y = \frac{9}{7}$$
This method works for any square system with a non-zero determinant.