numerical differentiation and integration using function pointers for maximum modularity