I'm writing a script to create quotient rule exercises, but I cannot coerce the fraction to simplify as desired. In particular, I'd like latex(sol)
to look like the following:
\frac{2x^2+4}{(x^2+1)^2}
But evaluating
(2*x+4)/(x^2+1)^2
always seems to factor the numerator to get
2*(x + 2)/(x^2 + 1)^2
and simplify_full()
seems to only expand the denominator, not the numerator:
2*(x + 2)/(x^4 + 2*x^2 + 1)