Do you want results only for global max and min relation with derevative?