Click on a box with a + inside to expland the section.
Functions versus expressions
Maple makes a big distinction between functions and expressions. Youu should too! Here are some examples.
> f:=x->5*x^2+1; This defines a function f.
> f(2);f(x); Evaluating a function at a certain point gives an expression, a particular value of the function.
> f(cos(y)); Another value of the function. It is an expression with a y in it, not a function of y.
> diff(f(x),x); diff differentiates expressions, not functions
> D(f); D differentiates functions, giving back another function
> D(f)(3); Of course, you can evaluate the function D(f) at 3.
Combinations of functions
Maple allows you to define things like the product of two functions, their composition, etc.
> (sin^2)(x); sin(x)^2; a:=sin^2; The last item defines a function called a.
> a(x); a(5.0); Here a is evaluated at x and at 5.0 (the decimal forces Maple to approximate)
> (cos*sin)(x); g:=cos*sin; Product expression versus product function.
> (cos@sin)(x); h:=cos@sin; Composition expression versus composite function.
> g(4); h(4); You can evaluate these new functions at a few points. Maple won't approximate until you ask it to.
> evalf(%); Evaluate the last expression entered (not necessarily what lies just above in the worksheet!).
Plotting functions
> plot(f(x),x=-4..4,y=0..20); Plot the expression f(x) .
> plot(f,-4..4,0..20); Plot the function. The first range specified is for the argument, the second for the range.