Last time | Next time |
SetOptions[$FrontEndSession, NotebookAutoSave -> True] NotebookSave[]
For all of you here today, you're welcome to zoom in as well, so that we can share screens if some problem arises, or if we want to show off something you've done.
But we'll see that only certain of our numerical integration schemes are helpful in this case. Just one of the exciting problems awaiting you in Lab 7!
f[x_]:=Cos[Sqrt[x^3+1]] a=0 b=4 n=10 dx=(b-a)/n lrr=dx*Sum[f[a+(k-1.0)dx],{k,1,n}] rrr=dx*Sum[f[a+(k-0.0)dx],{k,1,n}] mid=dx*Sum[f[a+(k-0.5)dx],{k,1,n}] trap=(lrr+rrr)/2 simp=(2*mid+trap)/3
Simpson's uses twice the "$n$", because it uses all $n$ of midpoints $x$-values, and all $n+1$ of trapezoidal's values; so it uses $2n+1$ points, for $2n$ subintervals.