Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I beg to differ with the commenters.

Staying at high-school level, your system boils down to a system of three linear equations with nine unknowns. It has therefore a sextuple infinity of solutions. And sage knows that :

A=[]
B=[]
X=[]
for u in (1..3):    
    X.append(var("x_{}".format(u), latex_name="x_{{{}}}".format(u)))
    B.append(var("b_{}".format(u), latex_name="x_{{{}}}".format(u)))
    for v in (1..3):
        A.append(var("a_{}_{}".format(u,v),
                     latex_name="a_{{{},{}}}".format(u,v)))
A=matrix(entries=A,nrows=3)
B=vector(B)
X=vector(X)
S=[B[u]==(A*X)[u] for u in range(3)]
Sol=solve(S,[u for u in A.variables()])
Sol
[[a_1_1 == -(r24*x_2 + r21*x_3 - b_1)/x_1, a_1_2 == r24, a_1_3 == r21, a_2_1 == -(r23*x_2 + r22*x_3 - b_2)/x_1, a_2_2 == r23, a_2_3 == r22, a_3_1 == -(r20*x_2 + r19*x_3 - b_3)/x_1, a_3_2 == r20, a_3_3 == r19]]

Or, more clearly, the only solution is:

$${a_{1,1}} = -\frac{r_{24} {x_{2}} + r_{21} {x_{3}} - {x_{1}}}{{x_{1}}}$$', '$${a_{1,2}} = r_{24}$$', '$${a_{1,3}} = r_{21}$$', '$${a_{2,1}} = -\frac{r_{23} {x_{2}} + r_{22} {x_{3}} - {x_{2}}}{{x_{1}}}$$', '$${a_{2,2}} = r_{23}$$', '$${a_{2,3}} = r_{22}$$', '$${a_{3,1}} = -\frac{r_{20} {x_{2}} + r_{19} {x_{3}} - {x_{3}}}{{x_{1}}}$$', '$${a_{3,2}} = r_{20}$$', '$${a_{3,3}} = r_{19}$$'

In other words, your solution is a vector space of dimension six. This means that you could pick six of the elements of your and sole for the three last. For example:

solve(S,[a_1_1, a_2_2, a_3_3])
[[a_1_1 == -(a_1_2*x_2 + a_1_3*x_3 - b_1)/x_1, a_2_2 == -(a_2_1*x_1 + a_2_3*x_3 - b_2)/x_2, a_3_3 == -(a_3_1*x_1 + a_3_2*x_2 - b_3)/x_3]]

'$${a_{1,1}} = -\frac{{a_{1,2}} {x_{2}} + {a_{1,3}} {x_{3}} - {x_{1}}}{{x_{1}}}$$', '$${a_{2,2}} = -\frac{{a_{2,1}} {x_{1}} + {a_{2,3}} {x_{3}} - {x_{2}}}{{x_{2}}}$$', '$${a_{3,3}} = -\frac{{a_{3,1}} {x_{1}} + {a_{3,2}} {x_{2}} - {x_{3}}}{{x_{3}}}$$'

Sage has other, higher level, methods for solving this kind of linear algebra problems, whose discovery is left to the reader as an exercise ;-).