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

inconsistency in _solve_trig when it comes to CRootOf #19488

Open
gschintgen opened this issue Jun 4, 2020 · 1 comment
Open

inconsistency in _solve_trig when it comes to CRootOf #19488

gschintgen opened this issue Jun 4, 2020 · 1 comment

Comments

@gschintgen
Copy link
Contributor

In [5]: solveset(tan(x/6) - cos(x/2))
Out[5]:
⎧                ⎛       ⎛ 8      7       6      5       4      3       2             ⎞⎞        ⎫   ⎧                ⎛
⎨12⋅n⋅π + 12⋅atan⎝CRootOf⎝x  - 2⋅x  - 16⋅x  - 6⋅x  + 30⋅x  - 6⋅x  - 16⋅x  - 2⋅x + 1, 0⎠⎠ | n ∊ ℤ⎬ ∪ ⎨12⋅n⋅π + 12⋅atan⎝CRoot
⎩                                                                                               ⎭   ⎩

  ⎛ 8      7       6      5       4      3       2             ⎞⎞        ⎫
Of⎝x  - 2⋅x  - 16⋅x  - 6⋅x  + 30⋅x  - 6⋅x  - 16⋅x  - 2⋅x + 1, 1⎠⎠ | n ∊ ℤ⎬
                                                                         ⎭

_solve_trig1 catches RootOf in results and returns NotImplementedError. Such handling should also be added to _solve_trig2.

@gschintgen
Copy link
Contributor Author

Wait, I'll take that back. It's the other way round: maybe _solve_trig1 shouldn't prematurely abort if RootOf objects appear. After all, those solutions should be correct and they could still be useful. For example they could be evalf()ed by the user.
(But that requires ImageSet.evalf to work properly. See #17382)

@gschintgen gschintgen changed the title solveset(tan(x/6) - cos(x/2)) returns solution with CRootOf (bug in _solve_trig2) inconsistency in _solve_trig when it comes to CRootOf Jun 4, 2020
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

1 participant