Next we define a function to
assign the value 10 sin x to each x. Enter x:='x';
f:=x->10*sin(x);
and then f(1); You may be surprised to see
10 sin(1)
rather than a decimal approximation. To obtain a decimal approximation, enter evalf(10*sin(1)); The command "evalf" stands for "floating point evaluation."
To be sure that the action of
evalf is clear, enter 103751/2053; and then evalf(103751/2053);
An alternate way of forcing Maple to return a decimal approximation
to f(1) is to enter f(1.0);
Note that Maple distinguishes
between a function and an expression. Enter g(x):=10*sin(x);
Then enter g(1);
followed by g(x);
The symbols g(x) stand for the expression,
not the function.
Let's evaluate f at pi/6.
First, we need the value of pi. Enter Pi; Alter this line to read evalf(Pi); Compare this with pi;
evalf(pi)
Both "pi" symbols look the same, but only the one obtained with an upper case
"P" and a lower-case "i" carries the numerical value.
Now find a decimal approximation to f(pi/6).
Find a decimal approximation
to each of the following: f(2) and f(pi/3).