Added unit test for differentiate but it's giving an obscure error.