Solving a system of equations using Cramer's rule.

quikwerk

OK, I have this question here that says:

Using Cramer's rule, solve

2x-y=4
3x+y-z=10
y+z=3

I have no idea how to show my working on the board, but having gone through the working to the best of my ability I came up with the answer:
x=2.33 y=1.55 and z=0.11

I'm certain that I'm wrong, I checked using a math program, but I can't tell where I went wrong with my working.
Could I get a little help figuring out how to post my working, and then troubleshoot it?

MHF Helper

shenanigans87

Go here:

Cramer's Rule

it gives an easy to follow method of solving almost the exact problem you have.

dwsmith

MHF Hall of Honor
Cramer's Rule

$$\displaystyle x,y,z=\frac{\begin{vmatrix} a & b & c\\ d & e & f\\ g & h & i \end{vmatrix}}{\begin{vmatrix} 2 & -1 & 0\\ 3 & 1 & -1\\ 0 & 1 & 1 \end{vmatrix}}$$

For x, you replace column 1, $$\displaystyle \begin{bmatrix} a\\ d\\ g \end{bmatrix}$$, with $$\displaystyle \begin{bmatrix} 4\\ 10\\ 3 \end{bmatrix}$$ and take the determinant.

For y, you replace column 2, $$\displaystyle \begin{bmatrix} b\\ e\\ h \end{bmatrix}$$, with $$\displaystyle \begin{bmatrix} 4\\ 10\\ 3 \end{bmatrix}$$ and take the determinant.

For z, you replace column 3, $$\displaystyle \begin{bmatrix} c\\ f\\ i \end{bmatrix}$$, with $$\displaystyle \begin{bmatrix} 4\\ 10\\ 3 \end{bmatrix}$$ and take the determinant.

quikwerk

I have some familiarity with it but my book has a very poor explanation of the concept--I had to search the internet just to find out that I had to use alternating signs.

I did the working by expanding the determinants by their minors on the first row.
I will do the working again by using the main diagonal(?) method, and report the result.
I would like to try to "master"(to some degree) the minor method and fix my flawed working.
That said, how can I post said working?
I think I can use latex but I'm not sure how to make it look good.

dwsmith

MHF Hall of Honor
Expanding the determinant down column 3 will be the easiest.

$$\displaystyle \begin{vmatrix} 2 & -1 & 0\\ 3 & 1 & -1\\ 0 & 1 & 1 \end{vmatrix}\rightarrow 0*\begin{vmatrix} 3 & 1\\ 0 & 1 \end{vmatrix}-(-1)*\begin{vmatrix} 2 & -1\\ 0 & 1 \end{vmatrix}+1*\begin{vmatrix} 2 & -1\\ 3 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 0+1*(2-0)+1*(2-(-3))=7$$

Again it is best to expand by column 3.
$$\displaystyle x=\frac{\begin{vmatrix} 4 & -1 & 0\\ 10 & 1 & -1\\ 3 & 1 & 1 \end{vmatrix}}{7}\rightarrow 0*\begin{vmatrix} 10 & 1\\ 3 & 1 \end{vmatrix}-(-1)*\begin{vmatrix} 4 & -1\\ 3 & 1 \end{vmatrix}+1*\begin{vmatrix} 4 & -1\\ 10 & 1 \end{vmatrix}$$
$$\displaystyle =0+(4+3)+(4+10)=21$$

$$\displaystyle x=\frac{21}{7}=3$$

Double click the images to see how they are entered.

quikwerk

Alrighty! Here is the working I used in its unabridged form:

I started my working by defining system of equations and Determinant $$\displaystyle D$$:
$$\displaystyle 2x-y=4$$
$$\displaystyle 3x+y-z=10$$
$$\displaystyle y+z=3$$

$$\displaystyle \begin{vmatrix} 2 & -1 & 0\\ 3 & 1 & -1\\ 0 & 1 & 1 \end{vmatrix}$$

Then I defined determinants $$\displaystyle D_x$$,$$\displaystyle D_y$$ and $$\displaystyle D_z$$:

$$\displaystyle D_x$$:
$$\displaystyle \begin{vmatrix} 4 & -1 & 0\\ 10 & 1 & -1\\ 3 & 1 & 1 \end{vmatrix}$$

$$\displaystyle D_y$$:
$$\displaystyle \begin{vmatrix} 2 & 4 & -1\\ 3 & 10 & 1\\ 0 & 3 & 1 \end{vmatrix}$$

$$\displaystyle D_z$$:
$$\displaystyle \begin{vmatrix} 2 & -1 & 4\\ 3 & 1 & 10\\ 0 & 1 & 3 \end{vmatrix}$$

