Question about the wave function of a travelling wave I have a confusion about the wave function of a travelling wave. Suppose we have a wave function of a travelling wave travelling towards the positive direction of x axis 
$$ u(x,t)=A\cos\left(\omega(t-\frac{x}{v})+\phi_0\right) $$ 
where $v$ is the velocity of the wave, $\omega$ is the angular velocity, $\phi_0$ is the initial phase.
Consider $u$ as the displacement of a particle in $y$ direction perpendicular to the $x$ direction, that is, a longitudinal wave.
In the textbook, the above wave function is derived by first considering a particle oscillating at $x=0$ with an oscillation function:
$$ u(0,t)=A\cos(\omega t+\phi_0) $$
then when the oscillation spreads towards the positive $x$ direction, it takes the oscillation a time $x'/v$ to arrive at $x'$. then the oscillation at $x'$ is a time $x'/v$ behind that at $x=0$, so we have $\omega(t-x'/v)+\phi_0$ as the phase of the oscillation at $x'$ with respect to $x=0$.
My question is, for the oscillation of $x'$ at time $t=x'/v$ (just at the time the wave arrived at $x$), according to the wave function, the displacement should be:
$$ u(x',x'/v)=A\cos(\phi_0) $$
But since the wave has just been arrived, the starting point for the particle should be its equilibrium point, with $u(x',x'/v)=0$ in this case. So is there a contradiction? Would anyone please give me some instruction?
 A: $\phi_0$ is a phase offset defined by the initial conditions. In your last paragraph, you're stating that the particle should be in its equilibrium position when the wave arrives which specifies that $\phi_0 = \frac{\pi}{2}$ such that $u=0$.
(Also, you're probably describing a transverse wave, not a longitudinal wave)
A: The wave function you presented is an ideal periodic function with neither beginning nor end (in both spatial and temporal meaning).
You can verify that by putting t=0 into the function, and get a value at any x displacement. Or by fixing x and get a value at any t.
In that sense, the wave has occupied all x and all t already. So all particles along x axis have been oscillating all the time.
In another perspective, if we set the initial condition of the particle at x=0, t=0 to be zero, i.e. u(0, 0)=0, then the wave must start from 0 due to continuity, which means the initial phase must be pi/2+N*pi. (e.g. pi/2, 3pi/2, ...)
In practice, no wave can be an infinite periodic function of a single frequency. Any wave that has a beginning or an end must be the superposition of infinitely many periodic wave functions of all frequencies. (Fourier analysis)
