1

I'm trying to find the roots of relatively simple polynomial expressions, programmatically.

I found solve(expr, var) returns a list of equations that satisfy expr and found that using args on this list elements will list [var, val_i] and was wondering if this is the most direct approach?

I tried allroots but I get an error "not a polynomial" for anything I tried plugging in, whether an expression or an equation (e.g. I tried var + 8; var+8 = 0; var^2 + 16 etc.).

Rax Adaam
  • 790
  • 3
  • 11
  • 2
    Try `rhs(mysolution[k])` to get the k-th value, where `mysolution` is whatever was returned by `solve`. (`rhs` = right-hand side, see also `lhs` = left-hand side.) – Robert Dodier Jan 09 '22 at 07:37
  • 1
    What was the exact input for `allroots`? When I try the examples you mentioned, I get a valid result. – Robert Dodier Jan 09 '22 at 07:38

0 Answers0