def trapezoid_error_bound(a, b, N, M):
    """
        Computes the theoretical error bound when calculating an integral using Trapezoid method.

        Parameters
        ----------
        a,b : float
            The min and max value of the integrating interval
        N : int
            Number of partitions.
        M : float
            The value of local max on [a,b] of the <b>absolute</b> 2nd derivative of function f used in Trapezoid
            integration

        Returns
        -------
        return_value : float
            The value of theoretical error bound when calculating an integral using Trapezoid method
    """
    interval_length = b - a
    denominator = 12 * (N ** 2)
    return ((interval_length**3)/denominator)*M