You can use 2 alternative ways. But, with built-in math. functions defined on R (as e.g. sin), you have to write the argument as a float number (see gkokovidis 2063 answer)
1. As an expression, while using variable assignment:
f := 2*sin(x)-x^2/(10.00); x := 5. ; f ; unassign('x') gives -4.417848549
Note: the command "unassing('x')" is just a precaution for not keeping the assigned value of 'x' fo further computations.
2. As a function: it's better for further use, as Kitonum 9667 says.
f :=x->2*sin(x)-x^2/10.00; f(5.) gives -4.417848549
whereas f(5) gives only 2*sin(5)-2.500000000.
You can see the following:
sin(5) gives sin(5); else you have to do evalf(sin(5)) to obtain the value.
whereas sin(5.) directly gives -.9589242747 ;