finish derivative function; start integral function