有什么方法可以计算 python 中的方程式不等式吗?

is there any way to calculate inequality of equation in python?

我正在尝试使用 Sympy,但我无法通过两侧不等式。 例如 -3 < 2 *x + 1 < 5。

有什么方法可以使用 python 得到不等式的解吗?

公式-3 < 2*x + 1 < 5两个不等式简化为一个:

-3 < 2*x + 1
     2*x + 1 < 5

换句话说,这是一个你需要解决的不等式系统,使用这样的东西:

solve_rational_inequalities([[
    ((-3, Poly(2*x + 1)), '<'),
    ((Poly(2*x + 1), 5),  '<')]])