1
$\begingroup$

In a comment on the answer of user JimB to Evaluate a certain three-dimensional constrained integral , I remarked

"I have a integration limit transformation rule of the form

Sqrt[(1 - 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> 1 - 2 x + Sqrt[1 - x - 2 x^2]

, which Mathematica implements finely, but I also need

Sqrt[(-1 + 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> 1 - 2 x + Sqrt[1 - x - 2 x^2]

,--note changes of sign in first Sqrt--which Mathematica immediately converts to the previous rule, so the second rule doesn't get enforced. So, I need to suppress the immediate conversion."

Any suggestions?


Correction:

The introductory remark (and earlier comment) should have read (note introduction of minus sign in the first of the second Sqrt of the second transformation, so the two transformations should yield equivalent outcomes):

"I have a integration limit transformation rule of the form

Sqrt[(1 - 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> 1 - 2 x + Sqrt[1 - x - 2 x^2]

, which Mathematica implements finely, but I also need

Sqrt[-(-1 + 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> 1 - 2 x + Sqrt[1 - x - 2 x^2]

,--note changes of sign in first Sqrt--which Mathematica immediately converts to the previous rule, so the second rule doesn't get enforced. So, I need to suppress the immediate conversion."

So, the code of Daniel Huber would now take the form

r1 = Sqrt[(1 - 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> a;r2 = Sqrt[-(-1 + 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> b;expr = Sqrt[(1 - 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] + Sqrt[-(-1 + 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])];expr /. r1;expr /. r2;expr /. {r1, r2}

yielding

2a

2b

2a

I'll have to mull over/play around with this a little more, and see if I can get the desired results. My apologies for the initial minus sign omission.

$\endgroup$
3
  • $\begingroup$ For me it does not work as described: Mma converts these two rules into two different rules as expected. $\endgroup$ Commented Sep 22, 2020 at 14:51
  • $\begingroup$ I see the point of the comment of Alexei Boulbitch--the transformation works as intended if it is directly applied--not saved as a rule for futher use. But I'm still having some trouble using it immediately repeatedly, using /. I'll keep working on it. $\endgroup$ Commented Sep 22, 2020 at 15:35
  • $\begingroup$ It seems that if I use the transformation once, it works as intended. But it seems that one use "contaminates/alters" it, and then it doesn't apply. $\endgroup$ Commented Sep 22, 2020 at 15:55

1 Answer 1

1
$\begingroup$

It seems to work in MMA 12.1:

r1 = Sqrt[(1 - 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> a;
r2 = Sqrt[(-1 + 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] -> b;
expr = Sqrt[(1 - 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])] + 
   Sqrt[(-1 + 2 x) (2 - x + 2 Sqrt[1 - x - 2 x^2])];
expr /. r1
expr /. r2
expr /. {r1, r2}

If you still have problems, please document an error case.

$\endgroup$

Your Answer

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

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