Solveeit Logo

Question

Question: How do you solve using the Gaussian elimination or gauss Jordan elimination, \(2x+y-z+2w=-6\), \(3x+...

How do you solve using the Gaussian elimination or gauss Jordan elimination, 2x+yz+2w=62x+y-z+2w=-6, 3x+4y+w=13x+4y+w=1, x+5y+2z+6w=3x+5y+2z+6w=-3, 5x+2yzw=35x+2y-z-w=3?

Explanation

Solution

Write the given equations in matrix form as [2112 3401 1526 5211 ][x y z w ]=[6 1 3 3 ]\left[ \begin{matrix} 2 & 1 & -1 & 2 \\\ 3 & 4 & 0 & 1 \\\ 1 & 5 & 2 & 6 \\\ 5 & 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -6 \\\ 1 \\\ -3 \\\ 3 \\\ \end{matrix} \right] where the first matrix in the L.H.S is formed by the coefficients of given variables, second matrix contains the variables and the matrix in the R.H.S denotes the constant terms. Using gauss elimination method, make the first three elements of the fourth row, first two elements of the third row, first element of the second row of the matrix [2112 3401 1526 5211 ]\left[ \begin{matrix} 2 & 1 & -1 & 2 \\\ 3 & 4 & 0 & 1 \\\ 1 & 5 & 2 & 6 \\\ 5 & 2 & -1 & -1 \\\ \end{matrix} \right] equal to 0 by performing several row operations. Similarly, use the same row operations in the matrix [6 1 3 3 ]\left[ \begin{matrix} -6 \\\ 1 \\\ -3 \\\ 3 \\\ \end{matrix} \right]. Finally, multiply the matrices present in the L.H.S and equate with the respective constant terms in the R.H.S to solve the equations easily.

Complete step by step answer:
Here we have been provided with four equations containing four variables and we are asked to solve the equations using the gauss elimination method or the gauss Jordan method. Here, we will apply the gauss elimination method.
2x+yz+2w=62x+y-z+2w=-6
3x+4y+w=13x+4y+w=1
x+5y+2z+6w=3x+5y+2z+6w=-3
5x+2yzw=35x+2y-z-w=3
In Gauss elimination method first we write the given equations in matrix form as shown below:
[2112 3401 1526 5211 ][x y z w ]=[6 1 3 3 ]\left[ \begin{matrix} 2 & 1 & -1 & 2 \\\ 3 & 4 & 0 & 1 \\\ 1 & 5 & 2 & 6 \\\ 5 & 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -6 \\\ 1 \\\ -3 \\\ 3 \\\ \end{matrix} \right]
Now, we have to perform several row operations such that we get first three elements of the fourth row, first two elements of the third row, first element of the second row of the matrix [2112 3401 1526 5211 ]\left[ \begin{matrix} 2 & 1 & -1 & 2 \\\ 3 & 4 & 0 & 1 \\\ 1 & 5 & 2 & 6 \\\ 5 & 2 & -1 & -1 \\\ \end{matrix} \right] equal to 0. Same row operations we need to perform in the matrix [6 1 3 3 ]\left[ \begin{matrix} -6 \\\ 1 \\\ -3 \\\ 3 \\\ \end{matrix} \right] while leaving the matrix [x y z w ]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right] as it is. Once we are done with the above process we have to multiply the matrices in the L.H.S and compare with the constant terms in the R.H.S to solve for the variables. so let us perform the row operations.
[2112 3401 1526 5211 ][x y z w ]=[6 1 3 3 ]\Rightarrow \left[ \begin{matrix} 2 & 1 & -1 & 2 \\\ 3 & 4 & 0 & 1 \\\ 1 & 5 & 2 & 6 \\\ 5 & 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -6 \\\ 1 \\\ -3 \\\ 3 \\\ \end{matrix} \right]
Interchanging the rows R1{{R}_{1}} and R3{{R}_{3}} we have,
[1526 3401 2112 5211 ][x y z w ]=[3 1 6 3 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 3 & 4 & 0 & 1 \\\ 2 & 1 & -1 & 2 \\\ 5 & 2 & -1 & -1 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 1 \\\ -6 \\\ 3 \\\ \end{matrix} \right]
Performing the row operations R2=R23R1,R3=R32R1,R4=R45R1{{R}_{2}}={{R}_{2}}-3{{R}_{1}},{{R}_{3}}={{R}_{3}}-2{{R}_{1}},{{R}_{4}}={{R}_{4}}-5{{R}_{1}} we get,
[1526 011617 09510 0231131 ][x y z w ]=[3 10 0 18 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & -11 & -6 & -17 \\\ 0 & -9 & -5 & -10 \\\ 0 & -23 & -11 & -31 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 10 \\\ 0 \\\ 18 \\\ \end{matrix} \right]
Performing the row operations R2=9R2,R3=11R3{{R}_{2}}=-9{{R}_{2}},{{R}_{3}}=11{{R}_{3}} we get,
[1526 09954153 09955110 0231131 ][x y z w ]=[3 90 0 18 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & 99 & 54 & -153 \\\ 0 & -99 & -55 & -110 \\\ 0 & -23 & -11 & -31 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ -90 \\\ 0 \\\ 18 \\\ \end{matrix} \right]
Operating R2=R2+R3{{R}_{2}}={{R}_{2}}+{{R}_{3}} and then interchanging the rows R2{{R}_{2}} and R3{{R}_{3}} we get,
[1526 09954110 00143 0231131 ][x y z w ]=[3 0 90 18 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & 99 & 54 & -110 \\\ 0 & 0 & -1 & 43 \\\ 0 & -23 & -11 & -31 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 0 \\\ -90 \\\ 18 \\\ \end{matrix} \right]
Operating R2=2311R2,R4=9R4{{R}_{2}}=\dfrac{23}{11}{{R}_{2}},{{R}_{4}}=9{{R}_{4}} we get,
[1526 0207115230 00143 020799279 ][x y z w ]=[3 0 90 162 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & -207 & -115 & -230 \\\ 0 & 0 & -1 & 43 \\\ 0 & -207 & -99 & -279 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 0 \\\ -90 \\\ 162 \\\ \end{matrix} \right]
Performing the row operation R4=R4R2{{R}_{4}}={{R}_{4}}-{{R}_{2}} we get,
[1526 0207115230 00143 001649 ][x y z w ]=[3 0 90 162 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & -207 & -115 & -230 \\\ 0 & 0 & -1 & 43 \\\ 0 & 0 & 16 & -49 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 0 \\\ -90 \\\ 162 \\\ \end{matrix} \right]
Performing the row operations R2=123R2,R3=16R3{{R}_{2}}=\dfrac{1}{23}{{R}_{2}},{{R}_{3}}=16{{R}_{3}} we get,
[1526 09510 0016688 001649 ][x y z w ]=[3 0 1440 162 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & -9 & -5 & -10 \\\ 0 & 0 & -16 & 688 \\\ 0 & 0 & 16 & -49 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 0 \\\ -1440 \\\ 162 \\\ \end{matrix} \right]
Operating R4=R4+R3{{R}_{4}}={{R}_{4}}+{{R}_{3}} we get,
[1526 09510 0016688 000639 ][x y z w ]=[3 0 1440 1278 ]\Rightarrow \left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & -9 & -5 & -10 \\\ 0 & 0 & -16 & 688 \\\ 0 & 0 & 0 & 639 \\\ \end{matrix} \right]\left[ \begin{matrix} x \\\ y \\\ z \\\ w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 0 \\\ -1440 \\\ -1278 \\\ \end{matrix} \right]
Therefore, we have made the required elements 0 so multiplying the matrices in the L.H.S and comparing with the respective constants in the matrix present in the R.H.S we get,
[x+5y+2z+6w 9y5z10w 16z+688w 639w ]=[3 0 1440 1278 ]\Rightarrow \left[ \begin{matrix} x+5y+2z+6w \\\ -9y-5z-10w \\\ -16z+688w \\\ 639w \\\ \end{matrix} \right]=\left[ \begin{matrix} -3 \\\ 0 \\\ -1440 \\\ -1278 \\\ \end{matrix} \right]
Starting with the last row we get,
639w=1278 w=2 \begin{aligned} & \Rightarrow 639w=-1278 \\\ & \Rightarrow w=-2 \\\ \end{aligned}
Substituting the third row we get,
16z+688(2)=1440 16z=64 z=4 \begin{aligned} & \Rightarrow -16z+688\left( -2 \right)=-1440 \\\ & \Rightarrow -16z=-64 \\\ & \Rightarrow z=4 \\\ \end{aligned}
Substituting the second row we get,
9y5(4)10(2)=0 y=0 \begin{aligned} & \Rightarrow -9y-5\left( 4 \right)-10\left( -2 \right)=0 \\\ & \Rightarrow y=0 \\\ \end{aligned}
Substituting the first row we get,
x+5(0)+2(4)+6(2)=3 x=1 \begin{aligned} & \Rightarrow x+5\left( 0 \right)+2\left( 4 \right)+6\left( -2 \right)=-3 \\\ & \Rightarrow x=1 \\\ \end{aligned}

Hence, the solution set is given as (x, y, z, w) = (1, 0, 4, -2).

Note: Note that here we have used the gauss elimination method to solve the question. if we have to use the gauss Jordan elimination method then we have to perform more row operations in the matrix [1526 09510 0016688 000639 ]\left[ \begin{matrix} 1 & 5 & 2 & 6 \\\ 0 & -9 & -5 & -10 \\\ 0 & 0 & -16 & 688 \\\ 0 & 0 & 0 & 639 \\\ \end{matrix} \right] and convert it into a unit matrix. Finally, we have to multiply the matrices on the L.H.S and compare with the R.H.S just like we did above.