Next we define a
function to assign the value 10 sin x to
each x. Enter x:='x'
to make sure x is
unassigned. Then enter
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,
highlight f(1)
click the right
mouse button, and select "Approximate" > "10" from the
popup menus. Maple should make an
arrow pointing to the desired
output. (In Maple versions 11
and higher the arrow is labeled "at 10 digits".)
To
be sure that the "Approximate" menu option is clear, enter 103751/2053 and then
find a decimal approximation.
An alternate way of
forcing Maple to return a decimal approximation to f(1)
is to enter f( 1.0 )
There is another way
to define a function in Maple. Enter g(x) := 10*sin(x) Maple
will ask you if
you want this to be a "function definition" or a "remember table
assignment". If you select "function definition" it will
behave
exactly the same as before.
(If you are curious, you can select "remember table assignment".
Then enter g( 1 )
followed by g( x )
In this case the symbols g( x ) stand for the
expression, not the function.)
Let's evaluate fat π/6. First, we need to figure out how to enter π. One easy way to do this is to use the "Palettes" at the left-hand side of your Maple window. Click on the palette button which says "Common Symbols", and select π
from the grid of symbols which appears. Finally, press RETURN.
What happens? Use the popup menus to get a decimal
approximation for π.
Now find a decimal
approximation to f(π/6).
Find a decimal
approximation to each of the following: f(2) and f(π/3).