Given $\dfrac{x^4+x^3-4x^2-4x}{x^4+x^3-x^2-x}$, is there a way to make it into a sum or difference of rationals such as:
$\dfrac{x^2}{(x-1)(x+1)}-4\dfrac{1}{(x-1)(x+1)}?$
I've tried using factor and normal but with no luck. I think the closest I've gotten to getting the desired result is with normal(p/factor(q)), where p:=x^4+x^3-4x^2-4x and q:=x^4+x^3-x^2-x. However this only gives me x^2-4/(x+1)(x-1). I think that I am on the right track in defining p and q as the numerator and denominator, respectively. Any help would be appreciated; thanks.
You can simply use
factorto obtain a factorisation of both numerator and denominator.expandcalled on a rational function expands it into a sum (as opposed to callingexpandon the numerator or denominator, which indeed would revert the factorisation).So
expand(factor(p/q))gets your job done.