Taking derivative by convolution