>> From:
Dear MUGgers:
Nathan Sokalski wrote:
"As you may know, there is no command to visually display trapezoid() like
there is for leftsum, rightsum, and middlesum. I decided to write my own,
and I have been able to make it work for some functions, but not others."
I, too, have worked on this, but from a different approach, using the
Plottools library so kindly unwrapped for me by Michael Monagan at his
Maple workshop at Simon Fraser University. This works nicely for positive
functions, For instance, try the following command:
> restart:with(plots):with(plottools):
> f:=x->2+sin(x^2):
> a:=0:b:=sqrt(3*Pi):
c:=plot(f(x),x=a..b,scaling=constrained,colour=red,tickmarks
=[3,2],thickness=3,labels=[``,``]):
L:=[2,4,8,16,32]:
for n in L do
h:=(b-a)/n:
for i from 1 to n do pol[i]:=polygon([[(i-1)*h,0],[(i-1)*h,f((i-1)
*h)],[i*h,f(i*h)],[i*h,0]],colour=green):od:
pl[n]:=display(PLOT(seq(pol[i],i=1..n)),scaling=constrained,tickmarks
=[3,3]):od:
anim:=display([seq(pl[n],n=L)],insequence=true):
display({c,anim});
The list L can be edited to give whatever sequence of approximations one
wishes. This method does not work well when the curve intersects the axis,
but for curves with all positive values (or with all negative values), it
gives nice pictures and an dynamic sense of convergence.
I also have done similar animations for Simpson's Rule, for Arc Length, for
Area between curves, and for areas in Polar Coordinates. If there is
interest, I could post these as well.
Regards to all who seek to promote visual comprehension.
Alan Gold
Mathematics & Statistics
University of Windsor
|