Is there a way to let sympy simplify root (-1, 3) to -1?

root(-1, 3).simplify()
(-1)**(1/3)//Output

Isn't that what I want to simplify this to -1?

+4
source share
1 answer

Try

real_root(-1, 3)

It is also mentioned in the document line of the root function.

The reason is simple: sympy, like many systems of symbolic algebra, takes into account the complex plane when calculating the "root". There are 3 complex numbers that, when increased to 3, lead to -1. If you're just interested in the root of real meaning, be as clear as possible.

+8
source

Source: https://habr.com/ru/post/1653602/


All Articles