# Reduce equations formed of symbolic matrices and vectors

I was defining the following assumptions

\$Assumptions = {A ∈ Matrices[{3, 3}, Reals],
x ∈ Vectors[3, Reals], b ∈ Vectors[3, Reals]}

Reduce[A . x == b, x]


or

Solve[A . x == b, x]


None of them is working. I was expecting something in the lines of x = Inv(A).b

• Welcome to Mathematica SE. To start: 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, since the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) consider accepting the answer, if any, that solves your problem, by clicking checkmark sign, 4) give help too, by answering questions in your areas of expertise.
– bmf
Jan 12, 2023 at 16:29
• Hint: MatrixQ[A] returns False
– bmf
Jan 12, 2023 at 16:30
• I was expecting something in the lines of x = Inv(A).b presupposes that A is non-singular.
– Syed
Jan 12, 2023 at 18:58
• Can I define A as non singular and get then the desired result. I just want to reduce equations... Jan 13, 2023 at 19:17
• I don't know of a way to restrict 3x3 matrices to the non-singular ones only. Thanks @bmf for the heads up.
– Syed
Jan 14, 2023 at 11:02

You can proceed in the following way to obtain an analytic solution, albeit not as compact as one might have hoped for.

n = 3;
amat = Array[a, {n, n}];
xvec = Array[x, n];
bvec = Array[b, n];
sltn = Solve[amat . xvec - bvec == 0, xvec] // Flatten //
FullSimplify;


And now you can check your solution

xvec /. sltn // MatrixForm


You can, also, check explicitly with the expected compact answer

LinearAlgebraPrivateZeroArrayQ[(Inverse[amat] . bvec //
FullSimplify) - (xvec /. sltn)]


• This seems overly complicated for such a simple linear equations ... where I just want a reduce of the equation Jan 12, 2023 at 16:58
• @AndreiChalapco I understand that it seems like that, but perhaps you want to have a look here and understand why I suggested the above solution :-)
– bmf
Jan 12, 2023 at 17:01