Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve: If exist an imaginary value in the solutions and we send a ineq we get False #11662

Open
latot opened this issue Sep 26, 2016 · 2 comments

Comments

@latot
Copy link
Contributor

latot commented Sep 26, 2016

Hi, well when we have a mix of eq + ineq, but the eq (or maybe too the ineq), have imaginary values (not alls) we always will get False:

>>> solve([Eq(-x**3+x-1,0), x<0])
False
the solution should be:
{x: -(3*sqrt(69)/2 + 27/2)**(1/3)/3 - 1/(3*sqrt(69)/2 + 27/2)**(1/3)}
>>> solve([Eq(-x**3+x-1,0), x>0])
False
The solutions should be:
[{x: -1/((-1/2 - sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)) - (-1/2 - sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)/3}, {x: -(-1/2 + sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)/3 - 1/((-1/2 + sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3))}]

Thx. Cya.

@Shekharrajak
Copy link
Member

In [1]: solveset(Eq(-x**3+x-1,0), x, Interval(-oo, 0))
Out[1]: ∅

In [2]: solveset(Eq(-x**3+x-1,0), x, Interval(-oo, oo))
Out[2]: 
⎧      ____________                   ⎫
⎪     ╱ 3⋅√69   27                    ⎪
⎪  3 ╱  ───── + ──                    ⎪
⎪  ╲╱     2     2            1        ⎪
⎨- ──────────────── - ────────────────⎬
⎪         3               ____________⎪
⎪                        ╱ 3⋅√69   27 ⎪
⎪                     3 ╱  ───── + ── ⎪
⎩                     ╲╱     2     2  ⎭

1st case should return ans.

@latot
Copy link
Contributor Author

latot commented Sep 27, 2016

mm, seems solveset have other issue here:

>>> solveset(Eq(-x**3+x-1,0), x, Interval(-oo, 0))
EmptySet()
>>> solveset(Eq(-x**3+x-1,0), x, Interval(0, oo))
EmptySet()
>>> solveset(Eq(-x**3+x-1,0), x, Interval(0, 0))
EmptySet()

And remember this is an example, the idea its can send more than 1 eq.
Should i open a new issue for solveset?

Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants