---------------- # Aufgabe 2b # ---------------- r = c(1/100000,1/10000,1/1000,1/100,1/10,1,10,100,1000,10000,100000) n = 100000 phi = seq(from=0,to=pi,length=n) for(rr in r) { z = rr*exp(1i*phi) dz = diff(z) z = z[-1] fz = exp(1i*z)/z result = sum( fz*dz ) print(result) } # checken wir noch das reelle Integral # int_{-infty}^{infty} sin(x)/x xmax = 1000 x = seq( from=-xmax, to=xmax, by=0.001 ) dx = diff(x) x = x[-1] fx = ifelse( x^2>0 , sin(x)/x , 1 ) sum( fx*dx )