# Solve linear system where unknowns are functions

I have the following linear system

sys = {-96.34478324298885 a[2] + 74.93701935056998 a[3] + 67.59840434821189 a[4] - 11.426569125926502 a[5] - 34.76407132986651 a[6] == 0, -96.34478324298885 a[1] + 17.45945542572997 a[3] - 26.434983225947008 a[4] + 1.139467223903754 a[5] + 104.18084381930214 a[6] == 0, 74.93701935056998 a[1] + 17.45945542572997 a[2] - 1.6071315084553248 a[4] - 10.755469693552678 a[5] - 80.03387357429195 a[6] == 0, 67.59840434821189 a[1] - 26.434983225947008 a[2] - 1.6071315084553248 a[3] - 14.565409551545223 a[5] - 24.99088006226433 a[6] == 0, -11.426569125926502 a[1] + 1.139467223903754 a[2] - 10.755469693552678 a[3] - 14.565409551545223 a[4] + 35.60798114712065 a[6] == 0, -34.76407132986651 a[1] + 104.18084381930214 a[2] - 80.03387357429195 a[3] - 24.99088006226433 a[4] + 35.60798114712065 a[5] == 0};


where the unknowns are the functions a[1],a[2],a[3],a[4],a[5].

If I solve the system with Solve I get one solution in terms of a[3],a[4],a[5],a[6]

Solve[ sys ]
(*Output:{{a[3] -> 0. + 1.44528 a[1] - 0.445284 a[2], a[4] -> 0. - 0.742935 a[1] + 1.74293 a[2], a[5] -> 0. + 3.70336 a[1] - 2.70336 a[2], a[6] -> 0. + 0.453554 a[1] + 0.546446 a[2]}} *)


I want instead to solve this system in terms of a[1],a[2],a[3],a[4]. So, I have tried

Solve[sys,{a[1],a[2],a[3],a[4]}]
(*Output: {} *)


Why do I get empty set? The same applies with Solve[sys {a[3],a[4],a[5],a[6]}]

• Your system has the trivial solution of everything equals 0. I get this in Version12. You need a right hand side.
– Hugh
Commented May 15, 2019 at 12:10
• ?? It's an homogenous system, obviously there is this solution. However, I get non trivial solution with Solve[ sys ]  as explained in the OP Commented May 15, 2019 at 12:11
• Your words do not correspond to reality: Solve[ sys] performs {{a[1] -> 0., a[2] -> 0., a[3] -> 0., a[4] -> 0., a[5] -> 0., a[6] -> 0.}} for me. Also MatrixRank[ Table[Coefficient[sys[[i]][[1]], a[j]], {i, 1, 6}, {j, 1, 6}]] outputs 6. Commented May 15, 2019 at 13:45
• Knowing some practices of this forum, I add a screen of your question dropbox.com/s/gvkebmfcba4irga/screen12.05.19.docx?dl=0 Commented May 15, 2019 at 13:52
• Sorry @Hugh, I have copied a wrong system. I edited the question. Commented May 15, 2019 at 13:54

The Solve command allows inequivalent transforms, Reduce doesn't. In view of it

sys = {-96.34478324298885 a[2] + 74.93701935056998 a[3] +
67.59840434821189 a[4] - 11.426569125926502 a[5] -
34.76407132986651 a[6] ==  0, -96.34478324298885 a[1] + 17.45945542572997 a[3] -
26.434983225947008 a[4] + 1.139467223903754 a[5] +
104.18084381930214 a[6] == 0,74.93701935056998 a[1] + 17.45945542572997 a[2] -
1.6071315084553248 a[4] - 10.755469693552678 a[5] -
80.03387357429195 a[6] == 0,67.59840434821189 a[1] - 26.434983225947008 a[2] -
1.6071315084553248 a[3] - 14.565409551545223 a[5] -
24.99088006226433 a[6] ==
0, -11.426569125926502 a[1] + 1.139467223903754 a[2] -
10.755469693552678 a[3] - 14.565409551545223 a[4] +
35.60798114712065 a[6] ==
0, -34.76407132986651 a[1] + 104.18084381930214 a[2] -
80.03387357429195 a[3] - 24.99088006226433 a[4] +
35.60798114712065 a[5] == 0};Reduce[sys, Tabl[a[j], {j, 1, 4}]]


a[4] == 0. - 0.368172 a[5] + 1.36817 a[6] && a[3] == 0. + 0.305166 a[5] + 0.694834 a[6] && a[2] == 0. - 0.139563 a[5] + 1.13956 a[6] && a[1] == 0. + 0.168147 a[5] + 0.831853 a[6]

Not quite sure what you want. However, if you want a solution in terms of a[1],a[2],a[3],a[4] I guess you want to eliminate a[5], a[6].

Thus

Eliminate[sys, {a[5], a[6]}]


a[1] == 0. + 0.796509 a[3] + 0.203491 a[4] && a[2] == 0. + 0.339516 a[3] + 0.660484 a[4]

Is this what you need?

• The question is, why the command Solve[sys,{a[1],a[2],a[3],a[4]}] returns {}? I think I am using the syntax wrongly. If you do the following, sys2=sys/. a[1] -> a1 /. a[2] -> a2 /. a[3] -> a3 /. a[4] -> a4 /. a[5] -> a5 /. a[6] -> a6 and then Solve[sys2, {a1, a2, a3, a4, a5}] you get the answer I wanted. I don't want to pass through Replacement Rules Commented May 15, 2019 at 14:05