|
|
Numerische Berechnung eines Integrals
> |
restart; with
(Student[Calculus1]): |
Festlegen der Optionen zum Zeichnen der Diagramme bzw. zum
Berechnen der Näherungswerte:
> |
plotopts:= output
= plot,
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); |

Das zu berechnende Integral:

Approximation des Integrals mit dem Riemannverfahren:
> |
ApproximateInt(f(x), x=
-1..3, method = midpoint, plotopts);
simplify (ApproximateInt(f(x), x= -1..3, method = midpoint, calcopts)); |

Approximation des Integrals mit dem Trapezverfahren:
> |
ApproximateInt(f(x), x=
-1..3, method = trapezoid, plotopts);
simplify (ApproximateInt(f(x), x= -1..3, method = trapezoid,
calcopts)); |

Approximation des Integrals mit dem Simpsonverfahren:
> |
ApproximateInt(f(x), x=
-1..3, method = simpson, plotopts);
simplify (ApproximateInt(f(x), x= -1..3, method = simpson, calcopts)); |

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