Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Defining Variables and Functions > Attributes >

Constant

Constant
is an attribute which indicates zero derivative of a symbol with respect to all parameters.
  • Functions f[...] are taken to have zero total derivative if f has attribute Constant.
  • Mathematical constants such as Pi have attribute Constant.
Pi is a mathematical constant representing a number:
Pi is not explicitly a number:
Pi is numeric and evaluates to a number with N:
Define f to be a constant function for total derivatives computed with Dt:
Pi is a mathematical constant representing a number:
In[1]:=
Click for copyable input
Out[1]=
Pi is not explicitly a number:
In[2]:=
Click for copyable input
Out[2]=
Pi is numeric and evaluates to a number with N:
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
 
Define f to be a constant function for total derivatives computed with Dt:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
The built-in system mathematical constants:
They are all NumericQ:
They all represent exact values that can be evaluated to numbers of any precision with N:
Define f locally to be a constant function:
This does not affect subsequent computations with Dt:
Using the Constants option in Dt is similar, but has completely unambiguous output:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team