# Definition of generalized momenta in analytical mechanics

I've seen mainly two definitions of generalized momenta, $$p_k$$, and I wasn't sure which one is always true/ the correct one: $$p_k\equiv\dfrac{\partial\mathcal T}{\partial \dot q_k}\text{ and }p_k\equiv\dfrac{\partial\mathcal L}{\partial \dot q_k}.$$

I've seen mostly written the $$2$$nd one. Notice that if the potential energy is velocity independent, the $$2$$nd definiton reduces to $$1$$st. What about the general case?

I've seen mainly two definitions of generalized momenta, $$p_k$$, and I wasn't sure which one is always true/ the correct one: $$p_k\equiv\dfrac{\partial\mathcal T}{\partial \dot q_k}\text{ and }p_k\equiv\dfrac{\partial\mathcal L}{\partial \dot q_k}.$$
I've seen mostly written the $$2$$nd one. Notice that if the potential energy is velocity independent, the $$2$$nd definiton reduces to $$1$$st. What about the general case?
In the general case, we use the latter definition for the "generalized" or "canonical" momentum: $$p_k \equiv \frac{\partial L}{\partial \dot q_k}\;,\tag{1}$$ where $$L = T - U\;,$$ where $$T$$ is the kinetic energy and $$U$$ is the potential energy.
The term: $$\pi_k \equiv \frac{\partial T}{\partial \dot q_k}\;,\tag{2}$$ is usually called the "mechanical" momentum, to contrast it with the "generalized" or "canonical" momentum.
A common case where Eq. (1) and Eq. (2) differ is when we use a Lagrangian to describe the dynamics of a particle in an electromagnetic field. The difference is due to the velocity-dependent part of the electromagnetic potential: $$e\vec v \cdot \vec A$$, where $$\vec A$$ is the vector potential, $$e$$ is the charge, and $$\vec v$$ is the velocity.