How to Replace[] the entire denominator?

Hi Everybody,

d1= U/((a - b - c) (a + b - c) (a - b + 
       c) (a + b + c)) /. {(a - b - c) (a + b - c) (a - b + c) (a + b + c) -> -4*S^2};

Any way to replace the entire denominator and obtain

-U/(4*S^2)

?

Thanks in advance and best regards,

César Lozada

Sometimes in Mathematica denominators are not in the form you might expect.

We can use FullForm to see how Mathematica represents your expression internally

d1= U/((a - b - c) (a + b - c) (a - b +c) (a + b + c));
FullForm[d1]

which shows us that Mathematica sees this internally in this form:

Times[
  Power[Plus[a,Times[-1,b],Times[-1,c]],-1],
  Power[Plus[a,b,Times[-1,c]],-1],
  Power[Plus[a,Times[-1,b],c],-1],
  Power[Plus[a,b,c],-1],
  U]

So, since Mathematica has this is in the form of U*stuff, here is one way you can do this

d1/.U*stuff_->U/(-4*S^2)

which returns the result that you wanted

-U/(4 S^2)

Hi Bill,

Thanks!

Your post suggests me I have to break the expression:

d1 = U/((a - b - c) (a + b - c) (a - b + c) (a + b + c));
repl = {(a - b - c) (a + b - c) (a - b + c) (a + b + c) -> -4*S^2};
num = Numerator[d1] /. repl;
den = Denominator[d1] /. repl;
d1 = num/den

And it works!!!

Output: -(U/(4 S^2))

Many thanks again,

César Lozada