Group Abstract Group Abstract

Message Boards Message Boards

0
|
51 Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

How to divide numerator and denominator by the numerator?

Posted 1 day ago

How to divide numerator and denominator by the numerator?

in = -((8 m^2)/(3 + 10 m^2 + 3 m^4))
Numerator[in]
in /. a_/b_ -> a/Numerator[in]/(b/Numerator[in])

enter image description here

Why is there no change in the result when using the code above?

I aim to derive this expression in fractional form via identical transformation:

-(1/(5/4 + 3/(8 m^2) + (3 m^2)/8))

enter image description here

POSTED BY: Bill Blair
7 Replies
POSTED BY: Michael Rogers
Posted 55 minutes ago

Thank you for the detailed explanation! The 1/Expand[1/frac] approach is elegant and exactly what I needed. I wasn't aware that Mathematica would auto-simplify (a b)/(a c) to b/c, which explains why my direct approach failed.

POSTED BY: Updating Name
Posted 42 minutes ago
POSTED BY: Bill Blair

A couple of ways:

in = -((8 m^2)/(3 + 10 m^2 + 3 m^4));
in /. a_/b_ :>
  -DisplayForm[FractionBox[a/Numerator[in],
     Expand[-b/Numerator[in]]]]
in /. a_/b_ :>
  -Inactive[Divide][a/Numerator[in],
    -Expand[b/Numerator[in]]]
POSTED BY: Gianluca Gorni

This is one way to do it, but we must strip the formatting away if we need to reuse the result in further calculations:

in = -((8 m^2)/(3 + 10 m^2 + 3 m^4))
Numerator[in]
newForm = 
 in /. a_/b_ -> 
   DisplayForm[FractionBox[a/Numerator[in], (b/Numerator[in])]]
3*newForm
3*newForm /. {FractionBox -> Divide, 
   DisplayForm -> Identity} // Expand
POSTED BY: Gianluca Gorni
Posted 21 hours ago

I aim to derive this expression in fractional form via identical transformation:

-(1/(5/4 + 3/(8 m^2) + (3 m^2)/8))
POSTED BY: Bill Blair
Posted 1 day ago

I think it's equivalent to dividing by 1, which Mathematica simplifies:

(n/n)/(d/n) -> 1/(d/n) -> n/d

POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard