A simple program to find X when a gradient function is equal to zero