math-toolbox: integral form of gradient added