SymPy's main `simplify` doesn't handle this but the procedure `minpoly` (minimal polynomial having an algebraic element as a root) can be used:
from sympy import *
simplify((sqrt(108)+10)**(Integer(1)/3)-(sqrt(108)-10)**(Integer(1)/3)) # not effective 2**(1/3)*(-(-5 + 3*sqrt(3))**(1/3) + (5 + 3*sqrt(3))**(1/3))
minpoly(_) x - 2
Adding a minpoly based simplification to the general simplify procedure recently came up on their issue tracker: https://github.com/sympy/sympy/issues/19726 (there look to be open issues suggesting a more general approach using the routine `ratsimpmodprime`). (not a high school answer when I attended) On Fri, Jul 10, 2020 at 1:44 PM Henry Baker <hbaker1@pipeline.com> wrote:
True.
Now do it like a high schooler...
At 09:17 AM 7/10/2020, Simon Plouffe wrote:
Hello,
the expression is simplified in a fraction of a second (sqrt(108)+10)^(1/3)-(sqrt(108)-10)^(1/3); to 2 by Maple.
Best regards,
Simon Plouffe
Le ven. 10 juil. 2020 à 17:47, Henry Baker <hbaker1@pipeline.com> a écrit :
(sqrt(108)+10)^(1/3)-(sqrt(108)-10)^(1/3)
[I thought this was a pretty cool problem that came up on the Maxima email list.]
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun