2
$\begingroup$

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

$\endgroup$
6
  • $\begingroup$ 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. $\endgroup$
    – bmf
    Jan 12, 2023 at 16:29
  • $\begingroup$ Hint: MatrixQ[A] returns False $\endgroup$
    – bmf
    Jan 12, 2023 at 16:30
  • 2
    $\begingroup$ I was expecting something in the lines of x = Inv(A).b presupposes that A is non-singular. $\endgroup$
    – Syed
    Jan 12, 2023 at 18:58
  • $\begingroup$ Can I define A as non singular and get then the desired result. I just want to reduce equations... $\endgroup$ Jan 13, 2023 at 19:17
  • 1
    $\begingroup$ I don't know of a way to restrict 3x3 matrices to the non-singular ones only. Thanks @bmf for the heads up. $\endgroup$
    – Syed
    Jan 14, 2023 at 11:02

1 Answer 1

1
$\begingroup$

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

mat

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

LinearAlgebra`Private`ZeroArrayQ[(Inverse[amat] . bvec // 
    FullSimplify) - (xvec /. sltn)]

true

$\endgroup$
2
  • $\begingroup$ This seems overly complicated for such a simple linear equations ... where I just want a reduce of the equation $\endgroup$ Jan 12, 2023 at 16:58
  • $\begingroup$ @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 :-) $\endgroup$
    – bmf
    Jan 12, 2023 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.