# Using Assumptions

*Mathematica* normally makes as few assumptions as possible about the objects you ask it to manipulate. This means that the results it gives are as general as possible. But sometimes these results are considerably more complicated than they would be if more assumptions were made.

Refine[expr,assum] | refine expr using assumptions |

Simplify[expr,assum] | simplify with assumptions |

FullSimplify[expr,assum] | full simplify with assumptions |

FunctionExpand[expr,assum] | function expand with assumptions |

Doing operations with assumptions.

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

By applying Simplify and FullSimplify with appropriate assumptions to equations and inequalities, you can in effect establish a vast range of theorems.

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

Simplify and FullSimplify always try to find the simplest forms of expressions. Sometimes, however, you may just want *Mathematica* to follow its ordinary evaluation process, but with certain assumptions made. You can do this using Refine. The way it works is that Refine[expr, assum] performs the same transformations as *Mathematica* would perform automatically if the variables in expr were replaced by numerical expressions satisfying the assumptions assum.

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

An important class of assumptions is those which assert that some object is an element of a particular domain. You can set up such assumptions using , where the character can be entered as or \[Element].

xdom or Element[x,dom] | assert that x is an element of the domain dom |

{x_{1},x_{2},...}dom | assert that all the are elements of the domain dom |

pattdom | assert that any expression which matches patt is an element of the domain dom |

Asserting that objects are elements of domains.

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |

In[15]:= |

Out[15]= |

In[16]:= |

Out[16]= |

Complexes | the domain of complex numbers |

Reals | the domain of real numbers |

Algebraics | the domain of algebraic numbers |

Rationals | the domain of rational numbers |

Integers | the domain of integers |

Primes | the domain of primes |

Booleans | the domain of Booleans (True and False) |

Domains supported by *Mathematica*.

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

*Mathematica*will automatically assume that it is real.

In[19]:= |

Out[19]= |

By using Simplify, FullSimplify, and FunctionExpand with assumptions, you can access many of *Mathematica*'s vast collection of mathematical facts.

In[20]:= |

Out[20]= |

In[21]:= |

Out[21]= |

In[22]:= |

Out[22]= |

In[23]:= |

Out[23]= |

*Mathematica* knows about discrete mathematics and number theory as well as continuous mathematics.

In[24]:= |

Out[24]= |

In[25]:= |

Out[25]= |

In something like Simplify[expr, assum] or Refine[expr, assum], you explicitly give the assumptions you want to use. But sometimes you may want to specify one set of assumptions to use in a whole collection of operations. You can do this by using Assuming.

Assuming[assum,expr] | use assumptions assum in the evaluation of expr |

$Assumptions | the default assumptions to use |

Specifying assumptions with larger scopes.

In[26]:= |

Out[26]= |

In[27]:= |

Out[27]= |

Functions like Simplify and Refine take the option Assumptions, which specifies what default assumptions they should use. By default, the setting for this option is Assumptions:>$Assumptions. The way Assuming then works is to assign a local value to $Assumptions, much as in Block.

In addition to Simplify and Refine, a number of other functions take Assumptions options, and thus can have assumptions specified for them by Assuming. Examples are FunctionExpand, Integrate, Limit, Series, and LaplaceTransform.

In[28]:= |

Out[28]= |