# Solving a System of Equations via the Matrix Method

• EEristavi

#### EEristavi

Moved from a technical forum, so homework template missing
I have equation system:

x + y + z - a*k = 0
-b*x + y + z = 0
-c*y + z = 0
-d*x + y = 0

where: a, b, c, d = const.

Have to find: x, y, z, k

Attempt of solution:
I create Matrix A with coefficients; Matrix B - Solutions (Zeros) and Matrix X - variables.

When I try to use Cramer's rule - because of the Matrix B, I have determinant - 0.
Same Situation, if I try to inverse Matrix A and multiply with B.

Any help?

Bring all constants to the R.H.S. of the equation for each of the given equations. Then Matrix B shall not have 0's, but the constants (with proper sign). Then use Cramer's rule.

However, as you see I don't have any free constant.
Maybe I don't understand fully what you mean, can you clarify?

However, as you see I don't have any free constant.
Maybe I don't understand fully what you mean, can you clarify?
My mistake, I took ##k## to be a constant.

Matrix ##A## does have an inverse, and Matlab returned the inverse when I tried. But if I do ##A^{-1} B##, then I am getting 0's in all places, as ##B## is a null matrix.

Even if you solve without using Cramer's rule, all answers are 0.

There seems to be a problem with the question. Have you copied correctly?

Last edited:
There seems to be a problem with the question. Have you copied correctly?

Yes, This is the problem.

Actually it's not from the Algebra textbook - as an exercise;
these are the actual formulas from chemistry (Above equations were simplified):
A = k / (2.8 x + 1.2 y + 0.7 z)
B = x / ( y + z)
C = y / z
D = x / y

A, B, C, and D are the parameters which I take (as I wish) - and variables are the ratios I wish to get.

If this is chemistry not maths then you are not tied to executing some particular method, but just use what is most convenient and expeditious.
Starting with the last three equations you can very easily eliminate variables in an obvious way to get an equation involving only y and constants. I easily got that either y = 0 all there is a certain relation between B, C and D. (Which largely corresponds to other conclusions above).
Unless the latter relation embodies some stoichiometry or something, it does not sound very chemical.

• EEristavi
The only solution to your original problem is the trivial case X=0. This can be easily shown by conventional methods.
For example:
subtract -bx + y + z = 0 from x + y + z - ak = 0 to yield (1 + b) x - ak = 0 => k = x (b + 1) / a
etc...

Yes, This is the problem.

Actually it's not from the Algebra textbook - as an exercise;
these are the actual formulas from chemistry (Above equations were simplified):
A = k / (2.8 x + 1.2 y + 0.7 z)
B = x / ( y + z)
C = y / z
D = x / y

A, B, C, and D are the parameters which I take (as I wish) - and variables are the ratios I wish to get.

It looks like in the 2nd 3rd and 4th equations in the OP, you had ## b=\dfrac{1}{B}\,,\ c=\dfrac{1}{C}\,, \text{ and } d=\dfrac{1}{D} \ ## for B, C, and D above. The 1st equation of the OP does not agree with the above equation for A.

However, you have a bigger problem than that. B, C, and D are related. You can't choose them them independently.

D = x / y → ##\ y = \dfrac{1}{D}x ##

C = y / z → ##\ z = \dfrac{1}{C}y \ ## → ##\ z = \dfrac{1}{C} \cdot \dfrac{1}{D}x ##

B = x / ( y + z) → ##\ y+z = \dfrac{1}{B}x \ ## → ##\ \dfrac{1}{D}x+\dfrac{1}{C} \cdot \dfrac{1}{D}x = \dfrac{1}{B}x \ ##

What this gives is that ## \ \dfrac{1}{D}+\dfrac{1}{C} \cdot \dfrac{1}{D} = \dfrac{1}{B} \ .##

In terms of the parameters in the OP: ##\ d + cd = b \ . ##

I'm quite sure that this substitution will give a determinant of zero, but that's a good thing. This is a homogeneous system of equations. As such it has at least one solution. As @Ray Vickson points out, that solution is all zeros. Fortunately, it appears that this system has infinitely many solutions. I have not worked it out, but I expect that you can choose a value for any of the variables, x, y, or z, and then vales for the others will be determined.

Last edited:
• EEristavi
I have equation system:

x + y + z - a*k = 0
-b*x + y + z = 0
-c*y + z = 0
-d*x + y = 0

where: a, b, c, d = const.

Have to find: x, y, z, k

Attempt of solution:
I create Matrix A with coefficients; Matrix B - Solutions (Zeros) and Matrix X - variables.

When I try to use Cramer's rule - because of the Matrix B, I have determinant - 0.
Same Situation, if I try to inverse Matrix A and multiply with B.

Any help?

If $$\bf{A} = \begin{bmatrix} 1&1&1&-a\\ -b&1&1&0\\ 0 & -c & 1 & 0 \\ -d&1&0&0 \end{bmatrix}, \; \bf{0} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \end{bmatrix} \; \rm{and} \; \bf{X} = \begin{bmatrix} x \\y\\z\\k \end{bmatrix}$$ then your equations have the form ##\bf{A X} = \bf{0}.## There is a fundamental theorem that says:

Theorem: A system of equations of the form ##\bf{A u} = \bf{0}## (with an ##n \times n## matrix ##\bf{A}## and ##n##-dimensional column vectors ##\bf{u}, \bf{0}##) has the unique solution ##\bf{u} = \bf{0}## if and only if the matrix ##\bf{A}## is invertible (that is, has an inverse).

In other words, in your case ##x=y=z=k=0## is the only solution if ##\bf{A}## has an inverse (that is, has a nonzero determinant). If ##\bf{A}## does not have an inverse (that is, has a determinant equal to zero) then there are (infinitely many) non-zero solutions; those would be solutions in which not all of the variables vanish (although some still might). Whether or not the matrix has an inverse depends on the values of ##a,b,c,d##.

• EEristavi and DaveE
Thank You all for such a great help and effort.

This is why I love this society