I want to define a functional E by using the property E[ E[f[x]] ] := E[f[x]] for some arbitrary function f[x]. Meaning, that I want Mathematica to evaluate every expression E[ E[f[x]] ] to E[f[x]] for all functions f[x]. How do I make this in Mathematica? I tried
E[ E[f_[x]] ] := E[f[x]]
but this gives the following error "$IterationLimit::itlim: Iteration limit of 4096 exceeded." and as output Hold[E[f[x]]]. Thanks!
Ebecause it has built-in meaning, type?Eto see this. So let me useeinstead (you can replace this by any other name that does not correspond to a symbol with built-in meaning). Then perhaps what you want ise[e[expr_]]:=e[expr]. Try typinge[e[f[x]]]now. You can also use something likeFormat[e]=Style["E",Blue]to change the way youreis printed in the notebook output. – user293787 Jul 26 '22 at 08:34