def returnRectangles(a,x):
    """ Returns 2D discrete integral array using the rectangle method

    The calculation for each array element is
    :math:`(\Delta y_i = 0.5(a_{n-1}+a_{n})*(x_{n-1}-x_{n})`

    Parameters
    ----------
    a : numpy.ndarray
        Description: Array of y(x) function with N+1 elements
    x : numpy.ndarray
        Description: x- coordinate array with N elements

    Returns
    --------
    numpy.ndarray


    """
    return 0.5*(a[1:]+a[:-1])*(x[1:]-x[:-1])