#
is a placeholder for an expression.
If you want to define a function, $y(x)=x^2$, you just could do:
f = #^2 &
The &
"pumps in" the expression into the #
sign. That is important for pairing &
and #
when you have nested functions.
f[2]
(* 4 *)
If you have a function operating on two variables, you could do:
f = #1 + #2 &
So
f[3,4]
(* 7 *)
Or you may have a function operating on a list, like:
f = #[[1]] + #[[2]] &
So:
f[{3,4}]
(* 7 *)
About Root[]
According to Mathematica help:
Root[f,k]
represents the exact kth root of the polynomial equation f[x]==0 .
So, if your polynomial is $x^2 - 1$, using what we saw above:
f = #^2 - 1 &
Root[f, 1]
(*
- 1 (* as we expected ! *)
*)
And
Root[f, 2]
(*
1 (* Thanks God ! *)
*)
But if we try with a higher order polynomial:
f = -1 - 2 #1 - #1^2 + 2 #1^3 + #1^4 &
Root[f, 1]
(*
Root[-1 - 2 #1 - #1^2 + 2 #1^3 + #1^4 &, 1]
*)
That means Mathematica doesn't know how to calculate a symbolic result for the root. It's just the first root of the polynomial. But it does know its numerical value:
N@Root[-1 - 2 #1 - #1^2 + 2 #1^3 + #1^4 &, 1]
(* -2.13224 *)
So, Root[f,k]
is a kind of stenographic writing for roots of polynomials with order > 3. I'll save you from an explanation about radicals and finding polynomial roots... for the better, I think