I want to set work for my 17 year old calculus students and have access to Mathematica 7. I aim to create a worksheet with rational expressions which they will then decompose into partial fractions. The structure I want to use will rely on some partial fractions appearing on more than one question (i.e. some overlap)

So I want to speed the process of adding rational fractions...

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

which I was hoping I could resolve in Mathematica into (-26 - 7 x)/(14 + 11 x + 2 x^2) without brackets in numerator or denominator.

But alas I have work to do in every case, albeit fairly trivial.

Instead, using Together[ ... ] it yields (-26 - 7 x)/((2 + x) (7 + 2 x))

ExpandAll[%] just splits it up again, though it (horribly) multiplies the brackets in the denominators into 14 + 11 x + 2 x^2.

Surely I can add two or more rational expressions into a fully expanded rational expression in decreasing powers of x?


You can use ExpandNumerator and ExpandDenominator in conjunction with Together.

ExpandDenominator@Together[1/(2 x + 7) - 4/(x + 2)]

(* (-26 - 7 x)/(14 + 11 x + 2 x^2) *)
  • $\begingroup$ Oops, I know - corrected in original now! I pasted a different result from my original Q! Thanks for the syntax/function info. $\endgroup$ – Saxobob Jun 24 '14 at 18:17
  • $\begingroup$ @Saxobob I edited your post to make the results consistent, as this little mistake is really irrelevant for the question (and for people who might read the question in the future). Please check that it's still fine! $\endgroup$ – Szabolcs Jun 24 '14 at 18:26
  • $\begingroup$ Thanks - still quite new to StackExchange. Is there some forum / FAQ that says what the community normally posts in comments? Is a "thanks" right here normal? Is it expected that OP soon chooses an "Answer" response? $\endgroup$ – Saxobob Jun 24 '14 at 18:40
  • $\begingroup$ This is the thread on thanks comments, comments are generally quite free, but it's better not to have a long discussion. You can also try the chatroom if you like (ask me here if it doesn't give you write access because of too little reputation score). About accepting answers: if the post really answers your question, then it's good to accept it. But even then you're always free to wait for other answers before accepting one. $\endgroup$ – Szabolcs Jun 24 '14 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.