THE PENDULUM

theta''[t] + g/l Sin[theta[t]] == 0

L[ theta_, thetaDot_] :=
           1/2 m ( l thetaDot)^2 - m g ( l - l Cos[theta])

D[ L[ theta[t], thetaDot[t] ], theta[t] ]

Dt[ D[ L[theta[t],thetaDot[t]], thetaDot[t] ], t,
                                  Constants -> {m,g,l} ]

% - %% == 0

% /. thetaDot -> theta'

eq = Apart /@ Map[ # / (l^2 m) &, % ]

?/@

?Map

?#

?&

?Apart

Series[ #, {theta[t],0,1} ] & /@ eq

eqLinear = Normal[%]

NDSolve[ {eqLinear, theta[0]==Pi/2, theta'[0]==0}
          /. g/l -> 1 //Flatten, theta, {t,0,20} ] ;

plotlin = Plot[ Evaluate[ theta[t] /. % ], {t,0,20},
                PlotStyle -> Dashing[{0.01,0.01}] ] ;

NDSolve[ {eq, theta[0]==Pi/2, theta'[0]==0}
          /. g/l -> 1 //Flatten, theta, {t,0,20} ] ;

plotnon = Plot[ Evaluate[ theta[t] /. % ], {t,0,20} ] ;

Show[ plotnon, plotlin] ;