I'm trying to get some understanding in treating action $S$ as a function of coordinates. Landau and Lifshitz consider $\delta S$, getting $\delta S=p\delta q$, thus concluding that
$$\frac{\partial S}{\partial q}=p.$$
I'm now trying to understand this result, and consider the definition of action. I suppose that action as a function of coordinates $x$ will have $q=q(x,t)$ and $\dot q=\dot q(x,t)$, so $S(x)$ will look like:
$$S(x)=\int_{t_1}^{t_2}L(q(x,t),\dot q(x,t),t)dt.$$
Now I take the partial derivative with respect to $x$ to get $p$:
$$\frac{\partial S}{\partial x}=\int_{t_1}^{t_2}\left(\frac{\partial L}{\partial q}\frac{\partial q}{\partial x}+\frac{\partial L}{\partial \dot q}\frac{\partial \dot q}{\partial x}\right)dt.$$
And now I'm stuck. I see the momentum $\frac{\partial L}{\partial \dot q}=p$ and force $\frac{\partial L}{\partial q}=F$ inside the integral, but I can't seem to get, how to extract the momentum, so that all the other things cancelled.
Am I on the right track? What should be the next step?