# When can I treat vectors as regular variables when differentiating?

Given this Lagrangian where $\dot{\vec r} = \left(\dot x, \dot y, \dot z\right)^T$: $$L = \frac m2 \left|\dot{\vec r}\right|^2 - q \left( \phi - \left\langle \dot{\vec r}, \vec A \right\rangle \right)$$

Now I need to calcuate the canonical momenta like so: $$p_x = \frac{\partial L}{\partial \dot x} , \quad p_y = \frac{\partial L}{\partial \dot y} , \quad p_z = \frac{\partial L}{\partial \dot z}$$

The $\frac{\partial \dot r^2}{\partial \dot x}$ will be feasable, but quite a bit of work.

Then I will have to put the three momenta together into a momentum vector: $$\vec p = \left( p_x, p_y, p_z \right)^T$$

It will turn out that I could just have calculated this and be done with it: $$\vec p = \frac{\partial L}{\partial \vec{\dot r}}$$

How do I know when I can just treat the vectors as regular symbols, without worrying how they are represented in a coordinate system like $(x, y, z)$?

-
I don't understand "The $\frac{\partial \dot r^2}{\partial \dot x}$ will be feasible, but quite a bit of work". I presume that you meant $\frac{\partial \dot{\vec r}^2}{\partial \dot x}$, since $\dot r^2$ doesn't occur anywhere. If so, since $\dot{\vec r}^2=\dot x^2+\dot y^2+\dot z^2$, the derivative $\frac{\partial \dot{\vec r}^2}{\partial \dot x}$ is easy to take. – joriki Sep 11 '12 at 17:33
What I mean is that writing each step out in the $(x, y, z)$ components does work fine, but is more work than just deriving with respect to $\dot{\vec r}$. – Martin Ueding Sep 11 '12 at 17:44
The verb for forming the derivative is "differentiate", not "derive". The expression "quite a bit" roughly means "a lot"; perhaps you meant "a bit"? – joriki Sep 11 '12 at 18:07