MATH 133 -- Intensive Calculus for Science 1

First Maple Examples

October 11, 2001

Maple is an integrated graphical, symbolic, and numerical package

for mathematical computations. If you take more mathematics

courses at Holy Cross, you will probably use it for computations in

a number of different subjects -- the capabilities of this program

are really amazing.

In this class, we will mostly use Maple to analyze various functions

defined by formulas, plot them and their derivatives, solve equations,

etc. Here are some first examples showing basic features of

- defining functions

- plotting single and multiple function graphs

- computing derivatives

1) To define a function by a name like our f( x ) notation,

in Maple, we enter and execute a command like this one,

which defines the function f(x) = tan(sin(x^2))

> f:=x->tan(sin(x^2));

f := proc (x) options operator, arrow; tan(sin(x^2)...

Note the caret sign for powers. The other operations are written

+,-,*,/ . The asterisk * for multiplication can never be omitted --

it must be put in explicitly every time you want to multiply two

things together. Since all input is entered on a single line, you will need

to use parentheses to group terms. For instance to enter the rational

function g(x) = (x^2+4)/(3*x^2-20)

we would use:

> g:=x->(x^2+4)/(3*x^2-20);

g := proc (x) options operator, arrow; (x^2+4)/(3*x...

To plot a function defined as above on a given x -range, we use

a command like this:

> plot(f(x),x=-2..2);

[Maple Plot]

To plot two functions together, we put both names in the plot

command, inside a set of braces { }:

> plot({f(x),g(x)},x=-2..2);

[Maple Plot]

Maple has been programmed to ``know'' all of the ``short-cut''

rules for derivative functions that we will learn in this course.

To find the derivative of a function defined as above, we will

write D(f) -- this defines the derivative function of f. Then

we can plot the derivative of f together with f like this

> plot({f(x),D(f)(x)},x=-2..2);

[Maple Plot]

>