$PlotTheme="Monochrome"

fLeftRiemannPiecewise[f_,a_,b_,n_]:=Function[x,Piecewise[Table[{f[a+(k-1)(b-a)/n],a + (k-1)(b-a)/n ≤x&&x≤a+k(b-a)/n},
{k,1,n}]]]
LeftRiemannPlot[f_,a_,b_,n_]:=
Plot[
{Function[f][x],
Evaluate[fLeftRiemannPiecewise[f,a,b,n]][x]
},
{x,a,b}]

fRightRiemannPiecewise[f_,a_,b_,n_]:=Function[x,Piecewise[Table[{f[a+(k)(b-a)/n],a + (k-1)(b-a)/n ≤x&&x≤a+(k)(b-a)/n},
{k,1,n}]]]
fMidRiemannPiecewise[f_,a_,b_,n_]:=Function[x,Piecewise[Table[{f[a+(k-1/2)(b-a)/n],a + (k-1)(b-a)/n ≤x&&x≤a+(k)(b-a)/n},
{k,1,n}]]]
fTrapRiemannPiecewise[f_,a_,b_,n_]:=Function[x,Piecewise[Table[{
f[a+(k-1)(b-a)/n](a+(k-1)(b-a)/n+1-x) 
+ (x-(a+(k-1)(b-a)/n))f[a+(k)(b-a)/n],
a + (k-1)(b-a)/n ≤x&&x≤a+(k)(b-a)/n},
{k,1,n}]]]

f[x_]:=4x^3
a=0;
b=4;
n=4;
Plot[{f[x],fLeftRiemannPiecewise[f,a,b,n][x]},{x,a,b},Filling->{2->Axis}]

Plot[{f[x],fRightRiemannPiecewise[f,a,b,n][x]},{x,a,b},Filling->{2->Axis}]

Plot[{f[x],fMidRiemannPiecewise[f,a,b,n][x]},{x,a,b},Filling->{2->Axis}]

Plot[{f[x],fTrapRiemannPiecewise[f,a,b,n][x]},{x,a,b},Filling->{2->Axis}]

phi[x_]:=1/Sqrt[2Pi] * E^(-x^2/2)
Plot[phi[x],{x,-4,4}]

a=-1;
b=1;

n=2;
Plot[{phi[x],fMidRiemannPiecewise[phi,a,b,n][x]},{x,a,b},Filling->{2->Axis}]

n=200;
Plot[{phi[x],fMidRiemannPiecewise[phi,a,b,n][x]},{x,a,b},Filling->{2->Axis}]

runnerSpeeds={{0,0},{.5,4.67},{1,7.34},{1.5,8.86},{2,9.73},{2.5,10.22},{3,10.51},{3.5,10.67},{4,10.76},{4.5,10.81},{5,10.81}}
runnerList=ListPlot[runnerSpeeds]

runnerJoinedPlot=ListLinePlot[runnerSpeeds,InterpolationOrder->5,Filling->Axis]

runnerTrapFunction[x_]:=Piecewise[Table[
{ 
(runnerSpeeds[[k+1,2]]-runnerSpeeds[[k,2]])/(runnerSpeeds[[k+1,1]]-runnerSpeeds[[k,1]])
*(x - runnerSpeeds[[k,1]]) + runnerSpeeds[[k,2]]
,
runnerSpeeds[[k,1]]≤x&&x≤runnerSpeeds[[k+1,1]]
},
{k,1,10}]]

runnerTrapPlot=ListPlot[runnerSpeeds,Joined->True,Filling->Axis]

runnerMidpointFunction[x_]:=Piecewise[Table[
{ 
runnerSpeeds[[2k,2]]
,
runnerSpeeds[[2k-1,1]]≤x&&x≤runnerSpeeds[[2k+1,1]]
},
{k,1,5}]]

runnerMidpointPlot=Plot[runnerMidpointFunction[x],{x,0,5},Filling->Axis,PlotRange->{0,11}];
Show[runnerMidpointPlot,runnerList]

runnerSimpsonFunction[x_]:=Piecewise[Table[
{
(runnerSpeeds[[2k-1,2]](runnerSpeeds[[2k,1]]-runnerSpeeds[[2k+1,1]])+runnerSpeeds[[2k,2]](runnerSpeeds[[2k+1,1]]-runnerSpeeds[[2k-1,1]])+runnerSpeeds[[2k+1,2]](runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k,1]]))/((runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k+1,1]])(runnerSpeeds[[2k,1]]-runnerSpeeds[[2k+1,1]])(runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k,1]]))*x^2

+(runnerSpeeds[[2k-1,2]](runnerSpeeds[[2k+1,1]]^2-runnerSpeeds[[2k,1]]^2)+runnerSpeeds[[2k,2]](runnerSpeeds[[2k-1,1]]^2-runnerSpeeds[[2k+1,1]]^2)+runnerSpeeds[[2k+1,2]](runnerSpeeds[[2k,1]]^2-runnerSpeeds[[2k-1,1]]^2))
/((runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k+1,1]])(runnerSpeeds[[2k,1]]-runnerSpeeds[[2k+1,1]])(runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k,1]]))*x

+(runnerSpeeds[[2k-1,2]](runnerSpeeds[[2k,1]]^2runnerSpeeds[[2k+1,1]]-runnerSpeeds[[2k+1,1]]^2runnerSpeeds[[2k,1]])+runnerSpeeds[[2k,2]](runnerSpeeds[[2k+1,1]]^2runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k-1,1]]^2runnerSpeeds[[2k+1,1]])+runnerSpeeds[[2k+1,2]](runnerSpeeds[[2k-1,1]]^2runnerSpeeds[[2k,1]]-runnerSpeeds[[2k,1]]^2runnerSpeeds[[2k-1,1]]))
 /((runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k+1,1]])(runnerSpeeds[[2k,1]]-runnerSpeeds[[2k+1,1]])(runnerSpeeds[[2k-1,1]]-runnerSpeeds[[2k,1]]))
,
runnerSpeeds[[2k-1,1]]≤x&&x≤runnerSpeeds[[2k+1,1]]
},
{k,1,5}]]

runnerSimpsonPlot=Plot[runnerSimpsonFunction[x],{x,0,5},Filling->Axis];
Show[runnerSimpsonPlot,runnerList]