syms t th1 = sin(t);th2 = cos(t);x=th1+th2;T= diff(x)^2+diff(th1)^2+diff(th2)^2 +th1*th2;T=simplify( T) % 2 - sin(2*t)/2 = 2-th1*th2pTth1=th2;pTDth1=2*diff(th1);dtpTDth1=2*diff(th1,2);