Not understandable error when solving polynomial equation
Hi all,
when I enter command
solve(symbolic_expression(x^12 - x^11 - 12*x^10 + 11*x^9 + 54*x^8 - 43*x^7 - 113*x^6 + 71*x^5 + 110*x^4 - 46*x^3 - 40*x^2 + 8*x + 1)==0, var(x), to_poly_solve=True)
I get the expected result, but when I enter command
solve(symbolic_expression(x^10 - 10*x^8 + 35*x^6 + x^5 - 50*x^4 - 5*x^3 + 25*x^2 + 5*x - 1), var(x), to_poly_solve=True)
I get the error message
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-203-6108bea90b72> in <module>()
----> 1 solve(symbolic_expression(x**Integer(10) - Integer(10)*x**Integer(8) + Integer(35)*x**Integer(6) + x**Integer(5) - Integer(50)*x**Integer(4) - Integer(5)*x**Integer(3) + Integer(25)*x**Integer(2) + Integer(5)*x - Integer(1)),var(x),to_poly_solve=True)
/usr/local/sage-6.4.1-x86_64-Linux/local/lib/python2.7/site-packages/sage/symbolic/relation.py in solve(f, *args, **kwds)
732 from sage.symbolic.expression import is_Expression
733 if is_Expression(f): # f is a single expression
--> 734 ans = f.solve(*args,**kwds)
735 return ans
736
/usr/local/sage-6.4.1-x86_64-Linux/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.solve (build/cythonized/sage/symbolic/expression.cpp:47061)()
/usr/local/sage-6.4.1-x86_64-Linux/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.solve (build/cythonized/sage/symbolic/expression.cpp:46887)()
TypeError: 'sage.symbolic.expression.Expression' object does not support indexing
What happened here? The error message is totally misleading (no index in the command!) and it is not to understand why the second command fails while the first works fine.
By the way, the polynomial in question has ten simple real roots, so there should be no problem to compute the roots if symbolic evaluation is not possible.
Thanks in advance Wolfgang
To display blocks of code, either indent them with 4 spaces, or select the corresponding lines and click the "code" button (the icon with '101 010'). Can you edit your question to do that?
To display inline code, surround it within "backticks" or "backquotes" `.