Given this expression in the symbol 'h': expression =
(16*sqrt(3)*h**3 - 36*h**2 + 9)/(6*(4*sqrt(3)*h**2 - 12*h + 3*sqrt(3)))
which simplifies to the expression: 2*h/3 + sqrt(3)/6
I can't figure out how to get sympy to do this reduction. If 'n' is the numerator and 'd' is the denominator, then
n,d = fraction(expression)
div(n,d)
gives
(2*h/3, 12*h**2 - 12*sqrt(3)*h + 9)
Adding, domain=RR, gives:
(0.666666666666667*h + 0.288675134594813, 0)
which is the floating point representation of the reduced function, but it is inexact. The presence of the sqrt(3) is the issue. Is there a way to get sympy to do this reduction and keep the sqrt(3), i.e. stay in closed form, not floating point?
Thanks,
Albert