This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
 MATHEMATICA TUTORIAL Related Tutorials »| Functions »

# Expressions with Heads That Are Not Symbols

In most cases, you want the head f of a Mathematica expression like to be a single symbol. There are, however, some important applications of heads that are not symbols.
This expression has as a head. You can use heads like this to represent "indexed functions".
 Out[1]=
You can use any expression as a head. Remember to put in the necessary parentheses.
 Out[2]=
One case where we have already encountered the use of complicated expressions as heads is in working with pure functions in "Pure Functions". By giving Function as the head of an expression, you specify a function of the arguments to be evaluated.
With the head Function, the value of the expression is the square of the argument.
 Out[3]=
There are several constructs in Mathematica which work much like pure functions, but which represent specific kinds of functions, typically numerical ones. In all cases, the basic mechanism involves giving a head which contains complete information about the function you want to use.
 Function[vars,body][args] pure function InterpolatingFunction[data][args] approximate numerical function (generated by Interpolation and NDSolve) CompiledFunction[data][args] compiled numerical function (generated by Compile) LinearSolveFunction[data][vec] matrix solution function (generated by LinearSolve)

Some expressions which have heads that are not symbols.

NDSolve returns a list of rules that give as an InterpolatingFunction object.
 Out[4]=
Here is the InterpolatingFunction object.
 Out[5]=
You can use the InterpolatingFunction object as a head to get numerical approximations to values of the function .
 Out[6]=
Another important use of more complicated expressions as heads is in implementing functionals and functional operators in mathematics.
As one example, consider the operation of differentiation. As discussed in "The Representation of Derivatives", an expression like represents a derivative function, obtained from by applying a functional operator to it. In Mathematica, is represented as Derivative[1][f]: the "functional operator" Derivative is applied to to give another function, represented as .
This expression has a head which represents the application of the "functional operator" Derivative to the "function" .
 Out[7]//FullForm=
You can replace the head with another head, such as . This effectively takes to be a "derivative function" obtained from .
 Out[8]=