| Maple session | Comments |
|---|---|
> diff(cos(x),x);
- sin(x)
_______________________________
> diff(cos(x),x,x);
- cos(x)
_______________________________
> diff(log(sin(x)),x);
cos(x)
------
sin(x)
|
The command diff does differentiation. Repeating the variable
gives a second derivative. Maple knows a wide variety of standard
functions. The names are generally self-evident.
|
> r := sqrt(x^2+y^2+z^2);
2 2 2 1/2
r := (x + y + z )
_________________________________
> V := proc(x,y,z) 1/r end;
V := proc(x,y,z) 1/r end
_________________________________
> V := (x,y,z) -> 1/r:
_________________________________
> diff(V(x,y,z),x);
x
- -----------------
2 2 2 3/2
(x + y + z )
|
You can define your own functions. The first command assigns the expression proc() function. The actual
statement(s) that define the function are placed between the
proc() and end. The reason for the end flag is
that function procedures can run on to several lines, and it is
necessary to indicate which is the last line. The third command shows
the alternative arrow notation that works for simple functions.
Notice that the partial derivative is taken in the fourth
command.
|
> diff(V(x,y,z),x,y);
x y
3 -----------------
2 2 2 5/2
(x + y + z )
|
This is the way to get |
| Maple session | Comments |
|---|---|
> int(x^3*cos(x),x); 3 2 x sin(x) + 3 x cos(x) - 6 cos(x) - 6 x sin(x) |
Indefinite integral |
> int(sin(t)/t,t=0..x);
Si(x)
|
Definite integral |
> taylor(",x);
3 5 6
x - 1/18 x + 1/600 x + O(x )
|
The Taylor series expansion of |
> Order := 10;
Order := 10
_______________________________
> taylor("",x);
3 5
x - 1/18 x + 1/600 x -
7 9 10
1/35280 x + 1/3265920 x + O(x )
|
You can get more terms in the Taylor series by changing the preassigned value of Order.
|
> taylor(sin(x),x=Pi);
3
- (x - Pi) + 1/6 (x - Pi) -
5 6
1/120 (x - Pi) + O((x - Pi) )
|
Use x=a to get the Taylor series expansion about x=a.
|
> f := proc(x,h)
(sin(x+h) - sin(x))/h end;
f := proc(x,h) (sin(x+h)-sin(x))/h end
__________________________________
> limit(f(x,h),h=0);
cos(x)
|
This is how to find a limiting value. In this case the expression defines the derivative of |
| Maple session | Comments |
|---|---|
> evalf(erf(1));
.8427007929
___________________________
> evalf(erf(2));
.9953222650
___________________________
> limit(erf(x),x=infinity);
1
|
The error function, known to Maple, is defined as
|
|
|