from math import sqrt
def f(x) :
return (sqrt(1+x**2))
def petits_rectangles(n):
s=0
for k in range (n):
s=s+(1/n)*f(k/n)
return s
def grands_rectangles(n):
S=0
for k in range (1,n+1):
S=S+(1/n)*f(k/n)
return S
def encadrement(n):
s=petits_rectangles(n)
S=grands_rectangles(n)
return (s,"<I<",S)
print (encadrement(1000))
To embed this project on your website, copy the following code and paste it into your website's HTML: