Working with Operators

You can think of an expression like as being formed by applying an operator f to the expression x. You can think of an expression like as the result of composing the operators f and g, and applying the result to x.

Composition[f,g,...]the composition of functions f, g, ...
InverseFunction[f]the inverse of a function f
Identitythe identity function

Some functional operations.

This represents the composition of the functions f, g, and .
In[1]:=
Click for copyable input
Out[1]=
You can manipulate compositions of functions symbolically.
In[2]:=
Click for copyable input
Out[2]=
The composition is evaluated explicitly when you supply a specific argument.
In[3]:=
Click for copyable input
Out[3]=

You can get the sum of two expressions in Mathematica just by typing . Sometimes it is also worthwhile to consider performing operations like addition on operators.

You can think of this as containing a sum of two operators and .
In[4]:=
Click for copyable input
Out[4]=
Using Through, you can convert the expression to a more explicit form.
In[5]:=
Click for copyable input
Out[5]=
This corresponds to the mathematical operator .
In[6]:=
Click for copyable input
Out[6]=
Mathematica does not automatically apply the separate pieces of the operator to an expression.
In[7]:=
Click for copyable input
Out[7]=
You can use Through to apply the operator.
In[8]:=
Click for copyable input
Out[8]=
Identity[expr]the identity function
Through[p[f1,f2][x],q]give if p is the same as q
Operate[p,f[x]]give
Operate[p,f[x],n]apply p at level n in f
MapAll[p,expr,Heads->True]apply p to all parts of expr, including heads

Operations for working with operators.

This has a complicated expression as a head.
In[9]:=
Click for copyable input
Out[9]=
Functions like Expand do not automatically go inside heads of expressions.
In[10]:=
Click for copyable input
Out[10]=
With the Heads option set to True, MapAll goes inside heads.
In[11]:=
Click for copyable input
Out[11]=
The replacement operator does go inside heads of expressions.
In[12]:=
Click for copyable input
Out[12]=
You can use Operate to apply a function specifically to the head of an expression.
In[13]:=
Click for copyable input
Out[13]=
New to Mathematica? Find your learning path »
Have a question? Ask support »