2
$\begingroup$

I would like to simplify

(a == c && c != 0) || (a == 0 && c == 0)

to

a == c

How can I do that?

$\endgroup$

2 Answers 2

4
$\begingroup$
Reduce[(a==c&&c!=0)||(a==0&&c==0),Reals]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ Interesting. Why Reduce[(a==c&&c!=0)||(a==0&&c==0),Complexes] doesn't work? $\endgroup$
    – Cindy9
    Nov 5, 2023 at 19:41
2
$\begingroup$

Not assuming a,c \[Element] Reals,

Solve[(a == c && c != 0) || (a == 0 && c == 0), c] // FullSimplify

{{c -> a}}

and

 Solve[(a == c && c != 0) || (a == 0 && c == 0), a] // FullSimplify

{{a -> c}}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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