# Is the potential term in a Lagrangian velocity-dependent?

I know that the Lagrangian of a system has to be dependent on the coordinate (as the type of potential in it is dependent on the coordinate) and on velocity and time (per KE and PE, respectively). This leaves us with a restricted condition for the type of potentials that we can deal with, potentials depend only on time and coordinates, nothing further than that. In detail, one can derive from scratch the following (so called Lagrange's Equation) $$\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial T}{\partial\dot{q}_i}\right)-\frac{\partial T}{\partial q_i}=Q_i\tag{1}$$ where $$q_i$$'s are generalized coordinates, $$T$$ is the kinetic energy, and $$Q_j:=F_{i}\frac{\partial x^i}{\partial q^j}$$ are generalized forces. (For further detail, here $$x^i=x^i(q_1,q_2,q_3,t)$$ and $$\delta W=F_i \delta x^i$$.) Let us assume that force $$Q_i$$ has potential so that it can be expressed as $$\boxed{Q_i=-\frac{\partial U}{\partial q_i}.}$$ Then $$(1)$$ can be expressed as \begin{align*} \frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial T}{\partial\dot{q}_i}\right)-\frac{\partial T}{\partial q_i}-Q_i&=\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial T}{\partial\dot{q}_i}\right)-\frac{\partial T}{\partial q_i}+\frac{\partial U}{\partial q_i}\\ &=\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial T}{\partial\dot{q}_i}\right)-\frac{\partial }{\partial q_i}(T-U)=0\tag{2} \end{align*} and if we restrict $$U$$ in a way that $$\boxed{\frac{\partial U}{\partial \dot{q}_i}=0}$$, then we can plug $$U$$ in $$(2)$$ as in the following $$\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial }{\partial\dot{q}_i}(T-U)\right)-\frac{\partial }{\partial q_i}(T-U)=0$$ and finally we get the Euler-Lagrange equation $$\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial L}{\partial\dot{q}_i}\right)-\frac{\partial L}{\partial q_i}=0$$ where $$L=T-U$$.

One condition when we came up with this equation is the restriction of the potential function, that it mustn't be velocity dependent. So how one can apply/expand the Lagrangian so that it can describe, say, velocity-dependent (or even with higher order) potential?

1. That seems to be a misunderstanding. Velocity-dependent/generalized potentials $$U(q,\dot{q},t)$$ are allowed in Lagrangian mechanics. See e.g. this, this, this & this related Phys.SE posts.
2. It should be stressed that a generalized force $$Q_j$$ might not have a potential, not even a velocity-dependent/generalized potential. Example: Dissipative forces.
The lagrangian used to describe to Lorentz force for example, has a velocity dependent potential. The potential energy is $$U = q \phi - q\vec{A} \cdot \dot{\vec{r}}$$ which is sometimes called the generalised potential. The kinetic energy is $$T = \frac{m}{2} \dot{\vec{r}} \cdot \dot{\vec{r}}$$. The procedure is the same as with a potential not depending on the velocity. You can find the full derivation on the wikipedia page : https://en.wikipedia.org/wiki/Lorentz_force or here Charge, velocity-dependent potentials and Lagrangian.