There are several ways to define functions in Maple.
For mathematical functions the most straight forward way is using the -> operator. For example
f:= x -> x^2
will define the function
f(x)=x^2 in Maple. You can then call this function using something like
If you have more than one variable you can declare them by surrounding them in brackets before the arrow.
f:= (x,y) -> x + y;
This will define the function
If you are looking to define programmatic functions (such as you would in another programming language), see the example below:
This will define the function f with two arguments (like
f(x,y)) and return the result given in the return statement.
For more information please see these help pages: