Approximate Values for the Integral of a Monotonic Function

SetOptions[Plot, AxesOrigin -> {0, 0}];

f[x_] = N[(4/(1 + (x^2)))];

Plot[f[x], {x, 0, 1}, PlotRange -> {0, 4}]

Step functions based on f such that s <= f <= t (these depend on f being decreasing on [0,1]):

s[x_, n_] = f[((Floor[n x] + 1)/n)];

t[x_, n_] = f[Floor[n x]/n];

Plot[{f[x], t[x, 10]}, {x, 0, 1}, PlotRange -> {0, 4}]

Plot[{f[x], s[x, 10]}, {x, 0, 1}, PlotRange -> {0, 4}]

Integrals of s and t:

LowerInt[n_] := (((∑_(k = 1)^n) f[(k/n)])/n)

UpperInt[n_] := (((∑_(k = 0)^(n - 1))f[(k/n)])/n)

LowerInt[10]

UpperInt[10]

LowerInt[100]

UpperInt[100]

Difference between UpperInt[n] and LowerInt[n] is less than
(f[b] - f[a]) (b - a)/n = 2/n
to get an error less than .001 take n > 2000.

NLowerInt[2000]

UpperInt[2000]

For n=100, the step function s  is very close to f:

Plot[s[x, 100], {x, 0, 1}, PlotRange -> {0, 4}]