You are differential it in time, so it should not matter if your points are spread out in space.
I do not understand why you said it is not working. May be you have another problem.

And becareful: It is not correct to write something like sin(x-t)
x and t is not the same dimension. You can not substract time from space

You can write sin(k*x-w*t). But sin(x-t) is meanless.