Question: on combining sqrt terms in product

all in real domain, sqrt(A)*sqrt(B) can be combined to sqrt(A*B) when both A,B are non-negative.

Is there a way in Maple to  find the conditions when sqrt(A)*sqrt(B)=sqrt(A*B) ? i.e. the conditions on A,B where this is true?

A,B will only be functions of x,y.   

An example will make things clear.

expr1:=sqrt(x^2*y - 4)*sqrt(x^2*y);
expr2:=sqrt(  (x^2*y - 4)*(x^2*y));

By looking at the above, we see that expr1 = expr2 when  x^2*y-4>=0 and x>0 or x^2*y-4>=0 and x<0. Actually I think only x^2*y-4>=0 is needed, since x is being squared anyway.

How to make Maple show this? I can't get Maple to show this

solve(expr1=expr2,[x,y]) assuming real;

But this is wrong. it says it is true for all x and all y?.   Mathematica can do it using Reduce command

I know I can force the combination by using the command


ps. Maple took the x outside the sqrt. So x>0 is assumed here.

pps. I do not understand why simplify(expr1,symbolic) did not work here, and neither  simplify(expr1,symbolic,size=false) worked. Only combine worked.

But I wanted to see if Maple could tell the condition when this is allowed, so I can write these down.

It would be nice if the command above would also tell the conditions under which it combined the sqrts. But this information is not given.

This is all done non-interactive in a program without being able to look at the screen and decide what to do. Only thing I know is that if an expression has sqrts and functions of x,y.

Is there a way in Maple to have tell conditions when expr1=expr2?

Maple 2020.2

Please Wait...