Solveeit Logo

Question

Question: How do you solve by Gaussian elimination \(2x-y+z=6\) , \(x+2y-z=1\) and \(2x-y-z=0\)?...

How do you solve by Gaussian elimination 2xy+z=62x-y+z=6 , x+2yz=1x+2y-z=1 and 2xyz=02x-y-z=0?

Explanation

Solution

Now first we will write the equation in the matrix form AX = B. Now we will continuously perform row transformation in the equation till we get A as an identity matrix. Now once we have A as an identity matrix we can easily find the solution by multiplying the matrix.

Complete step by step solution:
Now we are given with three linear equations in 3 variables. We want to find the solution of the equation. Hence we want to find the values of x, y and z such that they satisfy all the equations.
Now to solve the linear equation we will use the Gaussian elimination method.
Now let us first understand what Gaussian elimination method is.
In this method we first represent the linear equation in Matrices form which is AX = B.
Now we will perform elementary row transformation till we get A as an identity matrix. Now using this matrix we can easily find the values of variables.
Now let us first write the corresponding Matrices and write the equation in Matrix form. Hence we get,

2 & -1 & 1 \\\ 1 & 2 & -1 \\\ 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} 6 \\\ 1 \\\ 0 \\\ \end{matrix} \right]$$ Now first we will use the row transformation ${{R}_{1}}\to \dfrac{{{R}_{1}}}{2}$ which is row 1 divided by 2. Hence we get the equation as, $$\Rightarrow \left[ \begin{matrix} 1 & \dfrac{-1}{2} & \dfrac{1}{2} \\\ 1 & 2 & -1 \\\ 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} 3 \\\ 1 \\\ 0 \\\ \end{matrix} \right]$$ Now we will perform ${{R}_{2}}\to {{R}_{2}}-{{R}_{1}}$ which is subtract row 1 from row 2. $\Rightarrow \left[ \begin{matrix} 1 & \dfrac{-1}{2} & \dfrac{1}{2} \\\ 0 & \dfrac{5}{2} & -\dfrac{3}{2} \\\ 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} 3 \\\ -2 \\\ 0 \\\ \end{matrix} \right]$ Now again we will use the row transformation ${{R}_{3}}\to {{R}_{3}}-2{{R}_{1}}$ which is row 3 – $2\times \text{row 1}$. Hence we get, $\Rightarrow \left[ \begin{matrix} 1 & \dfrac{-1}{2} & \dfrac{1}{2} \\\ 0 & \dfrac{5}{2} & -\dfrac{3}{2} \\\ 0 & 0 & -2 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} 3 \\\ -2 \\\ -6 \\\ \end{matrix} \right]$ Now using ${{R}_{2}}=\dfrac{{{R}_{2}}}{\dfrac{5}{2}}$ we get, $\Rightarrow \left[ \begin{matrix} 1 & \dfrac{-1}{2} & \dfrac{1}{2} \\\ 0 & 1 & -\dfrac{3}{5} \\\ 0 & 0 & -2 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} 3 \\\ -\dfrac{4}{5} \\\ -6 \\\ \end{matrix} \right]$ Now we will use the row transformation $${{R}_{1}}\to {{R}_{1}}+\dfrac{1}{2}{{R}_{2}}$$, ${{R}_{3}}=\dfrac{{{R}_{3}}}{-2}$ . Hence we get, $\Rightarrow \left[ \begin{matrix} 1 & 0 & \dfrac{1}{5} \\\ 0 & 1 & -\dfrac{3}{5} \\\ 0 & 0 & 1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} \dfrac{13}{5} \\\ -\dfrac{4}{5} \\\ 3 \\\ \end{matrix} \right]$ Now using the row transformation ${{R}_{1}}={{R}_{1}}-\dfrac{{{R}_{3}}}{5}$ and ${{R}_{2}}={{R}_{2}}+\dfrac{3{{R}_{3}}}{5}$ we get, $\Rightarrow \left[ \begin{matrix} 1 & 0 & 0 \\\ 0 & 1 & 0 \\\ 0 & 0 & 1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ \end{matrix} \right]=\left[ \begin{matrix} 2 \\\ 1 \\\ 3 \\\ \end{matrix} \right]$ **Hence we get, x = 2, y = 1 and z = 3.** **Note:** Now note that while converting the matrix into identity matrix always try to first convert the matrix into upper triangular matrix. Then make all the diagonal elements as 1. Now we can use the diagonal elements to make the rest element as 0.