lib: add math_int functions
lib: fix fpath function
lib: add 2d integration