restart:
with(DEtools):
local D:
alias(x=x(t),theta=theta(t)):
x__1,y__1:=x+l*sin(theta),l*(1-cos(theta)):
T:=1/2*m*(diff(x,t))^2+1/2*m__1*((diff(x__1,t))^2+(diff(y__1,t))^2):
diff(T,diff(x,t)):
Error, invalid input: diff received diff(x(t), t), which is not valid for its 2nd argument