I expanded the determinants by their minor elements, in this instance I expanded them all about their first row elements.
I used the following template to help me remember the signs I had to use:
$$\displaystyle \begin{vmatrix} + & - & +\\ - & + & -\\ + & - & + \end{vmatrix}$$

$$\displaystyle D_x$$:
$$\displaystyle \begin{vmatrix} 4 & -1 & 0\\ 10 & 1 & -1\\ 3 & 1 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 4 \begin{vmatrix}1 & -1\\ 1 & 1 \end{vmatrix}-(-1)\begin{vmatrix}10 & -1\\ 3 & 1 \end{vmatrix}+0\begin{vmatrix}10 & 1\\ 3 & 1 \end{vmatrix}\rightarrow 4(1-(-1))-(-1)(10-(-3))+0(10-3)$$ $$\displaystyle \rightarrow 8-(-13)+0=21$$
Final value of $$\displaystyle D_x = 21$$

$$\displaystyle D_y$$:
$$\displaystyle \begin{vmatrix} 2 & 4 & -1\\ 3 & 10 & 1\\ 0 & 3 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 2 \begin{vmatrix}10 & 1\\ 3 & 1 \end{vmatrix}- 4 \begin{vmatrix}3 & 1\\ 0 & 1 \end{vmatrix}+(-1)\begin{vmatrix}3 & 10\\ 0 & 3 \end{vmatrix} \rightarrow 2(10-3)-4(3-0)+(-1)(9-0)$$ $$\displaystyle \rightarrow 14-12+(-9)=-7$$
Final value of $$\displaystyle D_y = -7$$

$$\displaystyle D_z$$:
$$\displaystyle \begin{vmatrix} 2 & -1 & 4\\ 3 & 1 & 10\\ 0 & 1 & 3 \end{vmatrix}$$ $$\displaystyle \rightarrow 2 \begin{vmatrix}3 & 10\\ 1 & 3 \end{vmatrix}- (-1) \begin{vmatrix}3 & 10\\ 0 & 3 \end{vmatrix}+ 4\begin{vmatrix}3 & 1\\ 0 & 1 \end{vmatrix} \rightarrow 2(3-10)-(-1)(9-0)+ 4(3-0)$$ $$\displaystyle \rightarrow -14-(-9)+12=-7$$
Final value of $$\displaystyle D_z=-7$$

$$\displaystyle D$$:
$$\displaystyle \begin{vmatrix} 2 & -1 & 0\\ 3 & 1 & -1\\ 0 & 1 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 2 \begin{vmatrix}1 & -1\\ 1 & 1 \end{vmatrix}- (-1) \begin{vmatrix}3 & -1\\ 0 & 3 \end{vmatrix}+ 0\begin{vmatrix}3 & 1\\ 0 & 1 \end{vmatrix} \rightarrow 2(1-(-1))-(-1)(3-0)+ 0(3-0)$$ $$\displaystyle \rightarrow 4-(-3)+0=7$$
Final value of $$\displaystyle D=7$$

(I can already see where this might be going wrong.
Interestingly enough, I find myself getting a totally different answer from the first one I worked out.)

In order to find out what the values of x, y and z are, I divided the values of their determinants by D:

$$\displaystyle x=\frac{D_x}{D}\rightarrow\frac{21}{7}=3$$
$$\displaystyle y=\frac{D_y}{D}\rightarrow\frac{-7}{7}=-1$$
$$\displaystyle z=\frac{D_z}{D}\rightarrow\frac{7}{7}=1$$

Threrefore: x=3, y=-1, z=1.

I know that the solution for y is wrong but I can't see what I did wrong.

Thank you for your help so far!

masters

MHF Helper
Alrighty! Here is the working I used in its unabridged form:

I started my working by defining system of equations and Determinant $$\displaystyle D$$:
$$\displaystyle 2x-y=4$$
$$\displaystyle 3x+y-z=10$$
$$\displaystyle y+z=3$$

$$\displaystyle \begin{vmatrix} 2 & -1 & 0\\ 3 & 1 & -1\\ 0 & 1 & 1 \end{vmatrix}$$

Then I defined determinants $$\displaystyle D_x$$,$$\displaystyle D_y$$ and $$\displaystyle D_z$$:

$$\displaystyle D_x$$:
$$\displaystyle \begin{vmatrix} 4 & -1 & 0\\ 10 & 1 & -1\\ 3 & 1 & 1 \end{vmatrix}$$

