f[x_]:=(x^3)-5(x^2)+x+20;
a=0;b=5;
Δ[x_,i_]:=x[i]-x[i-1];
S:=(∑_(i=1)^n)f[xx[i]]Δ[x,i];

n=10;
x[i_]=((b-a)/n)i+a;
xx[i_]=((x[i-1]+x[i])/2);
g=Plot[f[x],{x,a,b}];
Show[{
Graphics[{
EdgeForm[Thick],
Pink,
Table[Rectangle[{x[i-1],0},{x[i],f[xx[i]]}],{i,1,n}]
}],
g
},
PlotRange->All,Axes->True,AspectRatio->Full]

N[S]

N[(∫_a^b)f[x]\[DifferentialD]x]

f[x_,y_]:=(1/5)((x^2)+ (y^2)+1);
a=0;b=2;c=0;d=2;
Δ[x_,i_]:=x[i]-x[i-1];
SS:=(∑_(i=1)^n)(∑_(j=1)^n)f[Sequence@@xx[i,j]]Δ[x,i]Δ[y,j];

n=3;
x[i_]=((b-a)/n)i+a;
y[i_]=((d-c)/n)i+c;
xx[i_,j_]={((x[i-1]+x[i])/2),((y[j-1]+y[j])/2)};
g=Plot3D[f[x,y],{x,a,b},{y,c,d}];
Show[{
Graphics3D[{
Pink,
Table[Cuboid[{x[i-1],y[j-1],0},{x[i],y[j],f[Sequence@@xx[i,j]]}],{i,1,n},{j,1,n}]
}],
g
},
Axes->True,Boxed->False,AxesOrigin->{0,0,0},PlotRange->{All,All,{0,3}},ImageSize->{500,500}]

N[SS]

N[(∫_a^b)((∫_c^d)f[x,y]\[DifferentialD]y)\[DifferentialD]x]