I was looking for general solutions of an equation I already solved for specific values with LinearSolve, but using Reduce returned False.

Here's the code:

B = {{c, 1}, {c, d}, {1, c}};
v = {1, 1, 2};
Reduce[B.x == v, {c, d}, Reals]

This returned False

The case I solved was:

d = 1;
c = 2;
LinearSolve[B, v]

This returned {0, 1}

What am I doing wrong? Thanks for your help :)

  • 2
    $\begingroup$ Try Reduce[B.{x, y} == v, {x, y}, Reals]. $\endgroup$ – Henrik Schumacher Mar 13 '19 at 13:27
  • 2
    $\begingroup$ Technically, you should be doing LeastSquares[{{c, 1}, {c, d}, {1, c}}, {1, 1, 2}]. $\endgroup$ – J. M.'s technical difficulties Mar 13 '19 at 13:29
  • 3
    $\begingroup$ To make that explicit, you can't use a symbolic vector in Reduce (x in your example). Write the components. $\endgroup$ – Szabolcs Mar 13 '19 at 13:30
  • $\begingroup$ Writing x as a vector {x,y} did the trick, thank you all! $\endgroup$ – Lorad Mar 13 '19 at 13:42
  • $\begingroup$ @Lorad, would you write that up as an answer to your question? Self-answers are encouraged here, and it would help to have this question show up as answered if anybody else in the future might run across it. $\endgroup$ – MarcoB Mar 13 '19 at 17:45

Thanks to the comments I realized my mistake and was able to solve it quite easily. My mistake was that I put an x as placeholder for a 2-dimensional vector, but mathematica interprets that as just a variable. If I write {x,y} instead of x, mathematica can solve the equation.

Reduce[B.{x, y} == v, {c, d}, Reals]
| improve this answer | |

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