3
$\begingroup$

Given, $$\sqrt{\frac{x}{y}} + \sqrt{\frac{y}{x}}\;\; where \;\; x,y \gt 0 \;\; and \;\; x,y \in \Re \;\; (Expression \;\;1)$$

Somehow, I found that $$\sqrt{\frac{(x+y)^2}{x\cdot y}} \;\; (Expression\;\;2)$$ expression 2 is equavialent to expression 1.

My question is, is there a procedure to turn expression 1 into expression 2.

Any help is appreciated.

$\endgroup$
6
$\begingroup$

This?

FullSimplify[Sqrt[x/y]+Sqrt[y/x],x>0&&y>0]

instantly returns

(x + y)/Sqrt[x*y]

which is equivalent to your expression 2 for positive x,y.

But sometimes it is very difficult or nearly impossible to coax Mathematica into turning some expression into your desired form, there sometimes doesn't seem to be a way to express what you desire in a form that it can understand or you are trying to push it in a direction that Mathematica doesn't want to go.

$\endgroup$
2
$\begingroup$
Simplify[#, {x > 0, y > 0}] &  /@ Sqrt[expr^2]

returns the expression in the form you are looking for.

$\endgroup$
0
0
$\begingroup$

Just for the sake of sport I am adding one additional approach

Simplify[Sqrt[x/y] + Sqrt[y/x], {x > 0, y > 0}, 
 ComplexityFunction -> (Count[{#1}, Rational[1, 2], Infinity] &)]

(*  (x + y)/Sqrt[x y]  *)

Have fun!

$\endgroup$
0
$\begingroup$

The question did not explicitly ask how to do this in Mathematica, but rather for a "procedure" to establish equality of the two expressions.

Here's how: multiply the original sum $\displaystyle\sqrt{\frac{x}{y}} +\sqrt{\frac{y}{x}}$ by 1, with today 1 being the quotient $\displaystyle\frac{\sqrt{x y}}{\sqrt{x y}}$. Now distribute the numerator of that quotient over the sum ad simplify.

$\endgroup$

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