# Solve the following non-homogeneous system of linear equation by determinant method : $x+y+z=4\;,x-y+z=2\;,2x+y-z=1$

Toolbox:
• Cramer's rule : If $Ax = B$ is a system of x linear equations in x unknowns such that $|A| \neq 0$ then the system has a unique solution. Let the x unknowns be $x_1, x_2.........x_n$ and $\Delta$ denote $|A|$. The solution is given by $x_1=\large\frac{\Delta x_1}{\Delta}, x_2=\large\frac{\Delta x_2}{\Delta}..........x_n = \large\frac{\Delta x_n}{\Delta}$ where $\Delta x_1, \Delta x_2....\Delta x_n$ are obtained by replacing the 1st, 2nd.....$n^{th}$ column respectively by the column of constants in B.
Step 1
$\Delta = \begin{vmatrix} 1 & 1 & 1 \\ 1 & -1 & 1 \\ 2 & 1 & -1 \end{vmatrix} = 1(1-1)-1(-1-2)+1(1+2)$
$= 0+3+3=6 \neq 0$
$\Delta \neq 0. \: \: \: \therefore$ Cramer's rule can be used.
Step 2
$\Delta_x = \begin{vmatrix} 4 & 1 & 1 \\ 2 & -1 & 1 \\ 1 & 1 & -1 \end{vmatrix} = 4(1-1)-1(-2-1)+1(2+1)$
$=0+3+3=6$
$\Delta_y = \begin{vmatrix} 1 & 4 & 1 \\ 1 & 2 & 1 \\ 2 & 1 & -1 \end{vmatrix} = 1(-2-1)-4(-1-2)+1(1-4)$
$=-3+12-3=-6$
$\Delta_z = \begin{vmatrix} 1 & 1 & 4 \\ 1 & -1 & 2 \\ 2 & 1 & 1 \end{vmatrix} = 1(-1-2)-1(1-4)+4(1+2)$
$= -3+3+12=12$
Step 3
$x = \large\frac{\Delta x}{\Delta} = \large\frac{6}{6}=1$
$y = \large\frac{\Delta y}{\Delta} = \large\frac{6}{6}=1$
$z = \large\frac{\Delta z}{\Delta} = \large\frac{12}{6}=2$
$(x,y,z) = (1,1,2)$

edited Jun 3, 2013