Analyzing a function with its derivative