# Eliminating radicals from denominator or numerator of an expression

I need to find the limit when r2 tends to r1 of the following expression:

(K2 r1^2 + K1 r1 r2 -
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))]) /
(-K2 r1 r2 - K1 r2^2 +
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))])


For this reason I want to rationalize the numerator or denominator to see if this helps me find the limit. I am interested in using this procces because when r1 set equal to r2, the expression takes the indeterminate form of zero/zero.

Is there any method to rationalize the expression?

Also I have tried to calculate the limit, but Mathematica reports that the limit is 1. But numerically the result is another one. This different result is shown in the code and in the image. That is, evaluating

(K2 r1^2 + K1 r1 r2 -
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))]) /
(-K2 r1 r2 - K1 r2^2 +
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))]) /.
{K1 -> 20, K2 -> 30, r1 -> 0.1, r2 -> 0.10001}


gives • Please post code and not an image of code. Nov 8 '18 at 22:37
• @DanielLichtblau ¡Doned!, I have added the code and above it, the answer showed by Mathematica Nov 8 '18 at 22:41
• You indicate that you want the limit as r1 tends to r2 yet in the "counterexample" that you provide you set r1 -> 0.1, r2 -> 0.10001 which is not consistent with a limit as r1 tends to r2 Nov 8 '18 at 22:43
• Limit will need assumptions on the parameters in this case. In:= Limit[expr, r1 -> r2, Assumptions -> {K1 > 0, K2 > 0, r2 > 0}] Out= K2/K1 Nov 8 '18 at 22:48
• @BobHanlon If I interchange the limit in the sense that r2 tend to r1, the numerical limit is the same, so in the aswer I could change the code and the image. Or there is a second option that is to change in the title "r1 tend to r2" by "r2 tend to r1". I choice the second one. Making the question already consistent with the counter example. Going a little deeper if you work over the code and interchange the limit by "r1 tend to r2", the answer is 1.5008, this mean that the numerical limit is still the same. Nov 8 '18 at 22:48

Limit will need assumptions on the parameters in this case.

expr = (K2 r1^2 + K1 r1 r2 -
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 +
K1 K2 (r1^2 + r2^2))])/(-K2 r1 r2 - K1 r2^2 +
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))]);

Limit[expr, r1 -> r2, Assumptions -> {K1 > 0, K2 > 0, r2 > 0}]

(* Out= K2/K1 *)


I believe that what goes astray, in presence of parameters, is a failure to correctly assess branch cut related issues. I'm not entirely positive of that however.

The expression evaluates to -1 for r1 == r2 or in the limit. Have you previously assigned values to K1 and/or K2?

expr = (K2 r1^2 + K1 r1 r2 -
Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))])/(-K2 r1 r2 -
K1 r2^2 + Sqrt[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2))]);

expr /. r1 -> r2 // Simplify

(* -1 *)

expr /. r2 -> r1 // Simplify

(* -1 *)

Limit[expr, r1 -> r2]

(* -1 *)

Limit[expr, r2 -> r1]

(* -1 *)

• I have tried the same and the results is the same that you have. But this is not the real answer of the limit, mathematica is showing a wrong answer. To show this I added the result of a numerical limit at the end of my question. Nov 8 '18 at 22:29

If you replace the Sqrt with Surd (which gives the positive value of the square root), then the formula simplifies:

FullSimplify[(K2 r1^2 + K1 r1 r2 -
Surd[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2)),
2])/(-K2 r1 r2 - K1 r2^2 +
Surd[r1 r2 (K1^2 r1 r2 + K2^2 r1 r2 + K1 K2 (r1^2 + r2^2)), 2])] 