First and second derivatives