The Wikipedia page on the Lorentz force states the following:
$$\boldsymbol{F}=q\left[- \boldsymbol{\nabla}(\phi-\boldsymbol{v} \cdot \boldsymbol{A})-\frac{d\boldsymbol{A}}{dt}\right]$$
which can take the convenient Euler–Lagrange form $$\boldsymbol{F}=q \left[- \boldsymbol{\nabla}_x(\phi-\boldsymbol{\dot{x}}\cdot \boldsymbol{A})+\frac{d}{dt}\boldsymbol{\nabla}_\dot{x}(\phi-\boldsymbol{\dot{x}}\cdot\boldsymbol{A})\right]$$
How did the author get from the former to the latter and what is the rationale? It seems like the author just find a convenient way to get to the end result by simply replacing the terms.