How is the electromagnetic Lagrangian derived? I've been studying from the book called "path integral formulation" by Feynman and Hibbs. 
In chapter 4, problem 4.2, they refer to the electromagnetic Lagrangian as:
$$
L=\frac{1}{2} m \dot{x}^2+ \frac{e}{c} \vec{\dot{x}} \dot{}\vec{A}(x,t)-e\phi(x,t)
$$
I tried searching for the possible origin of the equation but can't seem to find any. Any help with the proof? if this is an empirical observation that, taken this way, seems to re-derive the electromagnetic laws, then some help with intuitively imagining why this equation might be true would be of great help.
 A: This is a consequence of a theorem from classical mechanics.
The magnetic force is non conservative and so it is not suitable for the standard approach to the Lagrange formalism. 
The form that the Lagrange equations normally take is:
$$ {d \over dt} { \partial L \over d \dot q_i} -{ \partial L \over d q_i}=0$$ 
This only holds for conservative Systems (Potentials not dependent on speed). But for Potentials $U(q_1,...,\dot q_1,...,t)$  depending on speed that can be arranged in a special form there is an exception. That is, only if they can be arranged so that the force they represent can be rewritten as:
$$F_j={d \over dt} { \partial U \over d \dot q_j}-{ \partial U \over d q_i} $$
Luckily for us this is the case for the electromagnetic force, the potential of the form:
$$U= q(\Phi - \dot{ \vec{x}} \vec A)$$fulfills the requirement above.
But your question was why this is. If you Only demand independent coordinates, and not conservative Potentials, the d'Alambert priciple which is equivalent, to the Lagrange equation takes the Form: $$F_j={d \over dt}{ \partial T \over d \dot q_j}-{ \partial T \over d q_i}$$
where T is the kinetic Energy and $F_j$ a generalized force.
It is obvious that if you can write the force in the form given above we get back to the good old Lagrange equation with $L=T-U$. 
A: This paper seems to have nice explanation: https://people.ifm.liu.se/irina/teaching/sem4.pdf
Briefly, Lagrangian you see is derived as energy that a moving charged particle will have in electromagnetic field. This is purely theoretical observation constructed as sum of potential energy of particle with mass $m$, charged particle moving in magnetic field that is described by equations: $B=\nabla \times A$, $E = -\nabla\phi - \delta A/\delta t$, in one-dimentional potential $\phi$.
