Deliberately simplifying fractional exponents
问题 I have an expression involving fractional exponents that I want to make into a polynomial recognisable to sympy for solution. I could, if necessary, write the exponents using Rational but can't make that work. What can I do? >>> from sympy import * >>> var('d x') (d, x) >>> (0.125567*(d + 0.04) - d**2.25*(2.51327*d + 6.72929)).subs(d,x**4) 0.125567*x**4 - (2.51327*x**4 + 6.72929)*(x**4)**2.25 + 0.00502268 回答1: SymPy does not combine exponents unless it knows it is safe to do so. For complex