# Why do we take the partial differntial with respect to time when calculating the particle velocity of a particle in a wave?

When calculating the velocity using y=Asin(wt-kx), shouldn't we consider the change in x with respect to t instead of assuming that x is constant. Do we take x constant because in a transverse wave a particle doesn't move along the x axis? If yes, how would we write the velocity of the particle of a longitudinal wave? Will it be the same? If yes, why would we not assume x to change with time in that case?

$y$ is the displacement of a particle from its equilibrium position.
$x$ is the equilibrium position of a particle from some origin and $t$ is the time.
So if you are observing one particle, ie $x$ is constant it will undergo simple harmonic motion with amplitude $A$ and frequency $\omega$.
The velocity of the particle will be the rate of change of its displacement from its equilibrium position with respect to time $\frac{dy}{dt}$ at a fixed value of equilibrium position of the particle $x$.
The complication is that there is another velocity $\frac{\omega}{k}$ which is called the wave velocity which is the velocity of a crest or trough etc in the x-direction but the wave velocity is not the same as the particle velocity.