derivative implemented and tested on gaussian function