There is something I'm missing. I am at page 22-23 of Goldstein Classical Mechanics 3rd ed. Lorentz force can be derived from the Lagrangian
$$L=T-U$$ where $T$ is the kinetic energy $$T= \dfrac{1}{2}m\dot{x}^2 , $$ and $U$ is the potential energy
$$U=q\phi-q\mathbf{A}\cdot\mathbf{v}$$
where $\phi(t,x,y,z)$ is a scalar potential and $\mathbf{A}(t,x,y,z)$ is a vector potential.
I'm trying to solve this with Lagrange equations for the x coordinate, and for the term
$$\frac{d}{dt}\big(\frac{\partial{L}}{\partial\dot{x}}\big)$$
I'll show you how I'm trying to compute this with detail:
$$\frac{d}{dt}\big(\frac{\partial{L}}{\partial\dot{x}}\big)=m\ddot{x}-q\frac{d}{dt}(\frac{\partial{}}{\partial{\dot{x}}}\phi)+q\frac{d}{dt}(\frac{\partial\mathbf{A}}{\partial{\dot{x}}}\cdot\mathbf{v}+\frac{\partial\mathbf{v}}{\partial{\dot{x}}}\cdot\mathbf{A})$$
Now, here's my big problem, I'll may have some trouble understanding the condition in which I can interchange the differentiation with respect to $\dot{x}$ and $t$, i.e for example,
$$q\frac{d}{dt}(\frac{\partial{}}{\partial{\dot{x}}}\phi)=q\frac{\partial{}}{\partial{\dot{x}}}(\frac{d}{dt}\phi)$$
This is done some pages before when Goldstein is deriving the lagrange equations, and I solved a problem in this chapter usig this. So now I have:
$$q\frac{\partial{}}{\partial{\dot{x}}}(\frac{\partial{}}{\partial{x}}\phi\frac{dx}{dt}+\frac{\partial{}}{\partial{y}}\phi\frac{dy}{dt}+\frac{\partial{}}{\partial{z}}\phi\frac{dz}{dt}+\frac{\partial{}}{\partial{t}}\phi)$$
Now I have looked now for many hours for many ways in which this derivation is made and the expression above vanishes, but I don't understand why, is it because I'm assuming x,y,z in the scalar potential are functions of time themselves? If not I can see why it would vanish. Also, this vanishes because I can't exchange the order of differentiation?
I totally see what you mean, I was applying it wrong, after you answered me I encountered that final term $\frac{\partial \phi}{\partial q_i}$, I had to substract it because it was actually:
$$q\frac{d}{dt}(\frac{\partial{}}{\partial{\dot{x}}}\phi)=q[\frac{\partial{}}{\partial{\dot{x}}}(\frac{d}{dt}\phi)-\frac{\partial f}{\partial q_i}]$$
Thanks a lot you're awesome!