I was told the following Lagrangian is for a charged particle with spin moving in a constant magnetic field: $$ L = \frac{\left ( \vec p \right ) ^2}{2m} + \vec \mu \cdot \vec B$$
Let's just say $B$ is just constant in the $z$ direction, and not dependent on position. Then wouldn't the Lagrange equation give us $\dot p_x=0$ because the Lagrangian does not depend on $x$? This is obviously wrong because the particle will accelerate due to the Lorentz force. What mistake am I making? Or is this Lagrangian just wrong (the ones I've seen before use a vector potential)?