Message Boards Message Boards

[✓] Meaning of & in output - derivative ?

GROUPS:

Hello everyone. What is the meaning of & in output in the following code?

g[x_] := x^9
Derivative[1][g]
9 #1^8 &

Thank you for your help.

POSTED BY: Gennaro Arguzzi
Answer
7 days ago

See Pure Functions in the Wolfram Documentation

POSTED BY: Valeriu Ungureanu
Answer
7 days ago

Hi @Valeriu Ungureanu . I saw that 1 + # &[x]=1+x. Thus 1 + # =1 + # &[#]?

POSTED BY: Gennaro Arguzzi
Answer
7 days ago

Accordingly to the Wolfram Documentation:

body& - a pure function in which arguments are specified as # or #1, #2, #3, etc.

$1 + #$ is the body of pure function and the symbol $&$ marks/highlights the pure function. $#$ is an argument of pure function.

A pure function may be used as any other function with arguments specified in square brackets, so the following code seems to be correct:

1 + # &[#]

And the result is

In[1]:= 1 + # &[#]
Out[1]= 1 + #1

So,

In[2]:= 1 + # == 1 + # &[#]
Out[2]= True

i.e. the answer to your question is "Yes".

POSTED BY: Valeriu Ungureanu
Answer
7 days ago

For further syntax question, have a look at this list I compiled:

http://community.wolfram.com/groups/-/m/t/1070946

POSTED BY: Sander Huisman
Answer
7 days ago

Group Abstract Group Abstract