# Simplify an expression with assumptions connected with OR

Mathematica doesn't seem to have any problem with these commands:

Simplify[x y, x == 0 && y == 0]
Simplify[x y, x == 0 && y == 10]
Simplify[x y, x == 1 && y == 5]


But when it comes to this command:

Simplify[x y, x == 0 \[Or] y == 0]


it just returns xy back. I know that for general cases like Simplify[x y, x == 5 \[Or] y == -8] there isn't any good simplification. Even so, an output like 5y||-8x can be returned. (Please tell if there's any command to do so). But for the command Simplify[x y, x == 0 \[Or] y == 0], the result is pretty obvious which is zero.

I want to know if there's any method to get the output as zero directly. Also, I don't want an output like {0,0} doing the substitutions alternately.

Thank You.

• – Syed
Commented Sep 29, 2021 at 13:45
• @Syed I was about to add the link here in the comments. Thanks. I'm afraid this will be marked as duplicate and will get closed, but I haven't got any helpful answer for the previous question either. Commented Sep 29, 2021 at 13:46
• maybe something like: ClearAll[or]; or /: Refine[a_, or[b__]] := Or @@ (Refine[a, #] & /@ {b}); Refine[x y, or[x == 5, y == -8]]?
– kglr
Commented Sep 29, 2021 at 14:22
• @kglr Thanks. It does work but isn't there some inbuilt method which works just like your new modified Refine command? Also, ClearAll[or]; or /: Refine[a_, or[b__]] := Or @@ (Refine[a, #] & /@ {b}); Refine[x y, or[x == 0, y == -0]] returns 0||0 whereas I wanted it simplified to 0 only. Commented Sep 29, 2021 at 16:33

One idea is to use FunctionRange:
FunctionRange[{x y, x == 0 || y == 0}, {x, y}, z]