Yes, that's exactly what you do. You can think of this sign change as causing you to perform gradient ascent instead of gradient descent (in the case of using a gradient method). Alternatively, you can think of flipping the sign in a gradient method as performing gradient descent in . By finding a minimum of you find a maximum of . Similar reasoning holds for Newton's method (and various other methods as well).