# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 21:02:24 2014

@author: dconduche
"""
from math import cos,sqrt
def f(x):#x dans [-1,1] donc cos >= 0
    return sqrt(cos(x))

ff=lambda x : sqrt(cos(x))

def Rectangle(f,a,b,n):
    aire=0
    pas=(b-a)/n
    for i in range(n):
        aire=aire+pas*f(a+i*pas)
    return aire

#Tests
for n in range(5,1000,100):
    print(Rectangle(lambda x : x**2,float(0),float(1),n))
    