Can Hamilton's principle, i.e. the principle of stationary action, be posed as an initial-value problem instead of the usual boundary-value problem and still produce the correct equations of motion?
For a concrete example, consider the classical harmonic oscillator where the Lagrangian functional is given as $$L\left[x\right]=\frac{1}{2}m\left( \dot{x}^2 - \omega^2x^2 \right)$$ and action as $$S=\int_0^\tau dt L\left[x\right]=\frac{1}{2}m\int_0^\tau dt\left(\dot{x}^2 - \omega^2x^2\right).$$ If we consider the constraint on the trajectory $x(t)$ not as $x(0)=x_0, x(\tau)=x_1$ but as $x(0)=x_0, \dot{x}(0)=v_0$, does the assumption that $\delta S[x]=0$ lead to the correct equation $\ddot{x}=-\omega^2x$?
I tried to directly calculate the variation of action, but could not bring it to the desired conclusion. Is this approach doomed to fail, or is my maths skills to be blamed?
Edit: Thanks to Qmechanic's suggested link, I understand that the equations of motion(EOMs) obtained by the variational method must equal that of the Lagrange formalism, d'Alembert formalism, or any differential approach. I also understand that the variational method only appears to assume that the endpoint is fixed, but its resulting EOMs can be solved as the usual initial-value problem and get the correct trajectory.
My revised question is that, while deriving the EOMs using the variational method, am I allowed to impose an initial-value condition on the domain of possible trajectories? In the harmonic oscillator case, for example, the variation in the action is given as $$ \delta S = m\int_0^\tau dt\left(\dot{x}\delta\dot{x} -\omega^2x\delta x \right) = \left[ m\dot{x}\delta x \right]_0^\tau-m\int_0^\tau dt\left( \ddot{x}-\omega^2x \right) $$
In the usual boundary condition, the square bracket term vanishes since $\delta x = 0$ at $t=0,\tau$. However, if I were to assume the initial condition such that $\delta x(t=0)=\delta\dot{x}(t=0)=0$, then I have no such guarantee and cannot directly obtain the Euler-Lagrange equation that turns out to be $\ddot{x}=\omega^2x$. Is there another method to proceed this derivation of EOM that utilizes the initial conditions?