5
$\begingroup$

My understanding is that Reduce gives all conditions (using or) where the input is true.

Now, $\sqrt{xy} = \sqrt x \sqrt y $, where $x,y$ are real, under the following three conditions/cases

$$ \begin{align*} x\geq 0,y\geq0\\ x\geq0,y\leq0\\ x\leq0,y\geq 0 \\ \end{align*} $$

but not when $x<0,y<0$

This is verified by doing

ClearAll[x,y]
Assuming[Element[{x,y},Reals]&&x>= 0&&y<= 0,Simplify[ Sqrt[x*y] - Sqrt[x]*Sqrt[y]]]
Assuming[Element[{x,y},Reals]&&x<= 0&&y>= 0,Simplify[ Sqrt[x*y] - Sqrt[x]*Sqrt[y]]]
Assuming[Element[{x,y},Reals]&&x<= 0&&y>= 0,Simplify[ Sqrt[x*y] - Sqrt[x]*Sqrt[y]]]
Assuming[Element[{x,y},Reals]&&x<= 0&&y<=  0,Simplify[ Sqrt[x*y] - Sqrt[x]*Sqrt[y]]]

Mathematica graphics

Then why does

 Reduce[ Sqrt[x*y] - Sqrt[x]*Sqrt[y]==0,{x,y},Reals]

Give only one of the 3 cases above?

Mathematica graphics

Is my understanding of Reduce wrong or should Reduce have given the other two cases?

V 12 on windows.

$\endgroup$
  • 1
    $\begingroup$ I think I read somewhere that specifying Reals makes it assume that subexpressions like Sqrt[x] are real too, excluding the 2 other cases. $\endgroup$ – Coolwater Jul 20 at 14:27
  • $\begingroup$ @Coolwater I read the doc before, and it says (3rd point) assumes by default that quantities appearing algebraically in inequalities are real, while all other quantities are complex but I only have x,y in there, so adding Real seems OK to me, since I want x,y to be reals? But I just tried it without using Real and it did not given me the other 2 cases, even though the answer is more complicated now. So I am confused on this, that is why I asked. $\endgroup$ – Nasser Jul 20 at 14:31
10
$\begingroup$

As Coolwater says in his comment, using the domain specification Reals means that all function values are constrained to be real. Clearly Sqrt[x] is not real when $x<0$. Instead, constrain x and y to be real using Element:

Reduce[Sqrt[x y] - Sqrt[x] Sqrt[y] == 0 && (x|y) ∈ Reals, {x,y}] //Simplify

(y ∈ Reals && x > 0) || x == 0 || (x <= 0 && y >= 0)

$\endgroup$
  • $\begingroup$ I think then the help is really a little confusing and could be better written? it clearly says assumes by default that quantities appearing algebraically in inequalities are real, while all other quantities are complex and next point it says restricts all variables and parameters to belong to the domain. This is first time I see something about functions values vs. the variable themselves. But will try to read help again few more times :) $\endgroup$ – Nasser Jul 20 at 15:27
  • 2
    $\begingroup$ @Nasser See this line of the documentation. The next line also. $\endgroup$ – Carl Woll Jul 20 at 15:42
  • $\begingroup$ To avoid complex function values, specifying the domain as Reals is equivalent to requiring that all of the arguments to Sqrt must be nonnegative. Reduce[eqn, {x, y}, Reals] == Simplify[And @@ Cases[Sqrt[x*y] == Sqrt[x]*Sqrt[y], Sqrt[z_] :> (z >= 0), Infinity]] evaluates to True $\endgroup$ – Bob Hanlon Jul 20 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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