Say I have a function
f[x_]:=a x + b.
Now I want to get the
a x + b part from the function to use in e.g.
This without using
Unevaluated in the definition of
That is, I want the function
In := f[x_]:=a x + b StringForm["f(x)=``",ExpandOnce[f]] Out:= f(x)=a x + b
The above could work by using the
Definition command, but that also includes the left hand side of the definition. It would also be great if it's not restricted to only definitions, but also any variable that holds an expression. E.g.
Any help appreciated.
I would expect this to be somewhere in this forum, but I've only found nuances of this.