from math import exp, log

def f(x):
    return 1+log(2)-log(exp(x)+exp(-x))

def rectangleSup(n):
    base = 1.65745/n
    x = 0
    A = 0
    while x < 1.65745:
        A = A + base * f(x)
        x = x + base
    return A

def rectangleInf(n):
    base = 1.65745/n
    x = base
    A = 0
    while x < 1.65745:
        A = A + base * f(x)
        x = x + base
    return A

print([rectangleInf(100), rectangleSup(100)])
