def trapezoidal(f,xmin,xmax,N):
    """
    Evaluate the integral of the function f within the interval [xmin,xmax], 
    over a number of points N
    ----------------------------------------------------------------------
    input: 
        -f: function object. 
        -xmin,max. Real. Extremes of the interal [xmin,xmax]
        -N: number of points
    """
    delta_k = (xmax-xmin)/(N-1)
    Trap = 0.
    for k in range(1,N):
        Trap += delta_k*(f[k]+f[k-1])/2.0
    return Trap