Homework, Section 4.1
Calculus I
Andy Long

#2,  p. 293

left={9,8.8,8.2,7.3,6,4};
right={8.8,8.2,7.3,6,4,1};
mid={8.9,8.6,7.8,6.7,5.1,2.8};
left6=Total[left]*2
right6=Total[right]*2
mid6=Total[mid]*2
(* we can see that left is an overestimate, right an underestimate, and midpoint perhaps the best. Trapezoidal should be closer as well: *)
trap=(left6+right6)/2
(* and then Simpson's should be the best of all: *)
simpson=(2*mid6+trap)/3

#5,  p. 293

f[x_]:=1+x^2
left={-1,0,1};
right={0,1,2};
mid={-0.5,0.5,1.5};
width=1;
left3=Total[f[left]]*width
mid3=Total[f[mid]]*width
right3=Total[f[right]]*width
width=0.5;
left={-1,-.5,0,.5,1,1.5};
right={-.5,0,.5,1,1.5,2};
mid={-0.75,-.25,0.25,.75,1.25,1.75};
left6=Total[f[left]]*width
mid6=Total[f[mid]]*width
right6=Total[f[right]]*width

#13,  p. 294

times={0,.5,1,1.5,2,2.5,3}
velocities={0,6.2,10.8,14.9,18.1,19.4,20.2}
LRR=Total[Table[(times[[i+1]]-times[[i]])*velocities[[i]],{i,1,6}]]
RRR=Total[Table[(times[[i+1]]-times[[i]])*velocities[[i+1]],{i,1,6}]]
Trap=N[(LRR+RRR)/2]

#16,  p. 294

times={0,10,15,20,32,59,62,125}
velocities={0,185,319, 447,742,1325,1445,4151}
LRR=Total[Table[(times[[i+1]]-times[[i]])*velocities[[i]],{i,1,6}]]
RRR=Total[Table[(times[[i+1]]-times[[i]])*velocities[[i+1]],{i,1,6}]]
Trap=N[(LRR+RRR)/2]

#18,  p. 294

left={0,80,110};
right={80, 110, 120};
mid={50,95,115};
left3=N[Total[left]*10*1/3600]
right3=N[Total[right]*10*1/3600]
mid3=N[Total[mid]*10*1/3600]
(* we can see that left is an underestimate, right an overestimate, and midpoint perhaps the best. Trapezoidal should be closer as well: *)
trap=(left3+right3)/2
(* and then Simpson's should be the best of all: *)
simpson=(2*mid3+trap)/3

#22,  p. 295: the answer isn’t unique

Clear[f,a,b,n,Deltax]
a=5
b=7
Deltax=(b-a)/n
f[x_]:=x^10
Plot[f[x],{x,a,b}]
sum=Sum[f[a+i*Deltax]*Deltax,{i,1,n}]
Area=N[Limit[sum,n -> Infinity]]
Int=N[Integrate[f[x],{x,a,b}]]

#28,  p. 295

Clear[y]
y[x_]:=x^4+5x^2+x
sum=Sum[y[2+i*(7-2)/n]*(7-2)/n,{i,1,n}]
Area=N[Limit[sum,n -> Infinity]]
Int=N[Integrate[y[x],{x,2,7}]]