This was used in the answer here, in the derivation of the Lorentz force law from the Lagrangian. $u$ and $A$ are vectors, the velocity of the particle and the spacetime dependent Magnetic field
As part of the Euler Lagrange equation, we had to calculate $$\frac{\partial L}{\partial x}=\frac{\partial {(u\cdot A) }}{\partial x}$$
Since the Lagrangian treats $x$ and $u$, i.e. position and velocity, as independent variables, I think this partial derivative should treat $u$ as a constant to give:
$$\frac{\partial L}{\partial x}=\frac{\partial {(u\cdot A) }}{\partial x}$$
$$=\frac{\partial {(u_x A_x + u_yA_y +u_z A_z) }}{\partial x}$$
$$=u\cdot \frac{\partial A}{\partial x}$$
The vector form of this would be :
$$\frac{\partial L}{\partial r}=u\cdot \nabla A$$
I only got the first term. I don't understand where $u\times ({\nabla \times A})$ came from. Please help
Recall that for any vectors $a, b, c$ $$ a\times(b\times c) = (a\cdot c)b - (a\cdot b)c. $$ It is valid to manipulate $\nabla$ as a vector so long as you are aware of what you are differentiating. In the expression $$ u\times(\nabla\times A), $$ we are differentiating $A$. Let us keep track of this by putting a dot over $\nabla$ and $A$. We then see $$ u\times(\dot\nabla\times\dot A) = (u\cdot\dot A)\dot\nabla - (u\cdot\dot\nabla)\dot A = \dot\nabla(u\cdot\dot A) - (u\cdot\dot\nabla)\dot A. $$ The last equality is just from moving around the scalar quantity $u\cdot\dot A$. Since $u$ is to be treated as constant, we can now drop the dots and write in standard notation $$ u\times(\nabla\times A) = \nabla(u\cdot A) - (u\cdot\nabla) A. $$ Rearranging, we finally get $$ \nabla(u\cdot A) = (u\cdot\nabla) A + u\times(\nabla\times A). $$