Changing Rational Expressions into a Sum (or Difference) of Rational Expressions in Maple

95 Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

You can simply use factor to obtain a factorisation of both numerator and denominator. expand called on a rational function expands it into a sum (as opposed to calling expand on the numerator or denominator, which indeed would revert the factorisation).

So expand(factor(p/q)) gets your job done.

0
On

As @acer comented you can do that by the following codes:

[> p:=x^4+x^3-4x^2-4x: q:=x^4+x^3-x^2-x:
   convert(p/q, parfrac);

                         1-3/(2*(x-1))+3/(2*(x+1))