Solving Logical Combinations of Equations

When you give a list of equations to Solve, it assumes that you want all the equations to be satisfied simultaneously. It is also possible to give Solve more complicated logical combinations of equations.

Solve assumes that the equations and are simultaneously valid.
In[1]:=
Click for copyable input
Out[1]=
Here is an alternative form, using the logical connective explicitly.
In[2]:=
Click for copyable input
Out[2]=
This specifies that either or . Solve gives two solutions for , corresponding to these two possibilities.
In[3]:=
Click for copyable input
Out[3]=
Solve gives three solutions to this equation.
In[4]:=
Click for copyable input
Out[4]=
If you explicitly include the assertion that , one of the previous solutions is suppressed.
In[5]:=
Click for copyable input
Out[5]=
Here is a slightly more complicated example. Note that the precedence of is lower than the precedence of , so the equation is interpreted as , not .
In[6]:=
Click for copyable input
Out[6]=

When you use Solve, the final results you get are in the form of transformation rules. If you use Reduce or 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 .
In[7]:=
Click for copyable input
Out[7]=
This finds values of which satisfy but do not satisfy the statement representing the solutions of .
In[8]:=
Click for copyable input
Out[8]=

The logical statements produced by 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.

eqns1||eqns2union of solution sets
eqns1&&eqns2intersection of solution sets
!eqnscomplement of a solution set
Implies[eqns1,eqns2]the part of that contains

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 Implies and Or.
In[9]:=
Click for copyable input
Out[9]=
New to Mathematica? Find your learning path »
Have a question? Ask support »