Using gradient descent methods in optimization