f[x_]:=7 x-x^2
Plot[f[x],{x,0,8}]

Integrate[f[x],{x,0,8}]

Dx=2

Left Rectangle approximation:

LRR4=Dx*Total[f[{0,2,4,6}]]

Right Rectangle approximation:

RRR4=Dx*Total[f[{2,4,6,8}]]

Midpoint approximation:

Mid4=Dx*Total[f[{1,3,5,7}]]

Trapezoidal approximation:

Trap4=(LRR4+RRR4)/2

Simpson’s rule approximation:

S8=(Trap4+2*Mid4)/3