Solve the following equations by matrix method 2x+y+2z=0, 2x-y+z=10, x+3y-z=5
You asked:
Convert the system of equations \(2 x + y + 2 z = 0\), \(2 x - y + z = 10\), \(x + 3 y - z = 5\) into a matrix equation, and solve.
MathBot Answer:
Solve a system of equations using reduced row echelon form
Solutions:
$$ \begin{aligned}x = \frac{85}{13}\\y = - \frac{30}{13}\\z = - \frac{70}{13}\\\end{aligned} $$
Standard Form :
$$ \begin{aligned}2 x + 1 y + 2 z = 0\\2 x - y + 1 z = 10\\1 x + 3 y - z = 5\\\end{aligned} $$Augmented Matrix :
$$ \begin{aligned} \begin{bmatrix} &2&&1&&2&| &0 & \\ &2&&-1&&1&| &10 & \\ &1&&3&&-1&| &5 & \\ \end{bmatrix} \end{aligned} $$
Gauss Jordan Elimination:
Multiply row 1 by $(\frac{1}{2})$: $$ \left[\begin{matrix}1 & \frac{1}{2} & 1 & 0\\2 & -1 & 1 & 10\\1 & 3 & -1 & 5\end{matrix}\right] $$ Add $(-2) \cdot$ row 1 to row 2: $$ \left[\begin{matrix}1 & \frac{1}{2} & 1 & 0\\0 & -2 & -1 & 10\\1 & 3 & -1 & 5\end{matrix}\right] $$ Add $(-1) \cdot$ row 1 to row 3: $$ \left[\begin{matrix}1 & \frac{1}{2} & 1 & 0\\0 & -2 & -1 & 10\\0 & \frac{5}{2} & -2 & 5\end{matrix}\right] $$ Multiply row 2 by $(- \frac{1}{2})$: $$ \left[\begin{matrix}1 & \frac{1}{2} & 1 & 0\\0 & 1 & \frac{1}{2} & -5\\0 & \frac{5}{2} & -2 & 5\end{matrix}\right] $$ Add $(- \frac{1}{2}) \cdot$ row 2 to row 1: $$ \left[\begin{matrix}1 & 0 & \frac{3}{4} & \frac{5}{2}\\0 & 1 & \frac{1}{2} & -5\\0 & \frac{5}{2} & -2 & 5\end{matrix}\right] $$ Add $(- \frac{5}{2}) \cdot$ row 2 to row 3: $$ \left[\begin{matrix}1 & 0 & \frac{3}{4} & \frac{5}{2}\\0 & 1 & \frac{1}{2} & -5\\0 & 0 & - \frac{13}{4} & \frac{35}{2}\end{matrix}\right] $$ Multiply row 3 by $(- \frac{4}{13})$: $$ \left[\begin{matrix}1 & 0 & \frac{3}{4} & \frac{5}{2}\\0 & 1 & \frac{1}{2} & -5\\0 & 0 & 1 & - \frac{70}{13}\end{matrix}\right] $$ Add $(- \frac{3}{4}) \cdot$ row 3 to row 1: $$ \left[\begin{matrix}1 & 0 & 0 & \frac{85}{13}\\0 & 1 & \frac{1}{2} & -5\\0 & 0 & 1 & - \frac{70}{13}\end{matrix}\right] $$ Add $(- \frac{1}{2}) \cdot$ row 3 to row 2: $$ \left[\begin{matrix}1 & 0 & 0 & \frac{85}{13}\\0 & 1 & 0 & - \frac{30}{13}\\0 & 0 & 1 & - \frac{70}{13}\end{matrix}\right] $$Solution Matrix Reduced Row Echelon Form :
$$ \begin{aligned} \begin{bmatrix} &1&&0&&0&| &\frac{85}{13} & \\ &0&&1&&0&| &- \frac{30}{13} & \\ &0&&0&&1&| &- \frac{70}{13} & \\ \end{bmatrix} \end{aligned} $$
PLU Decomposition:
For any $m \times n$ matrix $A$, there exists an $m \times m$ permutation matrix $P$, $m \times m$ invertible lower triangular matrix $L$, and $m \times n$ upper triangular matrix $U$ such that $PA=LU$. The solution set of $A\boldsymbol{x}=\boldsymbol{b}$ can be computed by solving the two triangular systems $L\boldsymbol{y}=P\boldsymbol{b}$ and $U\boldsymbol{x}=\boldsymbol{y}$. These triangular systems can be solved by forward and backward substitution.
PLU Decomposition Steps:
Initialize the following matrices:$P$ := $m$ by $m$ identity matrix, where $m$ is the number of rows in $A$
$L$ := the $m$ by $m$ zero matrix
$U$ := the coefficient matrix created from the system of equations $$P= \left[\begin{matrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{matrix}\right], L= \left[\begin{matrix}0 & 0 & 0\\0 & 0 & 0\\0 & 0 & 0\end{matrix}\right], U= \left[\begin{matrix}2 & 1 & 2\\2 & -1 & 1\\1 & 3 & -1\end{matrix}\right] $$ Add $(-1) \cdot$ row 1 to row 2 in $U$, and set the entry in row 2, column 1 of $L$ to $(1)$ $$P= \left[\begin{matrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{matrix}\right], L= \left[\begin{matrix}0 & 0 & 0\\1 & 0 & 0\\0 & 0 & 0\end{matrix}\right], U= \left[\begin{matrix}2 & 1 & 2\\0 & -2 & -1\\1 & 3 & -1\end{matrix}\right] $$ Add $(- \frac{1}{2}) \cdot$ row 1 to row 3 in $U$, and set the entry in row 3, column 1 of $L$ to $(\frac{1}{2})$ $$P= \left[\begin{matrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{matrix}\right], L= \left[\begin{matrix}0 & 0 & 0\\1 & 0 & 0\\\frac{1}{2} & 0 & 0\end{matrix}\right], U= \left[\begin{matrix}2 & 1 & 2\\0 & -2 & -1\\0 & \frac{5}{2} & -2\end{matrix}\right] $$ Add $(\frac{5}{4}) \cdot$ row 2 to row 3 in $U$, and set the entry in row 3, column 2 of $L$ to $(- \frac{5}{4})$ $$P= \left[\begin{matrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{matrix}\right], L= \left[\begin{matrix}0 & 0 & 0\\1 & 0 & 0\\\frac{1}{2} & - \frac{5}{4} & 0\end{matrix}\right], U= \left[\begin{matrix}2 & 1 & 2\\0 & -2 & -1\\0 & 0 & - \frac{13}{4}\end{matrix}\right] $$ Once $U$ is upper triangular, add the identity matrix to $L$, and set $P$ equal to $P^T$. $$P= \left[\begin{matrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{matrix}\right], L= \left[\begin{matrix}1 & 0 & 0\\1 & 1 & 0\\\frac{1}{2} & - \frac{5}{4} & 1\end{matrix}\right], U= \left[\begin{matrix}2 & 1 & 2\\0 & -2 & -1\\0 & 0 & - \frac{13}{4}\end{matrix}\right] $$
Solving the System of Equations Using the PLU Decomposition
First, solve for $\boldsymbol{y}$ in: $L\boldsymbol{y} = P\boldsymbol{b}$, where $\boldsymbol{b}$ is
the rightmost column of the augmented matrix of the original system of equations.
$$ \left[\begin{matrix}1 & 0 & 0\\1 & 1 & 0\\\frac{1}{2} & - \frac{5}{4} & 1\end{matrix}\right] \boldsymbol{y} = \left[\begin{matrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{matrix}\right] \left[\begin{matrix}0\\10\\5\end{matrix}\right]$$
$$ \left[\begin{matrix}1 & 0 & 0\\1 & 1 & 0\\\frac{1}{2} & - \frac{5}{4} & 1\end{matrix}\right] \boldsymbol{y} = \left[\begin{matrix}0\\10\\5\end{matrix}\right]$$
A matrix equation of this form, where $L$ is lower triangular, can be solved by forward
substitution.
In forward substitution, the solutions from the equations constructed
from each row are substituted into the subsequent rows, starting from the top.
First, solve the equation from row 1, with a single unknown:
$$ y_{1} = 0 $$
Its solution is:
$$ y_{1} = 0 $$
Next, solve the equation from row 2:
$$ 1 y_{1} + 1 y_{2} = 10 $$
$$ y_{2} + 0 = 10 $$
We substituted previously computed values to create an equation with a single unknown, with the solution:
$$ y_{2} = 10 $$
Next, solve the equation from row 3:
$$ \frac{y_{1}}{2} - \frac{5 y_{2}}{4} + 1 y_{3} = 5 $$
$$ y_{3} - \frac{25}{2} + 0 = 5 $$
We substituted previously computed values to create an equation with a single unknown, with the solution:
$$ y_{3} = \frac{35}{2} $$
After performing forward substitution, we find that
$\boldsymbol{y} = \left[\begin{matrix}0\\10\\\frac{35}{2}\end{matrix}\right]$
Next, solve for $\boldsymbol{x}$ in: $U\boldsymbol{x} = \boldsymbol{y}$.
$$ \left[\begin{matrix}2 & 1 & 2\\0 & -2 & -1\\0 & 0 & - \frac{13}{4}\end{matrix}\right] \boldsymbol{x} = \left[\begin{matrix}0\\10\\\frac{35}{2}\end{matrix}\right]$$
A matrix equation of this form, where $U$ is upper triangular, can be solved by backward
substitution.
In backward substitution, the solutions from the equations constructed
from each row are substituted into the previous rows, starting from the bottom.
First, solve the equation from the last row, with a single unknown:
$$ - \frac{13 x_{3}}{4} = \frac{35}{2} $$
Its solution is:
$$ x_{3} = - \frac{70}{13} $$
Next, solve the equation from row 2:
$$ - 2 x_{2} - x_{3} = 10 $$
$$ - (2 x_{2} - \frac{70}{13}) = 10 $$
We substituted previously computed values to create an equation with a single unknown, with the solution:
$$ x_{2} = - \frac{30}{13} $$
Next, solve the equation from row 1:
$$ 2 x_{1} + 1 x_{2} + 2 x_{3} = 0 $$
$$ - (- 2 x_{1} + \frac{30}{13} + \frac{140}{13}) = 0 $$
We substituted previously computed values to create an equation with a single unknown, with the solution:
$$ x_{1} = \frac{85}{13} $$
After performing backward substitution, we find that our solution vector
$\boldsymbol{x} = \left[\begin{matrix}\frac{85}{13}\\- \frac{30}{13}\\- \frac{70}{13}\end{matrix}\right]$