2
$\begingroup$

How do I force mathematica to display the below expression as a sum a+b with a scaling factor of 1/r.

(a+b)/r

I would like Mathematica to display (1/r) (a+b), ie. I want it to show 1/r as a scaling factor.

currently, it shows (a+b)/r , with r as a common denominator.

$\endgroup$
8
  • $\begingroup$ Have you tried anything ? Any code you would like to share ? $\endgroup$
    – Sektor
    Mar 7, 2015 at 12:19
  • $\begingroup$ ((a+b)/r)[[2]] ? $\endgroup$ Mar 7, 2015 at 12:25
  • 1
    $\begingroup$ Algohi, try ((2 + x)/7)[[2]] $\endgroup$
    – DavidC
    Mar 7, 2015 at 13:53
  • $\begingroup$ Coefficient[(a + b)/r, a + b]? $\endgroup$
    – kglr
    Mar 7, 2015 at 15:29
  • $\begingroup$ @DavidCarraher In this case use Hold[((2 + x)/7)][[1, 2]] $\endgroup$ Mar 7, 2015 at 18:26

2 Answers 2

3
$\begingroup$

Here is something close to what you want

expr = (a + b)/r;
expr Denominator[expr] HoldForm[1/Denominator[expr] // Evaluate]

output

$\endgroup$
0
$\begingroup$
expr = (a + b)/r
1/Denominator[expr]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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