import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import quad

def I(n,f) :
    def g(t) :
        return f(t)**n
    return quad(g,0,1)[0]

a = 1/2   
def f1(x) :
    return 1-a*np.sin(x)
    
b = 2
def f2(x) :
    return 1-b*x**2
    
N = [k for k in range(1,1001)]
X = [np.log(n) for n in N]
Y = [np.log(I(n,f1)) for n in N]
plt.plot(X,Y)
plt.show()

print('alpha =',np.log(I(1000,f1))/np.log(1000))
