Lagrange's equation

Lag[
        q_] := D[D[T, q'[t]], t]-D[T, q[t]]+D[V, 
          q[t]]

example 8.8  p.188

T := (1/2) m x'[t]^2 + (1/2) id θ'[t]^2 /. 
        id ->  m rd^2
V := (1/2) kb1 x1[t]^2 + (1/2) kb2 x2[t]^2

ttbg = {{1, -L1}, {1, L2}};
ttgb = Inverse[ttbg] /. L1 + L2 -> L

ttgb . {x1[t], x2[t]}

ClearAll[x1, x2]
x[t_] := (ttgb . {x1[t], 
              x2[t]})[[1]]
θ[
        t_] := (ttgb . {x1[t], 
              x2[t]})[[2]]
{δ[t], θ[t]}

eq1 = Simplify[Lag[x1]]
eq2 = Simplify[Lag[x2]]

ClearAll[x, θ]
x1[t_] := (ttbg . {x[t], θ[
                t]})[[1]]
x2[t_] := (ttbg . {x[t], θ[
                t]})[[2]]
{x1[t], x2[t]}

eq1 = Simplify[Lag[x]]
eq2 = Simplify[Lag[θ]]

external force

bbg={{1, 1}, {-a1, 
          a2}}

Transpose[ttgb] . bbg