# very simple but unexpected aspect of Function[ ]

I’ve always thought

``````(2#+1)&
``````

and

``````Function(x,2x+1)
``````

are interchangeable in common sense. But,

``````Clear(F); F(x_) := (2 # + 1) &(x^2); F(3)
(* 19 *)

Clear(F); F(a_) := Function(x, 2 x + 1)(a^2); F(3)
(* 19 *)

Clear(F); F(x_) := Function(x, 2 x + 1)(x^2); F(3)
(* Function::flpar: Parameter specification 3 in Function(3,2 3+1) should be a symbol or a list of symbols. *)
(* Function::flpar: Parameter specification 3 in Function(3,2 3+1) should be a symbol or a list of symbols. *)
(* Function(3, 2 3 + 1)(9) *)
``````

As you see, it seems mathematica provokes an error if you use same variable used in Function( ), to define a new function.

Looks mathematica wants to prevent a kind of collision of variable names. But I think such thoughtfulness is unnecessary for this case. Function(x, 2 x + 1) just represents a function that maps a thing to its double plus one. After completing interpretation of the function, we can completely forget the fact : ‘the variable used in Function( ) was x’. What do you think ?