$$\displaystyle D_y$$:
$$\displaystyle \begin{vmatrix} 2 & 4 & {\color{red}-1}\\ 3 & 10 & {\color{red}1}\\ 0 & 3 & 1 \end{vmatrix}$$

$$\displaystyle D_z$$:
$$\displaystyle \begin{vmatrix} 2 & -1 & 4\\ 3 & 1 & 10\\ 0 & 1 & 3 \end{vmatrix}$$

I expanded the determinants by their minor elements, in this instance I expanded them all about their first row elements.
I used the following template to help me remember the signs I had to use:
$$\displaystyle \begin{vmatrix} + & - & +\\ - & + & -\\ + & - & + \end{vmatrix}$$

$$\displaystyle D_x$$:
$$\displaystyle \begin{vmatrix} 4 & -1 & 0\\ 10 & 1 & -1\\ 3 & 1 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 4 \begin{vmatrix}1 & -1\\ 1 & 1 \end{vmatrix}-(-1)\begin{vmatrix}10 & -1\\ 3 & 1 \end{vmatrix}+0\begin{vmatrix}10 & 1\\ 3 & 1 \end{vmatrix}\rightarrow 4(1-(-1))-(-1)(10-(-3))+0(10-3)$$ $$\displaystyle \rightarrow 8-(-13)+0=21$$
Final value of $$\displaystyle D_x = 21$$

$$\displaystyle D_y$$:
$$\displaystyle \begin{vmatrix} 2 & 4 & {\color{red}-1}\\ 3 & 10 & {\color{red}1}\\ 0 & 3 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 2 \begin{vmatrix}10 & 1\\ 3 & 1 \end{vmatrix}- 4 \begin{vmatrix}3 & 1\\ 0 & 1 \end{vmatrix}+(-1)\begin{vmatrix}3 & 10\\ 0 & 3 \end{vmatrix} \rightarrow 2(10-3)-4(3-0)+(-1)(9-0)$$ $$\displaystyle \rightarrow 14-12+(-9)=-7$$
Final value of $$\displaystyle D_y = -7$$

$$\displaystyle D_z$$:
$$\displaystyle \begin{vmatrix} 2 & -1 & 4\\ 3 & 1 & 10\\ 0 & 1 & 3 \end{vmatrix}$$ $$\displaystyle \rightarrow 2 \begin{vmatrix}3 & 10\\ 1 & 3 \end{vmatrix}- (-1) \begin{vmatrix}3 & 10\\ 0 & 3 \end{vmatrix}+ 4\begin{vmatrix}3 & 1\\ 0 & 1 \end{vmatrix} \rightarrow 2(3-10)-(-1)(9-0)+ 4(3-0)$$ $$\displaystyle \rightarrow -14-(-9)+12=-7$$
Final value of $$\displaystyle D_z=-7$$

$$\displaystyle D$$:
$$\displaystyle \begin{vmatrix} 2 & -1 & 0\\ 3 & 1 & -1\\ 0 & 1 & 1 \end{vmatrix}$$ $$\displaystyle \rightarrow 2 \begin{vmatrix}1 & -1\\ 1 & 1 \end{vmatrix}- (-1) \begin{vmatrix}3 & -1\\ 0 & 3 \end{vmatrix}+ 0\begin{vmatrix}3 & 1\\ 0 & 1 \end{vmatrix} \rightarrow 2(1-(-1))-(-1)(3-0)+ 0(3-0)$$ $$\displaystyle \rightarrow 4-(-3)+0=7$$
Final value of $$\displaystyle D=7$$

(I can already see where this might be going wrong.
Interestingly enough, I find myself getting a totally different answer from the first one I worked out.)

In order to find out what the values of x, y and z are, I divided the values of their determinants by D:

$$\displaystyle x=\frac{D_x}{D}\rightarrow\frac{21}{7}=3$$
$$\displaystyle y=\frac{D_y}{D}\rightarrow\frac{-7}{7}=-1$$
$$\displaystyle z=\frac{D_z}{D}\rightarrow\frac{7}{7}=1$$

Threrefore: x=3, y=-1, z=1.

I know that the solution for y is wrong but I can't see what I did wrong.

Thank you for your help so far!
Hi quikwerk,

The 3rd column in your $$\displaystyle D_y$$ matrix is incorrect. I highlighted the errors in red.

This should be:

$$\displaystyle D_y$$:
$$\displaystyle \begin{vmatrix} 2 & 4 & 0\\ 3 & 10 & -1\\ 0 & 3 & 1 \end{vmatrix}=14$$

quikwerk

quikwerk

Thank you so much Masters!
This stuff confuzzles the bejesus out of me, but I think I'm getting better!

Thank you all again for your help!