0

If I want to solve two or more inequalities in the same input like those ones:

solve((x-1)<8,x)

solve((x-1)<15,x)

I would like to have the two solution all together. But in the output I have only the solution of the last inequality.

How to create a vector of inequalities as in put and a vector of solution as output?

HallaSurvivor
  • 38,115
  • 4
  • 46
  • 87
ryuk
  • 103
  • Are you saying that you want to simultaneously solve these systems? That is, you want to view these two inequalities as one system? Or are you saying that you want to solve multiple systems simultaneously. That is, you want to run one command that does the same thing as running both of the commands you gave? – HallaSurvivor Jun 21 '22 at 22:18
  • Sorry for my bad english. I would like to solve two inequalities or more simultaneously – ryuk Jun 21 '22 at 22:23
  • Your english is fine! This is the kind of ambiguity that happens all the time ^_^. Thanks for clarifying – HallaSurvivor Jun 21 '22 at 22:25

1 Answers1

1

If you add multiple variables, then you can solve separate inequalities with one call to solve. For your example:

sage: x,y = var('x,y')
sage: solve([x-1 < 8, y-1 < 15], x, y) # solve the list of inequalities for x and y
[[x < 9, y < 16]]

I hope this helps ^_^

HallaSurvivor
  • 38,115
  • 4
  • 46
  • 87