dh-Materialien
Maple   
Anwendungen

Numerische Berechnung eines Integrals

> restart; with(Student[Calculus1]):

Festlegen der Optionen zum Zeichnen der Diagramme bzw. zum Berechnen der Näherungswerte:

> plotopts:= output          = plot,
           font            = [COURIER, 12],
           partition       = 6,
           title           = "",
           showarea        = false,
           labels          = ["", ""],
           functionoptions = [color=navy, thickness=2],
           boxoptions      = [color=red]:

calcopts:= output          = sum,
           partition       = 500:

Definition einer Funktion: 

> f:= x -> exp(sin(x)^7-cos(x)^7)-1.5;
plot(f(x), x = -1..3,
  color = navy,
  thickness = 2,
  font = [COURIER, 12]);

Schaubild von f

Das zu berechnende Integral:

> Int(f(x), x = -1..3);

Int (f(x), x = -1..3)

Approximation des Integrals mit dem Riemannverfahren:

> ApproximateInt(f(x), x= -1..3, method = midpoint, plotopts);
evalf(ApproximateInt(f(x), x= -1..3, method = midpoint, calcopts));

Riemannverfahren

Approximation des Integrals mit dem Trapezverfahren:

> ApproximateInt(f(x), x= -1..3, method = trapezoid, plotopts);
evalf(ApproximateInt(f(x), x= -1..3, method = trapezoid, calcopts));

Trapezverfahren

Approximation des Integrals mit dem Simpsonverfahren:

> ApproximateInt(f(x), x= -1..3, method = simpson, plotopts);
evalf(ApproximateInt(f(x), x= -1..3, method = simpson, calcopts));

Simpsonverfahren

> evalf(Int(f(x), x= -1..3));

-0.8984786647