0
$\begingroup$

I have two equations, let's say x=a+b and a=c, and I'd like to solve it for b.

I've tried this:

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

But I get

Solve::naqs: b+c&&c is not a quantified system of equations and inequalities.

Any suggestions how to correctly do this would be appreciated.

$\endgroup$
1
  • 1
    $\begingroup$ is not a quantified system of equations That might have helped you find out that it should have been == instead of =. $\endgroup$
    – anderstood
    Nov 1, 2020 at 17:53

1 Answer 1

2
$\begingroup$

To define equations use == !

Solve[{x == a + b, a == c}, {a, b}]
(*{{a -> c, b -> -c + x}}*)
$\endgroup$
4
  • $\begingroup$ Why {a,b}? Also the output seems to be {{}}. $\endgroup$
    – Nickpick
    Nov 1, 2020 at 15:52
  • $\begingroup$ You have two equations! Perhaps Eliminate[{x == a + b, a == c}, {a}] is what you're looking for? $\endgroup$ Nov 1, 2020 at 15:56
  • $\begingroup$ That just results as 'true'. What I want as result is b=x-c $\endgroup$
    – Nickpick
    Nov 1, 2020 at 15:58
  • $\begingroup$ ok that works, had to clear all variables first. Looks like other open notebooks are somehow mixing the values together $\endgroup$
    – Nickpick
    Nov 1, 2020 at 16:02

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