I have a system of equations as follows:
$$1x + hy = -5$$
$$2x - 8y = 6$$
My question is how do I work with such a variable in a matrix? Thank you.
I have a system of equations as follows:
$$1x + hy = -5$$
$$2x - 8y = 6$$
My question is how do I work with such a variable in a matrix? Thank you.
You can write the system as $\begin{bmatrix} 1&h \\ 2&-8\\ \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} -5 \\ 6 \end{bmatrix}$
Then, when $\begin{bmatrix} 1&h \\ 2&-8\\ \end{bmatrix} $ is invertible ($det(\begin{bmatrix} 1&h \\ 2&-8\\ \end{bmatrix} ) = -8-2h \neq 0$), you can invert the matrix and left multiply both sides by it (the inverse of a $2 \times 2$ matrix is well known). This gives you $\begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} 1&h \\ 2&-8\\ \end{bmatrix}^{-1} \begin{bmatrix} -5 \\ 6 \end{bmatrix}$.
In the case where $det(\begin{bmatrix} 1&h \\ 2&-8\\ \end{bmatrix} ) =0$, the equations are inconsistent (the left hand side of the first equation is half of the left hand side of the second equation, and the right hand sides do not follow this) and there is no solution.
For reference, $\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \frac{1}{ad-bc} \begin{bmatrix} d & -c \\ -b & a \end{bmatrix}$.
Alternatively, you can consider it as an augmented system of equations $\begin{bmatrix} 1 & h & | & -5\\ 2 & -8 &| & 6 \end{bmatrix}$ and apply Gaussian Elimination.
If you don't have to use matrices, you can just solve one equation for $x$ or $y$, plug it into the other, solve for the other variable (in terms of $h$) , then plug that back into either equation and solve for the remaining variable.