%% Created by Maple 13.0, Linux
%% Source Worksheet: Untitled (2)
%% Generated: Mon Apr 26 21:18:53 CEST 2010
\documentclass{article}
\usepackage{maplestd2e}
\def\emptyline{\vspace{12pt}}
\usepackage[height=260mm,width=160mm]{geometry}
\begin{document}
\pagestyle{empty}
\DefineParaStyle{Maple Heading 1}
\DefineParaStyle{Maple Text Output}
\DefineParaStyle{Maple Dash Item}
\DefineParaStyle{Maple Bullet Item}
\DefineParaStyle{Maple Normal}
\DefineParaStyle{Maple Heading 4}
\DefineParaStyle{Maple Heading 3}
\DefineParaStyle{Maple Heading 2}
\DefineParaStyle{Maple Warning}
\DefineParaStyle{Maple Title}
\DefineParaStyle{Maple Error}
\DefineCharStyle{Maple Hyperlink}
\DefineCharStyle{Maple 2D Math}
\DefineCharStyle{Maple Maple Input}
\DefineCharStyle{Maple 2D Output}
\DefineCharStyle{Maple 2D Input}
\begin{Maple Normal}{
\begin{Maple Normal}{
}\end{Maple Normal}
}\end{Maple Normal}
\begin{maplegroup}
\begin{mapleinput}
\begin{center}
\mapleinline{active}{2d}{}{\[\]}
\end{center}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Rect:=proc(f,N,a,b)
local nbrect,i,S,x,n;
nbrect:=[seq(i,i=1..N)]:
S:=seq(student[leftbox](f(x),x=a..b,n),n=nbrect):
plots[display](S,insequence=true);
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{ student[leftbox](cos(x),x=0..Pi,10);
}{}
\end{mapleinput}
\mapleresult
\mapleplot{TD8integralCorrplot2d1.eps}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Rect(x->x\symbol{94}2,100,0,1);
}{}
\end{mapleinput}
\mapleresult
\mapleplot{TD8integralCorrplot2d2.eps}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{airerect:=proc(f,N,a,b)
local k:
Sum((b-a)/N*f(a+k*(b-a)/N),k=1..N)=evalf(sum((b-a)/N*f(a+k*(b-a)/N),k=1..N));
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{airerect(x->x\symbol{94}2,1000,0,1);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Sum((1/1000000000)*k^2, k = 1 .. 1000) = .3338335000}{\[\displaystyle \sum _{k=1}^{1000}{\frac {1}{1000000000}}\,{k}^{2}= 0.3338335000\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Trap:=proc(f,N,a,b)
local TV,TR,k,av,ap,T,C;
TV:=NULL: TR:=NULL:
for k from 0 to N-1 do
av:=a+k*(b-a)/N:
ap:=a+(k+1)*(b-a)/N;
T:=[[av,0],[av,f(av)],[ap,f(ap)],[ap,0]]:
TV:=TV,plot(T,filled=true,color=wheat):
TR:=TR,plot(T,color=black,thickness=2):
od:
C:=plot(f(x),x=a..b,thickness=3):
plots[display](TV,TR,C);
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Trap(x->cos(x),10,0,Pi);
}{}
\end{mapleinput}
\mapleresult
\mapleplot{TD8integralCorrplot2d3.eps}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Trapanim:=proc(f,N,a,b)
local nbtrap,i,S,n;
nbtrap:=[seq(i,i=1..N)]:
S:=seq(Trap(f,n,a,b),n=nbtrap):
plots[display](S,insequence=true);
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Trapanim(x->cos(x),20,0,2*Pi);
}{}
\end{mapleinput}
\mapleresult
\mapleplot{TD8integralCorrplot2d4.eps}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Sims:=proc(f,a,b,dx)
local aa,S;
aa:=a;
S:=0;
while(evalf(aa)<evalf(b)) do
  S:=S+(f(aa)+4*f(aa+0.5*dx)+f(aa+dx))*dx/6.;
  aa:=aa+dx;
od;
S;
end:


}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Sims(x->sin(x),0,Pi,0.0001);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{1.999999999973015128606560761318298418192924673017057388160841117097355523846809544655922413037065226}{\[\displaystyle  1.999999999973015128606560761318298418192924673017057388160841117097355523846809544655922413037065226\\
\mbox{}\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Riem:=proc(f,a,b)
local k;
Limit(Sum(((b-a)/n)*f(a+k*(b-a)/n),k=1..n),n=infinity)=limit(sum(((b-a)/n)*f(a+k*(b-a)/n),k=1..n),n=infinity);
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Riem(x->sin(x),0,Pi);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Limit(Sum(Pi*sin(k*Pi/n)/n, k = 1 .. n), n = infinity) = 2}{\[\displaystyle \lim _{n\rightarrow \infty } \left( \sum _{k=1}^{n}\pi \,\sin \left( {\frac {k\pi }{n}} \right) {n}^{-1} \right) =2\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{airetrap:=proc(f,N,a,b)
local k:
(b-a)/N*((f(a)+f(b))/2+Sum(f(a+k*(b-a)/N),k=1..N-1))=evalf((b-a)/N*((f(a)+f(b))/2+Sum(f(a+k*(b-a)/N),k=1..N-1)));
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{evalf(Pi);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{3.141592654}{\[\displaystyle  3.141592654\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{4*airerect(x->sqrt(1-x\symbol{94}2),10000,0,1);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{4*(Sum((1/100000000)*sqrt(100000000-k^2), k = 1 .. 10000)) = 3.141391481}{\[\displaystyle 4\,\sum _{k=1}^{10000}{\frac {1}{100000000}}\, \sqrt{100000000-{k}^{2}}= 3.141391481\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{4*airetrap(x->sqrt(1-x\symbol{94}2),10000,0,1);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{1/5000+(1/2500)*(Sum((1/10000)*sqrt(100000000-k^2), k = 1 .. 9999)) = 3.141591478}{\[\displaystyle {\frac {1}{5000}}+{\frac {1}{2500}}\,\sum _{k=1}^{9999}{\frac {1}{10000}}\, \sqrt{100000000\\
\mbox{}-{k}^{2}}= 3.141591478\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{mini:=proc(u,p)
local k;
k:=0;
while (evalf((u\symbol{94}(2*k+3))/(2*k+3)))>(10\symbol{94}(-p)) do  
k:=k+1;
od:
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{greg:=proc(n,a,p)
local S,k;
S:=0;  
for k from 0 to n+1/2 do  
S:=S+evalf(((-1)\symbol{94}k*a\symbol{94}(2*k+1))/(2*k+1),p+1);
od;
S;
end:
}{}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{mini(1/5,100);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{69}{\[\displaystyle 69\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{Digits:=100:
4*(4*greg(69,1/5,100)-greg(69,1/239,100));
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117064}{\[\displaystyle  3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117064\\
\mbox{}\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{4*(4*greg(69,1/5,100)-greg(69,1/239,100))-evalf(Pi,100);
}{}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{-4.*10^(-99)}{\[\displaystyle -{ 4.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\times 10^{-99}}\\
\mbox{}\\
\mbox{}\]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{}{}
\end{mapleinput}
\end{maplegroup}
\begin{Maple Normal}{
\begin{Maple Normal}{
\mapleinline{inert}{2d}{}{\[\displaystyle \]}
}\end{Maple Normal}
}\end{Maple Normal}
\end{document}
