Go to CCP Homepage Go to Materials Page Go to Multivariable Calculus Materials Go to Table of Contents
Go Back One Page Go Forward One Page

Maple Tutor

Part 6: Functions

  1. 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".)

  2. To be sure that the "Approximate" menu option is clear, enter
    103751/2053
    and then find a decimal approximation.
  3. An alternate way of forcing Maple to return a decimal approximation to f(1) is to enter
    f( 1.0 )

  4. 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.)

  5. Let's evaluate f at π/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).

  6. Find a decimal approximation to each of the following: f(2) and f(π/3).

Go to CCP Homepage Go to Materials Page Go to Multivariable Calculus Materials Go to Table of Contents
Go Back One Page Go Forward One Page


modules at math.duke.edu Copyright CCP and the author(s), 1998, 1999, 2007