0

I'm trying to solve the following system of equations:

gl1 = b == a - 1;
gl2 = b == 3;
Solve[{gl1, gl2}, {a}]

The solution set provided by Mathematica is empty {} - even though a -> 4 would be the correct solution.

I just reset the kernel, so I made sure that none of the variables used were already defined elsewhere.

What am I doing wrong?

Best regards Jan

2 Answers2

1

May be you are looking for:

gl1 = b == a - 1;
gl2 = b == 3;

Simplify[gl1, gl2]

or

Eliminate[{gl1, gl2}, b]

a == 4

Syed
  • 52,495
  • 4
  • 30
  • 85
0

like this?

gl1 = b == a - 1;
gl2 = b == 3;
Solve[{gl1, gl2}, {a, b}]

{{a -> 4, b -> 3}}

minhthien_2016
  • 3,347
  • 14
  • 22