# 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
Sep 29 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. Sep 29 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
Sep 29 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. Sep 29 at 16:33

One idea is to use FunctionRange:
FunctionRange[{x y, x == 0 || y == 0}, {x, y}, z]
{"ft_lang_label":"__label__en","ft_lang_prob":0.7685299,"math_prob":0.9174058,"size":1015,"snap":"2021-43-2021-49","text_gpt3_token_len":348,"char_repetition_ratio":0.16023739,"word_repetition_ratio":0.21428572,"special_character_ratio":0.391133,"punctuation_ratio":0.16740088,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97846127,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-06T01:59:28Z\",\"WARC-Record-ID\":\"<urn:uuid:ed3d1c8f-18ce-4d68-8f48-0ef1e17e3875>\",\"Content-Length\":\"141802\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0f6c7a6f-e97e-41e3-bd98-af0f83d87559>\",\"WARC-Concurrent-To\":\"<urn:uuid:34058ddb-ecf4-4884-acef-5922f82fb5b0>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/256266/simplify-an-expression-with-assumptions-connected-with-or\",\"WARC-Payload-Digest\":\"sha1:ZEYTAY5XSXRHRKDMSWCTGZXQOF565PAQ\",\"WARC-Block-Digest\":\"sha1:TPX3CJ4SSQ6KYBWVDCHOSDP6C4S26C6Y\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964363229.84_warc_CC-MAIN-20211206012231-20211206042231-00144.warc.gz\"}"}