> int(exp(-x*x),x=0..1.);
> # Resulting in the answer for the integral:
< .7468241330
> # Remark: Maple Worksheet output is in EPS (Encapsulated PostScript).
> # Remark: Output is left in line-edit type mode for easy access.
> # Remark: Students should try out steps using a Maple Worksheet.
2. To Integrate the Function exp(-x*x) on
[0,infinity]:
> int(exp(-x*x),x=0..infinity);
> # Resulting in the answer for the integral:
< 1/2
< 1/2 Pi
> # Remark: "Pi = 4*atan(1.)", circumference of circle with unit diameter.
> # Remark: For numerical floating point 10 digit value use the Maple "evalf" function.
> evalf(%,10);
< .8862269255
> # Remark: The percent (%) argument repeats the last expression.
3. Integration Using a Maple User Defined Function:
> f:=x->exp(-x^2)*sin(x);
< 2
< f := x -> exp(- x ) sin(x)
> # Remark: "f:=x->" is Maplese for "f(x)=", Avoiding Maple Confusion.
> int(f(x),x=0..Pi);
< Pi
< /
< |
< | f dx
< |
< /
< 0
> evalf(%);
> # Resulting in the answer for the integral:
< .4244375108
> # Remark: "Pi = 4*atan(1.)".
4. Integration Using a Maple User Defined Piecewise Function:
> # Caution: If-Then-Else Constructs or Procedures Do NOT Seem to Work with Maple int Function;
> # Causes Maple "Int" Error: "Cannot Evaluate Boolean".;
> # But the Function Itself May be Evaluated in Maple.
> g:=x->piecewise(x<1,x^2,exp(-(x-1)));
< 2
< g := x -> piecewise(x < 1, x , exp(- x + 1))
> # Remark: Maple Function "piecewise" has Syntax:
> # piecewise("Condition","FunctionIfTrue","FunctionElse");
> # See Maple Help for More Complex Syntax.
> int(g(x),x=0..5);
< 5
< /
< |
< | g dx
< |
< /
< 0
> evalf(%);
> # Resulting in the answer for the integral:
< 1.315017694 (Answer corrected for Maple 9.5, 02dec04.)
5. To Find the Indefinite Integral of the Function exp(-x*x):
> int(exp(-x*x),x);
> # Resulting in the answer:
< 1/2
< 1/2 Pi erf(x)
> # Remark: "Pi = 4*atan(1.)" and "erf(x)" is the special error function.
6. Example of Answer for Integral Without Exact Answer in Maple:
exp(-x*x)i*ln(x):
> int(exp(-x*x)*ln(x),x);
> # Resulting in the answer:
< /
< | 2
< | exp(- x ) ln(x) dx
< |
< /
7. Examples Trapezoidal and Simpson's Rules from Maple's
Student Calculus Package: