Question: Simplifying expressions with sqrt

The problem: to simplify the expression

for any negative  x  and  y .

Below we see that Maple copes with the task brilliantly (example 1). For example, it presents  sqrt(x*y)  as  sqrt(-x)*sqrt(-y)  and so on. But the same technique, applied only to the numerator of this expression does not give the desired presentation in the form of a square (example 2 and example 3).

restart;
# Example 1
A:=(x+y-2*sqrt(x*y))/(sqrt(-x)+sqrt(-y));
simplify(A) assuming negative;
factor(%,{sqrt(-x),sqrt(-y)});

                                         

restart;
# Example 2
B:=x+y-2*sqrt(x*y);
simplify(B) assuming negative;
factor(%,{sqrt(-x),sqrt(-y)});

                                           

 

restart;
# Example 3
B:=x+y-2*sqrt(x*y);
R:=simplify(B) assuming positive;
combine(R) assuming positive;
factor(R,{sqrt(x),sqrt(y)});

                                                   

Two questions:

1. Does anyone know the reasons for this behavior.

2. Does anyone know an easy way to simplify in examples 2 and 3 (without  substitutions  like  x=+-u^2  and  y=+-v^2 and so on,  of course)

 

Download sqrt.mw

 

Please Wait...