why can't I compute the zeros of an integer polynomial using solve()?
This works fine, producing complex roots:
x=var('x')
f=x+x**2+x**3-100
z=solve(f==0,x)
this also works fine:
R.<x>=ZZ[]
f=x+x**2+x**3-100
f.roots()
but this seems to run forever without error message and I don't understand why:
x=var('x',domain=ZZ)
f=x+x**2+x**3-100
z=solve(f==0,x)
can anyone explain or tell me where to start reading to understand this behaviour?
Instead of
x = var('x', domain=ZZ)
, you can usez = solve(f==0, x, domain=ZZ)
. It should return an equation that it doesn't know how to solve in the integers — it will return[x==...]
.