overload matlab functions to provide first and second derivatives