# Simple unbounded integrand # # # The integrand f in this example is simple but unbounded and hence not Riemann integrable. For x = 1/2^n # with `in`(n, `union`(nonnegint, {0}))we define f(x)=1/(n+1), otherwise f(x) = 0. A suitable gauge would be equal > epsilon/(2^n)(n+1) # if x=1/2^n and 1otherwise. The definition of the Kurzweil inegral requires that for # all tagged divisions which are gauge-fine # # the Riemann sum is within ϵ of the expected value of the integral. Unfortunately and inevitably the computer will display only one sum. With the above choice our program will produce 0 for theRiemann sum, a rather uninteresting result. Therefore we aim below for the worst possible scenario for the Riemann sum. # For a good display we well choose a fairly large ϵ. This might cause too large contribution from the subinterval which is tagged by 1. # In order to prevent this we make an adjustment in our definition of gauge. The choice of ϵ causes a fairly large error. However we are intersted in a good graphical display rather than in accuracy. # > with(plots): > read("khtools.m"): > f:=proc(x) > local n, f; > if x=0 then f:=0; > else n:=log[2](x): f:=(floor(n+1)-ceil(n))*(-n+1); > end if: > end: > delta:=proc(x) > local n, delta; > if x = 0 then delta := eta > else n := evalf((log[2])(x)); > delta := min(.1, floor(n+1)-ceil(n))*epsilon*x/(-n+1)+.9*(2^ceil(n)-x) > end if: > end: > epsilon:=0.9:eta:=0.05: > khbox(f,0,1,delta); The Riemann sum is 0.258750 > #