Is there a way to know that ?
Christophe.
there is a dedicated tool for obtaining polynomial roots, e.g.:
n [1]: var('x')
Out[1]: x
In [2]: f = (x - 1)**3
In [3]: roots(f, x)
Out[3]: {1: 3}
The result is a dictionary { root: multiplicity }. To get similar
behaviour to solve(), set the 'multiple' flag:
In [4]: roots(f, x, multiple=True)
Out[4]: [1, 1, 1]
Note however that solve() and roots() have different semantics. See
docstrings for details.
> f = '(x-1)**3'
btw. You don't have to enter expressions as strings.
--
Mateusz
Thanks a lot.
Christophe.