Approximate Values for the Integral of a Monotonic Function

f[x_] := (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_] := (1/n) (∑_(k = 1)^n) f[(k/n)]  // N

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

LowerInt[10]

UpperInt[10]

UpperInt[10]  -  LowerInt[10]

LowerInt[100]

UpperInt[100]

UpperInt[100]  -  LowerInt[100]

Difference between UpperInt[n] and LowerInt[n] is less than \(TraditionalForm
      \`ϵ\_n\  = 
        \(\(\((f(b)\  - \ f(a))\)\ \((b\  - \ a)\)\)\/n = \ 2\/n\)\). Use the midpoint \(TraditionalForm
      \`σ\_n + \ \(1\/2\) ϵ\_n = \ 
        LowerInt[n]\  + \ 1\/n\)to get an approximation with an error less than ((1/2)) (Subscript[ϵ, n]) = (1/n). For example, to guarantee that the error is less than  .001 we should choose n such that (1/n) <   .001, or n  >  1000.

LowerInt[1001]  +  (1/1001)

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

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