1.5.14 Packages for Symbolic MathematicsThere are many Mathematica packages which implement symbolic mathematical operations. This section gives a few examples drawn from the standard set of packages distributed with Mathematica. As discussed in Section 1.3.10, some copies of Mathematica may be set up so that the functions described here are automatically loaded into Mathematica if they are ever needed. Vector Analysis
| <<Calculus`VectorAnalysis` | load the vector analysis package | | SetCoordinates[system[names]] | specify the coordinate system to be used (Cartesian, Cylindrical, Spherical, etc.), giving the names of the coordinates in that system | | Grad[f] | evaluate the gradient of f in the coordinate system chosen | | Div[f] | evaluate the divergence of the list f | | Curl[f] | evaluate the curl of the list f | | Laplacian[f] | evaluate the Laplacian of f |
Vector analysis. | This loads the vector analysis package. In some versions of Mathematica, you may not need to load the package explicitly. | |
In[1]:=
<<Calculus`VectorAnalysis`
|
|
| This specifies that a spherical coordinate system with coordinate names r, theta and phi should be used. | |
In[2]:=
SetCoordinates[Spherical[r, theta, phi]]
|
Out[2]=
|
|
This evaluates the gradient of in the spherical coordinate system. | |
In[3]:=
Grad[r^2 Sin[theta]]
|
Out[3]=
|
|
Variational Methods
| <<Calculus`VariationalMethods` | load the variational methods package | | VariationalD[f, y[x], x] | find the variational derivative of f |
Variational methods. | This loads the variational methods package. | |
In[1]:=
<<Calculus`VariationalMethods`
|
|
This finds the functional derivative of . | |
In[2]:=
VariationalD[y[x] Sqrt[y'[x]], y[x], x]
|
Out[2]=
|
|
Quaternions
| <<Algebra`Quaternions` | load the quaternions package | | Quaternion[a, b, c, d] | the quaternion |
Quaternions. | This loads the quaternions package. | |
In[1]:=
<<Algebra`Quaternions`
|
|
| This finds the principal square root of a quaternion. | |
In[2]:=
Sqrt[Quaternion[1, 1, 1, 0]]
|
Out[2]=
|
|
|