Solving Logical Combinations of Equations

When you give a list of equations to (RefLink[Solve, paclet:ref/Solve]), it assumes that you want all the equations to be satisfied simultaneously. It is also possible to give (RefLink[Solve, paclet:ref/Solve]) more complicated logical combinations of equations.

(RefLink[Solve, paclet:ref/Solve]) assumes that the equations x+y==1 and x-y==2 are simultaneously valid:

Solve[{x+y==1,x-y==2},{x,y}]

Here is an alternative form, using the logical connective && explicitly:

Solve[x+y==1&&x-y==2,{x,y}]

This specifies that either x+y==1 or x-y==2. (RefLink[Solve, paclet:ref/Solve]) gives two solutions for x, corresponding to these two possibilities:

Solve[x+y==1||x-y==2,x]

(RefLink[Solve, paclet:ref/Solve]) gives three solutions to this equation:

Solve[x^3==x,x]

If you explicitly include the assertion that x!=0, one of the previous solutions is suppressed:

Solve[x^3==x&&x!=0,x]

Here is a slightly more complicated example. Note that the precedence of || is lower than the precedence of &&, so the equation is interpreted as (x^3==x&&x!=1)||x^2==2, not x^3==x&&(x!=1||x^2==2):

Solve[x^3==x&&x!=1||x^2==2,x]

When you use (RefLink[Solve, paclet:ref/Solve]), the final results you get are in the form of transformation rules. If you use (RefLink[Reduce, paclet:ref/Reduce]) or (RefLink[Eliminate, paclet:ref/Eliminate]), on the other hand, then your results are logical statements, which you can manipulate further.

This gives a logical statement representing the solutions of the equation x^2==x:

Reduce[x^2==x,x]

This finds values of x which satisfy x^5==x but do not satisfy the statement representing the solutions of x^2==x:

Reduce[x^5==x&&!%,x]

The logical statements produced by (RefLink[Reduce, paclet:ref/Reduce]) can be thought of as representations of the solution set for your equations. The logical connectives &&, || and so on then correspond to operations on these sets.

Operations on solution sets.

You may often find it convenient to use special notations for logical connectives, as discussed in "Operators".

The input uses special notations for (RefLink[Implies, paclet:ref/Implies]) and (RefLink[Or, paclet:ref/Or]):

Reduce[x^2==1 \[Implies] (x==1 ∨ x==-1),x]