As in your previous question, the lhs()
of your inequation (x2x+1) is not a polynomial.
And the solution proposed by Sage :
sage: solve_ineq(x^2/(x+1)>=0, x)
[[x > -1]]
is correct :
These cases exhaust the possibilities for x∈R.
Now, your inequation may be meaningful if x is a non-real complex with the added constraint x2x+1∈R. This constraint can be implemented as (x^2/(x+1)).imag()==0
. Rewriting x=a+ib, we get :
sage: var("a, b", domain="real")
(a, b)
sage: solve_ineq([(x^2/(x+1)).subs(x==a+I*b).imag()==0, (x^2/(x+1)).subs(x==a+I*b)>=0], [b])
[[b == I*a, 1 != 0, 2*a == 0, 2*a + 1 != 0],
[b == 0, a + 1 != 0, a^2 + 2*a + 1 != 0, a],
[a + I*b + 1 > 0,
a + I*b != 0,
a^2 + b^2 + 2*a == 0,
a^2 + b^2 + 2*a + 1 != 0],
[b == 0, a + 1 > 0, a != 0, a^2 + 2*a + 1 != 0],
[-a - I*b - 1 > 0,
-(a + I*b)^2 > 0,
a^2 + b^2 + 2*a == 0,
a^2 + b^2 + 2*a + 1 != 0],
[b == 0, -a - 1 > 0, -a^2 > 0, a^2 + 2*a + 1 != 0]]
- The first case boils down to x=0 ;
- the second to x≠−1 (and misses the positivity constraint) ;
- the third is meaningless/impossible for a,b∈R (except for a=b=0, which it excludes) ;
- the fourth is identical to the second ;
- the fifth leads to the same conclusions than the third ;
- the sixth is impossible.
Sage's solve_ineq
can't find the solutions (if any exists) of this form. This might deserve further exploration, with more advanced techniques (think algebraic geometry...).
EDIT : In this special case, the solution set can be computed "by hand" by rewriting x2x+1 as a+ib, solving x2x+1∈R (by solving ℑ(x2x+1)=0) for b, and substituting each of these solutions to solve ℜ(x2x+1)>=0 for a :
sage: ExR=(x^2/(x+1)).subs(x==a+I*b) ; ExR
(a + I*b)^2/(a + I*b + 1)
sage: Sb=ExR.imag().factor().solve(b) ; Sb
[b == -sqrt(-a^2 - 2*a), b == sqrt(-a^2 - 2*a), b == 0]
sage: {u:solve_ineq(ExR.real().factor().subs(u)>=0, a) for u in Sb}
{b == -sqrt(-a^2 - 2*a): [[a >= 0]],
b == sqrt(-a^2 - 2*a): [[a >= 0]],
b == 0: [[a > -1]]}
Illustration :
sage: plot([ExR.real().factor().subs(u) for u in Sb], (a, -3, 3), ymin=-5, ymax=5, legend_label=["$%s$"%latex(u) for u in Sb], detect_poles="show")
Launched png viewer for Graphics object consisting of 5 graphics primitives
HTH,
This equation cannot be presented as a polynomial:
Without the polynomial ring, the solution is: