Let a, b, c be vectors obtained with the function N and x, y be scalars. I have the equation:

Solve[a == x b + y c, {x, y}]

Since I have used N, I get an empty solution, but I know that a solution exists.

Is there any way to find some sort of approximation such that the equation is satisfied?

I don't know how to do it. but maybe a solution with an interval for x and y?

$x \pm c1$ and $y \pm c2$


closed as off-topic by Daniel Lichtblau, m_goldberg, xzczd, b3m2a1, Lukas Lang Nov 4 '18 at 12:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, b3m2a1, Lukas Lang
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ xb is not the same thing as x*b or x b. $\endgroup$ – Daniel Lichtblau Oct 21 '18 at 14:42
  • $\begingroup$ Take a loot at LeastSquares $\endgroup$ – Lukas Lang Nov 4 '18 at 12:26

This is a linear equation, and you are probably looking for a least squares solution. So,

LeastSquares[Transpose[{b, c}], a] 

should work.

To problem here is that there are either no or infinitely many (a line of) solutions.


By using Solve, you are asking Mathematica to solve for $x$ and $y$, which is not possible, as the system of equations is under defined. You can either solve for one of the unkowns

Solve[a == x b + y c, {x}]

enter image description here

or reduce the equations into simpler conditions

Reduce[a == x b + y c, {x, y}]

enter image description here


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