0

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.

  • A preliminary step is to do "long division" to get, in this case, $1$, and a fraction with the highest power in the numerator less than the highest power in the denominator... – DJohnM Sep 26 '13 at 16:12
  • 1
    expand( factor( p/q ) ) should do the trick. – m_l Sep 26 '13 at 16:20
  • @m_1: Oh wow, that works. Could you explain why? I thought that expand and factor would cancel each other out, leaving just the original p/q? Also, if you put your comment as an answer, I'll put it as best answer. :) – Sujaan Kunalan Sep 26 '13 at 16:26
  • I absolutely can't explain why that works. :D Maple works in strange ways and its functions should not be treated as mathematical operators, especially op, simplify and expand. Big parts of Maple's behaviour are actually influenced by the underlying data structures. Try checking the equality of two matrices to get an idea of what I mean. – m_l Sep 26 '13 at 16:34
  • 1
    Consider p=x^4-6*x^2-5*x and q=x^4+x^3-x^2-x as another example. Then expand(factor(p/q)) will produce a sum of three terms each with denominator (x-1)*(x+1). Would you prefer that to the sum of three terms (shorter and with different denominators) produced by instead calling convert(p/q,parfrac)? Is it central to your goal, that the denominator be common? – acer Sep 26 '13 at 16:53
  • @acer: I haven't used Maple in a while, so I'm just a bit rusty. I've just been doing some review problems, but for this question I was trying to make sure the denominators were common. – Sujaan Kunalan Sep 26 '13 at 17:06

2 Answers2

3

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))
amWhy
  • 209,954
Mikasa
  • 67,374
1

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.

m_l
  • 1,004