From ControlTheoryPro.com

Contents
1 Introduction to Lagrange Equations of Motion for Conservative Forces^{[1]}
In Newtonian mechanics a system is made up of point masses and rigid bodies. These are subjected to known forces. To construct equations of motion you must determine the composition of the system an the forces which act on it. Then turn that understanding into a series of equations of motion. Once the system is described an initial condition is required in order to then calculate system's behavior.
The Lagrangian description of a mechanical system is different. For Lagrangian mechanics it is assumed that the position of the system at 2 instances of time (t_{1} and t_{2}) are known (or knowable) and fixed. The system must move/behave between times t_{1} and t_{2} such that the system has the least "action". The "action" being defined by
"Action" 
where
 is called the Lagrange function or Lagrangian
 is a generalized coordinate which can represent the x, y, z of Cartesian coordinates or the θ, R of Polar coordinates, etc.
2 Degrees of Freedom^{[2]}
A particle without constraints can be anywhere in space. Thus we need 3 coordinates  x, y, z in Cartesian space  to describe its position. In the case of m dimensions and p particles there are n degrees of freedom where
' 
However, when c constraints are imposed on the particles, then the number of degrees of freedom is
' 
2.1 Generalized Coordinates
Since the coordinates could be angular displacement or electric charge we need a generalized system of coordinates. For 3 degrees of freedom we have
' 
then
' 
If the particle is constrained to move along a surface then the problem becomes one of 2 degrees of freedom and the equations become
' 
and
' 
' 
' 
3 Lagrange Equations: Work^{[3]}^{[4]}^{[5]}
The Lagrange equation of motion for the q_{1} coordinate is
.  Lagrange Equation of Motion for Conservative Forces only (no Friction) 
This is where we want to end up.
3.1 Kinetic Energy minus Potential Energy
Work is force times displacement. For our purposes the scalar value for work is
' 
This work is also equal to the change in kinetic energy which leads us to D'Alembert's equation
1a, Zak^{[6]} 
Formulation #2
1b, Wikipedia^{[7]} 
Back to Zak... The total work can be found by
2 
where:
 are the forces acting upon the particles and
 are displacements of those particles.
Substituting Eqn. (2) into Eqn. (1a) and rearranging we get
3 
Let
' 
and
' 
Then Eqn. (3) becomes
' 
3.2 Useful Equalities
Consider the portion of Eqn. (3). What does equal? Start with the differentiation of and using the product rule we get
' 
Rearranging we come to the following useful equality
4 
We also need to consider the time derivative of which is
5 
Using partial differentiation with respect to we acquire our second useful equality
6 
For our final useful equality we start with
7 
Keeping in mind that and the partial derivative is in general a function of q_{1} and q_{2}. Taking the partial derivative of Eqn. (5) with respect to q_{1} leads to
.  ' 
Remember that we assumed and therefore
.  8 
Using Eqn. (8) we can rearrange the portion of the equation
9 
Then we are left with
10 
3.3 Back to the Derivation of the Lagrange Equations of Motion for a Single Particle
Comparing the righthand sides of Eqns. (7) and (9), we get Eqn. (10). We now use Eqns. (4), (6), and (10) to arrive at the Lagrange equation of motion for a single particle. First substitute Eqns. (6) and (10) into (4) to get
11 
For reference
6 
If you have a particle with a constant acceleration a and you double integrate to get position then you get
' 
assuming zero initial conditions. If you then took the partial derivative with respect to a generalized coordinate q then
' 
Consider the above in the context of the Lagrange equation of motion for a single particle and realize that
12 
and
13 
Substituting Eqns. (12) and (13) into Eqn. (11) results in
' 
Similarly expressions for y and z can be found. Realizing this, when , Eqn. (3) becomes
14 
Let
' 
denote the kinetic energy of the particle. Then, we can represent (14) as
.  15 
Eqn. (15) is called the Lagrange equation of motion for the q_{1} coordinate. Using the same arguments as above, we cna derive the Lagrange equation of motion for the q_{2} coordinate. In general there are as many Lagrange equations of motion as there are degrees of freedom of the particle.
4 Notes
 Zak, Stanislaw H. Systems and Control. Oxford University Press, New York, 2003. ISBN 0195150112.
 Wikipedia: Lagrangian Mechanics
 Wikibooks: Classic Mechanics, Lagrangian