0

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.

Rivasa
  • 1,575

1 Answers1

1

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.

Batman
  • 19,390
  • Why is -8-2h not equal to 0, because I got that far, just didn't know why it should not be equal to 0. Thanks for the help already! – Bas Jansen Feb 17 '14 at 21:19
  • A matrix is invertible if and only if its determinant is nonzero. This allows you to "pull back" the $\begin{bmatrix}-5 \ 6 \end{bmatrix}$ to a unique point $\begin{bmatrix}x \ y\end{bmatrix}$. When it is zero, you may have zero solutions or infinitely many solutions. The first case occurs in this case, since the equations are clearly inconsistent. – Batman Feb 17 '14 at 21:22