Implemented derivative for a couple of functions