syms si1rt1 si1rtm1  si1rtm2 si1rt % evaluation for (j+1)-th ray
syms sim1rt1 sim1rtm1  sim1rtm2 sim1rt%evaluation for (j-1)-th ray
syms sim2rt si2rt sim2rt1 si2rt1%evaluation for (j+2)-th and (j-2)-th rays
syms s0 %(i,j,k)
syms sirm1 sirm2 sir1 sir2% evulation for (i,j) ray
syms dir1 dir2 dirm1 dirm2 
syms dim1rthetam2 dim1rtheta1 dim1rthetam1 dim1rtheta di1rtheta di1rtheta1 di1rthetam1 di1rthetam2 di2rtheta di2rtheta1 dim2rtheta dim2rtheta1

sr=-(-dir2^2*dir1^3*dirm1^4*s0+dir2^2*dirm1^4*dir1^3*sirm2+dir2^3*dirm2^2*dir1^4*s0-dir2^3*dirm1^4*dir1^2*sirm2+dir2^3*dirm1^4*dirm2^2*sir1-dir2^3*dirm1^4*dirm2^2*s0+dir2^2*dir1^3*dirm2^4*s0-dir2^2*dirm2^4*dir1^3*sirm1-dirm2^2*dir1^3*dirm1^4*sir2-dir2^3*dirm2^2*dir1^4*sirm1+dir2^3*dirm2^4*dirm1^2*s0+dir2^3*dirm2^4*dir1^2*sirm1+dir2^3*dir1^2*dirm1^4*s0-dir2^3*dirm2^4*dirm1^2*sir1+dir2^2*dirm2^3*dirm1^4*s0+dir2^2*dirm2^3*dir1^4*sirm1-dir2^2*dirm2^3*dirm1^4*sir1-dir2^2*dirm2^3*dir1^4*s0-dir2^2*dirm1^3*dir1^4*sirm2+dir2^2*dirm1^3*dir1^4*s0+dir2^4*dirm1^3*dirm2^2*s0+dir2^4*dirm2^3*dirm1^2*sir1+dir2^2*dirm1^3*dirm2^4*sir1-dir2^2*dirm1^3*dirm2^4*s0-dirm2^3*dir1^2*dirm1^4*s0-dirm2^3*dirm1^2*dir1^4*sir2+dirm2^3*dirm1^2*dir1^4*s0+dirm2^3*dir1^2*dirm1^4*sir2-dirm1^2*dir1^3*dirm2^4*s0-dir2^4*dirm1^3*dirm2^2*sir1+dir2^3*dirm1^2*dir1^4*sirm2-dir2^3*dirm1^2*dir1^4*s0-dir2^3*dir1^2*dirm2^4*s0+dirm2^2*dir1^3*dirm1^4*s0-dirm1^3*dir1^2*dirm2^4*sir2-dir2^4*dirm1^2*dir1^3*sirm2-dir2^4*dirm1^3*dir1^2*s0-dir2^4*dirm2^3*dirm1^2*s0+dirm1^2*dir1^3*dirm2^4*sir2+dir2^4*dirm1^3*dir1^2*sirm2+dir2^4*dirm1^2*dir1^3*s0-dir2^4*dirm2^3*dir1^2*sirm1+dir2^4*dirm2^3*dir1^2*s0+dir2^4*dirm2^2*dir1^3*sirm1-dir2^4*dirm2^2*dir1^3*s0+dirm1^3*dir1^2*dirm2^4*s0+dirm1^3*dirm2^2*dir1^4*sir2-dirm1^3*dirm2^2*dir1^4*s0)/dir2/dirm1/dir1/dirm2/(dir2^2*dirm1*dirm2^3+dirm2^2*dir1^3*dirm1-dir2*dirm1^3*dir1^2-dirm2^3*dir1^2*dirm1-dir2^2*dirm1*dir1^3+dirm1^3*dir1^2*dirm2+dir2^3*dirm1*dir1^2+dirm2^3*dirm1^2*dir1-dir2*dirm2^2*dir1^3-dir2^2*dirm2*dirm1^3-dirm1^2*dir1^3*dirm2-dirm1^2*dir2*dirm2^3-dirm1^3*dirm2^2*dir1+dir2^3*dirm2^2*dir1+dirm2^2*dir2*dirm1^3-dir2^3*dirm2*dir1^2-dir2^3*dir1*dirm1^2+dirm1^2*dir2^3*dirm2+dir2*dir1^3*dirm1^2+dir2^2*dir1*dirm1^3+dir2*dirm2^3*dir1^2-dirm2^2*dir2^3*dirm1-dir2^2*dirm2^3*dir1+dir2^2*dirm2*dir1^3);
srr=2*(-dir1^3*dirm1*dirm2^4*s0+dir1^3*dirm1*dirm2^4*sir2-dir2^4*dirm2^3*dir1*sirm1+dir2^4*dirm2^3*dir1*s0+dir2^4*dirm1^3*s0*dirm2+dir2*dir1^3*dirm2^4*s0+dir1^3*dirm1^4*s0*dirm2+dir2^4*dirm1^3*dir1*sirm2-dir2^4*dirm1^3*sir1*dirm2-dir2^4*dirm1^3*dir1*s0-dir2^4*s0*dirm1*dirm2^3+dirm1^3*dir1*dirm2^4*s0-dir1^3*dirm1^4*sir2*dirm2-dirm1^3*dir1*dirm2^4*sir2-dir1^4*sir2*dirm1*dirm2^3-dirm1^3*dir1^4*s0*dirm2+dir1^4*s0*dirm2^3*dirm1-dirm2^3*dir1*dirm1^4*s0+dirm2^3*dir1*dirm1^4*sir2+dirm1^3*dir1^4*sir2*dirm2+dir2^4*sir1*dirm1*dirm2^3+dir2*dirm1^3*sir1*dirm2^4+dir2^4*dir1^3*sirm1*dirm2-dir2^4*dir1^3*s0*dirm2-dir2*dir1^3*dirm1^4*s0+dir2*dirm1^4*dir1^3*sirm2-dir2*dirm1^3*dir1^4*sirm2+dir2*dirm1^3*dir1^4*s0-dir2*dirm1^3*s0*dirm2^4+dir2*dir1^4*dirm2^3*sirm1-dir2*dir1^4*dirm2^3*s0+dir2*s0*dirm1^4*dirm2^3-dir2*sir1*dirm1^4*dirm2^3-dir2*dirm2^4*dir1^3*sirm1+dir2^4*dirm1*dir1^3*s0-dir2^4*dirm1*dir1^3*sirm2-dir2^3*dirm1^4*dir1*sirm2+dir2^3*dir1^4*s0*dirm2-dir2^3*dir1^4*sirm1*dirm2-dir2^3*dirm1^4*s0*dirm2-dir2^3*dirm1*dirm2^4*sir1-dir2^3*s0*dirm2^4*dir1+dir2^3*dir1*sirm1*dirm2^4+dir2^3*dirm1^4*dir1*s0-dir2^3*dir1^4*dirm1*s0+dir2^3*dir1^4*dirm1*sirm2+dir2^3*dirm1*dirm2^4*s0+dir2^3*dirm1^4*sir1*dirm2)/dir2/dir1/(dir2^2*dirm1*dirm2^3+dirm2^2*dir1^3*dirm1-dir2*dirm1^3*dir1^2-dirm2^3*dir1^2*dirm1-dir2^2*dirm1*dir1^3+dirm1^3*dir1^2*dirm2+dir2^3*dirm1*dir1^2+dirm2^3*dirm1^2*dir1-dir2*dirm2^2*dir1^3-dir2^2*dirm2*dirm1^3-dirm1^2*dir1^3*dirm2-dirm1^2*dir2*dirm2^3-dirm1^3*dirm2^2*dir1+dir2^3*dirm2^2*dir1+dirm2^2*dir2*dirm1^3-dir2^3*dirm2*dir1^2-dir2^3*dir1*dirm1^2+dirm1^2*dir2^3*dirm2+dir2*dir1^3*dirm1^2+dir2^2*dir1*dirm1^3+dir2*dirm2^3*dir1^2-dirm2^2*dir2^3*dirm1-dir2^2*dirm2^3*dir1+dir2^2*dirm2*dir1^3)/dirm2/dirm1;
sr3=-6*(dir2^2*dir1^4*s0*dirm2+dir2^4*dirm1^2*s0*dirm2+dirm1*dir1^2*dirm2^4*sir2-dirm1^4*s0*dirm2^2*dir1+dir2^4*dir1^2*sirm1*dirm2-dir1^2*dirm2^4*dirm1*s0-dirm1^2*dir1^4*s0*dirm2+dirm1^2*dir1*dirm2^4*s0-dir2^2*dir1^4*sirm1*dirm2-dir2^2*dirm1^4*s0*dirm2-dir2^4*dir1^2*s0*dirm2-dir2^2*dirm1*dirm2^4*sir1-dir2^2*s0*dirm2^4*dir1+dir2^2*dir1*sirm1*dirm2^4-dir2*dir1^2*dirm1^4*s0+dir2*dirm1^4*dir1^2*sirm2-dir2*dirm1^4*dirm2^2*sir1+dir2*dirm1^4*dirm2^2*s0+dir2*dirm1^2*dir1^4*s0-dir2*dirm1^2*dir1^4*sirm2-dir2*dirm1^2*dirm2^4*s0+dir2*dirm1^2*dirm2^4*sir1-dir2*dirm2^4*dir1^2*sirm1+dir1^4*s0*dirm2^2*dirm1-dir2^4*dirm1*dirm2^2*s0-dir2^4*dir1*sirm1*dirm2^2+dir2^4*dirm1*dir1^2*s0+dir2^4*dirm1^2*dir1*sirm2-dir2^4*dirm1^2*dir1*s0+dir2^4*s0*dirm2^2*dir1-dir2^2*dirm1^4*dir1*sirm2+dir2^2*dirm1^4*dir1*s0-dir2^2*dir1^4*dirm1*s0+dir2^2*dir1^4*dirm1*sirm2+dir2^2*dirm1*dirm2^4*s0-dir2^4*dirm1*dir1^2*sirm2+dir2^4*dirm1*dirm2^2*sir1-dir2^4*dirm1^2*sir1*dirm2+dir1^2*dirm1^4*s0*dirm2+dir2^2*dirm1^4*sir1*dirm2+dirm1^4*dir1*sir2*dirm2^2-dirm1*dir1^4*dirm2^2*sir2-dirm1^2*dir1*dirm2^4*sir2+dirm1^2*dir1^4*sir2*dirm2-dir1^2*dirm1^4*sir2*dirm2+dir2*dir1^4*sirm1*dirm2^2-dir2*dir1^4*s0*dirm2^2+dir2*dir1^2*dirm2^4*s0)/dir2/dirm1/dir1/(dir2^2*dirm1*dirm2^3+dirm2^2*dir1^3*dirm1-dir2*dirm1^3*dir1^2-dirm2^3*dir1^2*dirm1-dir2^2*dirm1*dir1^3+dirm1^3*dir1^2*dirm2+dir2^3*dirm1*dir1^2+dirm2^3*dirm1^2*dir1-dir2*dirm2^2*dir1^3-dir2^2*dirm2*dirm1^3-dirm1^2*dir1^3*dirm2-dirm1^2*dir2*dirm2^3-dirm1^3*dirm2^2*dir1+dir2^3*dirm2^2*dir1+dirm2^2*dir2*dirm1^3-dir2^3*dirm2*dir1^2-dir2^3*dir1*dirm1^2+dirm1^2*dir2^3*dirm2+dir2*dir1^3*dirm1^2+dir2^2*dir1*dirm1^3+dir2*dirm2^3*dir1^2-dirm2^2*dir2^3*dirm1-dir2^2*dirm2^3*dir1+dir2^2*dirm2*dir1^3)/dirm2;
sr4=24/dir2*(-dirm1^3*s0*dirm2^2*dir1+dirm1^3*s0*dirm2*dir1^2+dir1^3*s0*dirm2^2*dirm1-dir2*dirm2^3*dir1^2*sirm1+dir2*dirm2^3*dir1^2*s0+dir2*dirm2^2*dir1^3*sirm1-dir2*dirm2^2*dir1^3*s0-s0*dirm1*dirm2^3*dir1^2-dir1^3*s0*dirm2*dirm1^2+dir2^3*s0*dirm2^2*dir1+dir2^2*dirm2^3*dir1*sirm1-dir2^2*dirm2^3*dir1*s0-dir2^3*dirm1*dirm2^2*s0-dir2^3*dir1*sirm1*dirm2^2+dir2^3*dirm1^2*dir1*sirm2-dir2^2*dir1^3*dirm1*s0+sir2*dirm1^2*dir1^3*dirm2+s0*dirm1^2*dir1*dirm2^3+dirm1^2*dir1^3*dir2*s0+dir2^3*dir1^2*dirm1*s0+dir2^2*dirm1^3*dir1*s0-dir1^2*dirm1^3*dir2*s0-dir2^3*dirm1^2*dir1*s0+sir2*dirm1*dir1^2*dirm2^3-sir2*dirm1*dir1^3*dirm2^2-sir2*dirm1^3*dir1^2*dirm2+sir2*dirm1^3*dir1*dirm2^2-sir2*dirm1^2*dir1*dirm2^3-dir2*dirm1^3*dirm2^2*sir1+dir2^3*dirm1^2*s0*dirm2+dir2^3*dir1^2*sirm1*dirm2-dir2^3*dir1^2*s0*dirm2-dir2*dirm1^2*dir1^3*sirm2-dir2*dirm2^3*dirm1^2*s0+dir2*dirm1^3*dir1^2*sirm2-dir2^2*dirm1^3*s0*dirm2+dir2*dirm1^3*dirm2^2*s0+dir2*dirm2^3*dirm1^2*sir1-dir2^3*dirm1*dir1^2*sirm2+dir2^3*dirm1*dirm2^2*sir1-dir2^3*dirm1^2*sir1*dirm2-dir2^2*dirm1^3*dir1*sirm2+dir2^2*dirm1^3*sir1*dirm2+dir2^2*s0*dirm1*dirm2^3-dir2^2*sir1*dirm1*dirm2^3-dir2^2*dir1^3*sirm1*dirm2+dir2^2*dir1^3*s0*dirm2+dir2^2*dirm1*dir1^3*sirm2)/dirm1/dir1/dirm2/(dir2^2*dirm1*dirm2^3+dirm2^2*dir1^3*dirm1-dir2*dirm1^3*dir1^2-dirm2^3*dir1^2*dirm1-dir2^2*dirm1*dir1^3+dirm1^3*dir1^2*dirm2+dir2^3*dirm1*dir1^2+dirm2^3*dirm1^2*dir1-dir2*dirm2^2*dir1^3-dir2^2*dirm2*dirm1^3-dirm1^2*dir1^3*dirm2-dirm1^2*dir2*dirm2^3-dirm1^3*dirm2^2*dir1+dir2^3*dirm2^2*dir1+dirm2^2*dir2*dirm1^3-dir2^3*dirm2*dir1^2-dir2^3*dir1*dirm1^2+dirm1^2*dir2^3*dirm2+dir2*dir1^3*dirm1^2+dir2^2*dir1*dirm1^3+dir2*dirm2^3*dir1^2-dirm2^2*dir2^3*dirm1-dir2^2*dirm2^3*dir1+dir2^2*dirm2*dir1^3);

stheta=(-dtheta)*(2*dim2rtheta*dtheta^2*dim2rtheta1*di1rthetam2-2*dim2rtheta*dtheta^2*dim2rtheta1^2+2*dim2rtheta*dtheta^2*dim2rtheta1*di1rthetam1+2*dim2rtheta*dtheta^2*dim2rtheta1*di1rtheta-2*dim2rtheta1*dtheta^2*dim2rtheta^2+(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam2*dtheta+(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam1*dtheta-(-dtheta2)*di2rtheta1^2*di2rtheta*dtheta+(-dtheta2)*di2rtheta1*di2rtheta*di1rtheta*dtheta-(-dtheta2)*di2rtheta1*di2rtheta^2*dtheta-4*(-dtheta2)*di1rtheta*dtheta*di1rthetam2*di1rthetam1+(-dtheta2)^2*di2rtheta1^2*di2rtheta-(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2-(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1-(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta+2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+di2rtheta1*di2rtheta^2*(-dtheta2)^2)/dtheta/(-dtheta*di1rtheta1^2*di1rthetam2*(-dtheta2)^2-dtheta*di1rtheta1^2*di1rtheta*(-dtheta2)^2-dtheta*di1rtheta1^2*di1rthetam1*(-dtheta2)^2-3*dtheta*(-dtheta2)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)-(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+3*dtheta^2*di1rtheta1^2*di1rthetam1*(-dtheta2)+3*dtheta^2*di1rtheta1^2*di1rthetam2*(-dtheta2)+3*dtheta^2*di1rtheta1^2*di1rtheta*(-dtheta2)+2*di1rtheta1^2*dtheta^2*di1rtheta*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1^3*(-dtheta)+2*di1rtheta1*dtheta^3*di1rthetam2*di1rtheta+2*di1rtheta1*dtheta^3*di1rtheta*di1rthetam1+2*di1rtheta1^2*dtheta^2*di1rthetam2*(-dtheta)+2*di1rtheta1*dtheta^3*di1rthetam2*di1rthetam1-2*di1rtheta*dtheta^3*di1rthetam2*di1rthetam1+2*di1rtheta1^2*dtheta^2*di1rthetam1*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+2*dtheta^3*di1rtheta1^3+(-dtheta)*di1rtheta1^2*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta1^2*di1rtheta*(-dtheta2)^2+(-dtheta)*di1rtheta1^2*di1rthetam2*(-dtheta2)^2+2*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rthetam2*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rtheta*(-dtheta)-2*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+dtheta*di1rtheta1^3*(-dtheta2)^2-(-dtheta)*di1rtheta1^3*(-dtheta2)^2-3*dtheta^2*di1rtheta1^3*(-dtheta2)-2*di1rtheta1^2*dtheta^3*di1rthetam2-2*di1rtheta1^2*dtheta^3*di1rthetam1-2*dtheta^2*di1rtheta1^3*(-dtheta)-2*di1rtheta1^2*dtheta^3*di1rtheta+dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2)*(si1rt1-s0-sr*di1rtheta1-1/2*srr*di1rtheta1^2-1/6*sr3*di1rtheta1^3-1/24*sr4*di1rtheta1^4)-(-dtheta)*(2*dim2rtheta*dtheta^2*dim2rtheta1*di1rtheta1-2*dim2rtheta*dtheta^2*dim2rtheta1^2-2*dim2rtheta1*dtheta^2*dim2rtheta^2+2*dim2rtheta*dtheta^2*dim2rtheta1*di1rtheta+2*dim2rtheta*dtheta^2*dim2rtheta1*di1rthetam2-4*dtheta*di1rtheta1*(-dtheta2)*di1rtheta*di1rthetam2+dtheta*di2rtheta1*di2rtheta*di1rtheta1*(-dtheta2)+(-dtheta2)*di2rtheta1*di2rtheta*di1rtheta*dtheta-(-dtheta2)*di2rtheta1^2*di2rtheta*dtheta+(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam2*dtheta-(-dtheta2)*di2rtheta1*di2rtheta^2*dtheta-(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta+2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta2)^2*di2rtheta1*di2rtheta*di1rtheta1+(-dtheta2)^2*di2rtheta1^2*di2rtheta+di2rtheta1*di2rtheta^2*(-dtheta2)^2-(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2)/dtheta/(2*dtheta^2-3*(-dtheta2)*dtheta+(-dtheta2)^2)/(-di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-(-dtheta)*di1rthetam1^2*di1rtheta+di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)+di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)+di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)-(-dtheta)*di1rthetam1^2*di1rtheta1-(-dtheta)*di1rthetam1^2*di1rthetam2-dtheta*di1rthetam1^3+di1rthetam1^2*dtheta*di1rthetam2+di1rthetam1^2*dtheta*di1rtheta+di1rthetam1^2*dtheta*di1rtheta1+(-dtheta)*di1rthetam1^3-di1rtheta1*dtheta*di1rtheta*di1rthetam1-di1rtheta*dtheta*di1rthetam2*di1rthetam1+di1rtheta1*dtheta*di1rthetam2*di1rtheta-di1rtheta1*dtheta*di1rthetam2*di1rthetam1)*(si1rtm1-s0-sr*di1rthetam1-1/2*srr*di1rthetam1^2-1/6*sr3*di1rthetam1^3-1/24*sr4*di1rthetam1^4)-(-dtheta)*(-(-dtheta2)*di2rtheta1*di2rtheta*di1rtheta*dtheta-2*dim2rtheta*dtheta^2*dim2rtheta1*di1rtheta+(-dtheta2)^2*di2rtheta1*di2rtheta*di1rtheta1-2*dim2rtheta*dtheta^2*dim2rtheta1*di1rthetam1-(-dtheta2)^2*di2rtheta1^2*di2rtheta-di2rtheta1*di2rtheta^2*(-dtheta2)^2+2*dim2rtheta*dtheta^2*dim2rtheta1^2+2*dim2rtheta1*dtheta^2*dim2rtheta^2+4*di1rtheta1*dtheta*di1rtheta*di1rthetam1*(-dtheta2)-2*di1rtheta1*di1rthetam1*di1rtheta*(-dtheta2)^2+(-dtheta2)*di2rtheta1^2*di2rtheta*dtheta+(-dtheta2)*di2rtheta1*di2rtheta^2*dtheta+(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta-2*dim2rtheta*dtheta^2*dim2rtheta1*di1rtheta1-(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam1*dtheta-dtheta*di2rtheta1*di2rtheta*di1rtheta1*(-dtheta2)+(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1)/dtheta/(dtheta*di1rthetam2^3+di1rtheta1*dtheta*di1rthetam2*di1rthetam1+di1rtheta1*dtheta*di1rthetam2*di1rtheta+di1rtheta*dtheta*di1rthetam2*di1rthetam1-dtheta*di1rthetam2^2*di1rthetam1-di1rtheta*dtheta*di1rthetam2^2-di1rthetam2^2*dtheta*di1rtheta1-di1rtheta1*dtheta*di1rtheta*di1rthetam1+di1rthetam2^2*di1rtheta1*(-dtheta)+di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+(-dtheta)*di1rthetam2^2*di1rtheta+(-dtheta)*di1rthetam2^2*di1rthetam1-di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)-di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-(-dtheta)*di1rthetam2^3)/(2*dtheta^2-3*(-dtheta2)*dtheta+(-dtheta2)^2)*(si1rtm2-s0-sr*di1rthetam2-1/2*srr*di1rthetam2^2-1/6*sr3*di1rthetam2^3-1/24*sr4*di1rthetam2^4)+(-dtheta)*(4*dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)-2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-2*dim2rtheta*dtheta^2*dim2rtheta1*di1rtheta1-dtheta*di2rtheta1*di2rtheta*di1rtheta1*(-dtheta2)+(-dtheta2)^2*di2rtheta1*di2rtheta*di1rtheta1-2*dim2rtheta*dtheta^2*dim2rtheta1*di1rthetam1-(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam1*dtheta+(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1-2*dim2rtheta*dtheta^2*dim2rtheta1*di1rthetam2+2*dim2rtheta1*dtheta^2*dim2rtheta^2+2*dim2rtheta*dtheta^2*dim2rtheta1^2-(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam2*dtheta+(-dtheta2)*di2rtheta1^2*di2rtheta*dtheta+(-dtheta2)*di2rtheta1*di2rtheta^2*dtheta+(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2-di2rtheta1*di2rtheta^2*(-dtheta2)^2-(-dtheta2)^2*di2rtheta1^2*di2rtheta)/dtheta/(-2*di1rtheta^2*dtheta^2*di1rtheta1*(-dtheta)-2*di1rtheta^2*dtheta^2*di1rthetam2*(-dtheta)-3*dtheta^2*di1rtheta^2*di1rthetam2*(-dtheta2)-2*di1rtheta^2*dtheta^2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta^2*di1rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)+(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta^3*(-dtheta2)^2-2*di1rtheta1*dtheta^3*di1rthetam2*di1rtheta-2*di1rtheta1*dtheta^3*di1rtheta*di1rthetam1+2*di1rtheta1*dtheta^3*di1rthetam2*di1rthetam1-2*di1rtheta*dtheta^3*di1rthetam2*di1rthetam1-(-dtheta)*di1rtheta^2*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta^2*di1rthetam2*(-dtheta2)^2+dtheta*di1rtheta^2*di1rtheta1*(-dtheta2)^2+dtheta*di1rtheta^2*di1rthetam1*(-dtheta2)^2-3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+(-dtheta)*di1rtheta^3*(-dtheta2)^2+2*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)+3*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)+2*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)+2*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+2*di1rtheta^2*dtheta^3*di1rthetam2-(-dtheta)*di1rtheta^2*di1rtheta1*(-dtheta2)^2+dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+2*dtheta^2*di1rtheta^3*(-dtheta)+2*di1rtheta^2*dtheta^3*di1rthetam1+2*di1rtheta^2*dtheta^3*di1rtheta1+3*dtheta^2*di1rtheta^3*(-dtheta2)-2*dtheta^3*di1rtheta^3-dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta^2*di1rthetam2*(-dtheta2)^2+3*dtheta*di1rtheta^2*di1rthetam2*(-dtheta)*(-dtheta2)+3*dtheta*di1rtheta^2*di1rtheta1*(-dtheta)*(-dtheta2)+3*dtheta*di1rtheta^2*di1rthetam1*(-dtheta)*(-dtheta2)-3*dtheta^2*di1rtheta^2*di1rthetam1*(-dtheta2)-3*dtheta*di1rtheta^3*(-dtheta)*(-dtheta2))*(si1rt-s0-sr*di1rtheta-1/2*srr*di1rtheta^2-1/6*sr3*di1rtheta^3-1/24*sr4*di1rtheta^4)-dtheta*(di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta2)*(-dtheta)^2-di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta)*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta)*(-dtheta2)^2+di2rtheta1*di2rtheta*dim1rtheta*(-dtheta2)*(-dtheta)^2-di2rtheta1*di2rtheta*dim1rtheta*(-dtheta)*(-dtheta2)^2+2*(-dtheta2)^2*dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+4*dim2rtheta*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2-2*dim2rtheta*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2+4*dim2rtheta*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2-2*dim2rtheta*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2-(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2-4*dtheta^2*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+2*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1+2*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dim2rtheta*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1-2*dim2rtheta*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2-4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)-4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta))/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-(-dtheta)*dim1rtheta1^3+dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta+(-dtheta)*dim1rtheta1^2*dim1rthetam1+(-dtheta)*dim1rtheta1^2*dim1rtheta+(-dtheta)*dim1rtheta1^2*dim1rthetam2+dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2-dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dtheta*dim1rtheta1^2*dim1rthetam1-dtheta*dim1rtheta1^2*dim1rtheta-dtheta*dim1rtheta1^2*dim1rthetam2+dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1^3)*(sim1rt1-s0-sr*dim1rtheta1-1/2*srr*dim1rtheta1^2-1/6*sr3*dim1rtheta1^3-1/24*sr4*dim1rtheta1^4)+(-4*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+4*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*dim1rtheta1+4*dim2rtheta*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2+4*dim2rtheta*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1-4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)-2*dtheta*dim1rtheta1*(-dtheta)^2*dim2rtheta*dim2rtheta1+2*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)^2-2*dim2rtheta*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1-2*dim2rtheta*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2+2*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1-dim1rtheta1*(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1+dim1rtheta1*(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1+(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2-(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2-(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2+di2rtheta1*di2rtheta*dim1rtheta*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta2)*(-dtheta)^2-di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta)*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rtheta*(-dtheta)*(-dtheta2)^2)*dtheta/(-dtheta)/(-dim1rtheta1*(-dtheta)^2*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2*(-dtheta2)+3*dtheta*dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2*(-dtheta2)^2-2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)+3*dtheta*dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+3*dtheta*dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rthetam2+2*dtheta^2*dim1rthetam1^2*dim1rthetam2*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rtheta1+2*dtheta^2*dim1rthetam1^2*dim1rtheta*(-dtheta2)^2-4*dtheta^3*dim1rthetam1^2*dim1rtheta*(-dtheta2)+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rtheta-(-dtheta)^2*dim1rthetam1^3*(-dtheta2)^2+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rtheta*(-dtheta2)+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rthetam2*(-dtheta2)+(-dtheta)^3*dim1rthetam1^3*(-dtheta2)-2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)^2-4*dtheta^3*dim1rthetam1^2*dim1rthetam2*(-dtheta2)-4*dtheta^3*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+2*dtheta^2*dim1rthetam1^2*dim1rtheta1*(-dtheta2)^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rthetam2*dtheta^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rtheta1*dtheta^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rtheta*dtheta^2-4*(-dtheta)*dim1rthetam1^3*dtheta^2*(-dtheta2)+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rtheta1+3*(-dtheta)*dim1rthetam1^3*dtheta*(-dtheta2)^2+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rtheta+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rthetam2+(-dtheta)^3*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)-(-dtheta)^3*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+(-dtheta)^3*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)-4*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)-3*dtheta*dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2*(-dtheta2)^2-2*dtheta^2*dim1rtheta*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*(-dtheta)*dim1rthetam1^2*dim1rtheta*dtheta^2*(-dtheta2)+4*(-dtheta)*dim1rthetam1^2*dim1rthetam2*dtheta^2*(-dtheta2)+4*(-dtheta)*dim1rthetam1^2*dim1rtheta1*dtheta^2*(-dtheta2)-3*(-dtheta)*dim1rthetam1^2*dim1rthetam2*dtheta*(-dtheta2)^2-3*(-dtheta)*dim1rthetam1^2*dim1rtheta*dtheta*(-dtheta2)^2-3*(-dtheta)*dim1rthetam1^2*dim1rtheta1*dtheta*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2-2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-2*(-dtheta)^3*dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta*dim1rthetam1*dim1rthetam2-6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rtheta-4*(-dtheta)*dim1rtheta1*dim1rthetam1*dim1rtheta*dtheta^2*(-dtheta2)-4*(-dtheta)*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2-4*(-dtheta)*dtheta^2*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+4*(-dtheta)*dim1rtheta1*dim1rtheta*dim1rthetam2*dtheta^2*(-dtheta2)-4*(-dtheta)*dim1rtheta1*dim1rthetam1*dim1rthetam2*dtheta^2*(-dtheta2)+(-dtheta)^3*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2-(-dtheta)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)-(-dtheta)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)-(-dtheta)^2*dtheta*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+6*(-dtheta)^2*dim1rthetam1^3*dtheta^2-4*(-dtheta)*dtheta^3*dim1rthetam1^3-2*dtheta^2*dim1rthetam1^3*(-dtheta2)^2+4*dtheta^3*dim1rthetam1^3*(-dtheta2)-2*(-dtheta)^3*dtheta*dim1rthetam1^3-(-dtheta)^3*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+(-dtheta)^2*dim1rthetam1^2*dim1rtheta*(-dtheta2)^2+(-dtheta)^2*dim1rthetam1^2*dim1rthetam2*(-dtheta2)^2+(-dtheta)^2*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2-4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2-4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta+2*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)^2-(-dtheta)^3*dim1rthetam1^2*dim1rthetam2*(-dtheta2)-(-dtheta)^3*dim1rthetam1^2*dim1rtheta*(-dtheta2)+(-dtheta)^2*dim1rthetam1^2*dim1rtheta1*(-dtheta2)^2-(-dtheta)^2*dtheta*dim1rthetam1^3*(-dtheta2)-dim1rtheta1*(-dtheta)^2*dim1rthetam1*dim1rtheta*(-dtheta2)^2+dim1rtheta1*(-dtheta)^2*dim1rtheta*dim1rthetam2*(-dtheta2)^2-dim1rtheta*(-dtheta)^2*dim1rthetam1*dim1rthetam2*(-dtheta2)^2)*(sim1rtm1-s0-sr*dim1rthetam1-1/2*srr*dim1rthetam1^2-1/6*sr3*dim1rthetam1^3-1/24*sr4*dim1rthetam1^4)-dtheta*(4*dim2rtheta*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2-2*dim2rtheta*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rtheta*(-dtheta2)*(-dtheta)^2-di2rtheta1*di2rtheta*dim1rtheta*(-dtheta)*(-dtheta2)^2+4*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*dim1rtheta1+2*(-dtheta2)^2*dtheta*dim1rtheta*dim1rtheta1*dim1rthetam1-(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2-di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta)*(-dtheta2)^2+di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1+2*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dim2rtheta*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1-2*dim2rtheta*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2-4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)-4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-4*dtheta^2*dim1rtheta*dim1rtheta1*(-dtheta2)*dim1rthetam1+dim1rtheta1*(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1-dim1rtheta1*(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1-2*dtheta*dim1rtheta1*(-dtheta)^2*dim2rtheta*dim2rtheta1)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2+dtheta*dim1rthetam2^3-dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dim1rthetam2^2*dtheta*dim1rtheta1-dim1rthetam2^2*dtheta*dim1rtheta-dim1rthetam2^2*dtheta*dim1rthetam1+dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2-dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2+(-dtheta)*dim1rthetam2^2*dim1rtheta1+(-dtheta)*dim1rthetam2^2*dim1rtheta+(-dtheta)*dim1rthetam2^2*dim1rthetam1+dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta-(-dtheta)*dim1rthetam2^3+dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2)*(sim1rtm2-s0-sr*dim1rthetam2-1/2*srr*dim1rthetam2^2-1/6*sr3*dim1rthetam2^3-1/24*sr4*dim1rthetam2^4)+dtheta*(4*dim2rtheta*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2-2*dim2rtheta*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2+4*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*dim1rtheta1-(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2-4*dtheta^2*dim1rtheta1*dim1rthetam1*(-dtheta2)*dim1rthetam2+2*(-dtheta2)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta)*(-dtheta2)^2+di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1-2*dim2rtheta*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2+2*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dim2rtheta*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2-4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)-4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta)*(-dtheta2)^2+di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta2)*(-dtheta)^2+dim1rtheta1*(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1-dim1rtheta1*(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1-2*dtheta*dim1rtheta1*(-dtheta)^2*dim2rtheta*dim2rtheta1)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dtheta*dim1rtheta^3-(-dtheta)*dim1rtheta^2*dim1rtheta1-(-dtheta)*dim1rtheta^2*dim1rthetam2-(-dtheta)*dim1rtheta^2*dim1rthetam1-dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2-dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta^2*dim1rthetam1+dtheta*dim1rtheta^2*dim1rtheta1+dtheta*dim1rtheta^2*dim1rthetam2+dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2+dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2+dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2+(-dtheta)*dim1rtheta^3)*(sim1rt-s0-sr*dim1rtheta-1/2*srr*dim1rtheta^2-1/6*sr3*dim1rtheta^3-1/24*sr4*dim1rtheta^4)-2*dtheta^2*(-dtheta)*dim2rtheta1/(-dtheta2)/(-2*dtheta^2*(-dtheta)*dim2rtheta1+2*dtheta^2*dim2rtheta1*(-dtheta2)+2*dtheta^2*(-dtheta)*dim2rtheta-2*dtheta^2*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta)*dim2rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)^2*dim2rtheta1-3*(-dtheta)*dtheta*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta2)^2*dim2rtheta-(-dtheta2)^3*dim2rtheta-(-dtheta)*(-dtheta2)^2*dim2rtheta1+(-dtheta)*(-dtheta2)^2*dim2rtheta+(-dtheta2)^3*dim2rtheta1)*(sim2rt-s0-sr*dim2rtheta-1/2*srr*dim2rtheta^2-1/6*sr3*dim2rtheta^3-1/24*sr4*dim2rtheta^4)+2*dtheta^2*(-dtheta)*dim2rtheta/(-dtheta2)/(-2*dtheta^2*(-dtheta)*dim2rtheta1+2*dtheta^2*dim2rtheta1*(-dtheta2)+2*dtheta^2*(-dtheta)*dim2rtheta-2*dtheta^2*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta)*dim2rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)^2*dim2rtheta1-3*(-dtheta)*dtheta*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta2)^2*dim2rtheta-(-dtheta2)^3*dim2rtheta-(-dtheta)*(-dtheta2)^2*dim2rtheta1+(-dtheta)*(-dtheta2)^2*dim2rtheta+(-dtheta2)^3*dim2rtheta1)*(sim2rt1-s0-sr*dim2rtheta1-1/2*srr*dim2rtheta1^2-1/6*sr3*dim2rtheta1^3-1/24*sr4*dim2rtheta1^4)+1/2*di2rtheta1*(-dtheta2)*(-dtheta)/dtheta/((-dtheta)*(-dtheta2)*di2rtheta-2*di2rtheta*dtheta*(-dtheta)+2*(-dtheta)*dtheta*di2rtheta1-di2rtheta1*(-dtheta2)*(-dtheta)+4*di2rtheta*dtheta^2-2*di2rtheta*dtheta*(-dtheta2)+2*(-dtheta2)*dtheta*di2rtheta1-4*di2rtheta1*dtheta^2)*(si2rt-s0-sr*di2rtheta-1/2*srr*di2rtheta^2-1/6*sr3*di2rtheta^3-1/24*sr4*di2rtheta^4)-1/2*di2rtheta*(-dtheta2)*(-dtheta)/dtheta/((-dtheta)*(-dtheta2)*di2rtheta-2*di2rtheta*dtheta*(-dtheta)+2*(-dtheta)*dtheta*di2rtheta1-di2rtheta1*(-dtheta2)*(-dtheta)+4*di2rtheta*dtheta^2-2*di2rtheta*dtheta*(-dtheta2)+2*(-dtheta2)*dtheta*di2rtheta1-4*di2rtheta1*dtheta^2)*(si2rt1-s0-sr*di2rtheta1-1/2*srr*di2rtheta1^2-1/6*sr3*di2rtheta1^3-1/24*sr4*di2rtheta1^4);
stheta2=-2*((-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2-2*dtheta^3*dim2rtheta1^2*dim2rtheta-2*dtheta^3*dim2rtheta^2*dim2rtheta1+dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2+dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+2*dtheta^3*dim2rtheta*dim2rtheta1*di1rthetam2+2*dtheta^3*dim2rtheta*dim2rtheta1*di1rthetam1+2*dtheta^3*dim2rtheta*dim2rtheta1*di1rtheta-dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta^2-dtheta^2*(-dtheta)*di2rtheta^2*di2rtheta1-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta+dtheta^2*(-dtheta)*di2rtheta*di2rtheta1*di1rthetam1+dtheta^2*(-dtheta)*di2rtheta*di2rtheta1*di1rthetam2+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam1-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2+dtheta^2*(-dtheta)*di1rtheta*di2rtheta*di2rtheta1-dtheta^2*(-dtheta)*di2rtheta*di2rtheta1^2-dtheta^2*(-dtheta2)*di2rtheta1^2*di2rtheta-4*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-4*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)+3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rthetam1+3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rtheta+3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rthetam2-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta+2*dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rtheta+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam2-3*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)-3*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta))/dtheta^2/(-dtheta*di1rtheta1^2*di1rthetam2*(-dtheta2)^2-dtheta*di1rtheta1^2*di1rtheta*(-dtheta2)^2-dtheta*di1rtheta1^2*di1rthetam1*(-dtheta2)^2-3*dtheta*(-dtheta2)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)-(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+3*dtheta^2*di1rtheta1^2*di1rthetam1*(-dtheta2)+3*dtheta^2*di1rtheta1^2*di1rthetam2*(-dtheta2)+3*dtheta^2*di1rtheta1^2*di1rtheta*(-dtheta2)+2*di1rtheta1^2*dtheta^2*di1rtheta*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1^3*(-dtheta)+2*di1rtheta1*dtheta^3*di1rthetam2*di1rtheta+2*di1rtheta1*dtheta^3*di1rtheta*di1rthetam1+2*di1rtheta1^2*dtheta^2*di1rthetam2*(-dtheta)+2*di1rtheta1*dtheta^3*di1rthetam2*di1rthetam1-2*di1rtheta*dtheta^3*di1rthetam2*di1rthetam1+2*di1rtheta1^2*dtheta^2*di1rthetam1*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+2*dtheta^3*di1rtheta1^3+(-dtheta)*di1rtheta1^2*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta1^2*di1rtheta*(-dtheta2)^2+(-dtheta)*di1rtheta1^2*di1rthetam2*(-dtheta2)^2+2*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rthetam2*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rtheta*(-dtheta)-2*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+dtheta*di1rtheta1^3*(-dtheta2)^2-(-dtheta)*di1rtheta1^3*(-dtheta2)^2-3*dtheta^2*di1rtheta1^3*(-dtheta2)-2*di1rtheta1^2*dtheta^3*di1rthetam2-2*di1rtheta1^2*dtheta^3*di1rthetam1-2*dtheta^2*di1rtheta1^3*(-dtheta)-2*di1rtheta1^2*dtheta^3*di1rtheta+dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2)*(si1rt1-s0-sr*di1rtheta1-1/2*srr*di1rtheta1^2-1/6*sr3*di1rtheta1^3-1/24*sr4*di1rtheta1^4)+2*((-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2-2*dtheta^3*dim2rtheta1^2*dim2rtheta-2*dtheta^3*dim2rtheta^2*dim2rtheta1+di2rtheta1*di2rtheta*di1rtheta1*dtheta^2*(-dtheta)+dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2+dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2+2*dtheta^3*dim2rtheta*dim2rtheta1*di1rthetam2+2*dtheta^3*dim2rtheta*dim2rtheta1*di1rtheta-dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta^2-dtheta^2*(-dtheta)*di2rtheta^2*di2rtheta1-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta+dtheta^2*(-dtheta)*di2rtheta*di2rtheta1*di1rthetam2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2+dtheta^2*(-dtheta)*di1rtheta*di2rtheta*di2rtheta1-dtheta^2*(-dtheta)*di2rtheta*di2rtheta1^2-dtheta^2*(-dtheta2)*di2rtheta1^2*di2rtheta-4*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)-4*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+di2rtheta1*di2rtheta*di1rtheta1*dtheta^2*(-dtheta2)-di2rtheta1*di2rtheta*di1rtheta1*dtheta*(-dtheta2)^2-di2rtheta1*di2rtheta*di1rtheta1*(-dtheta2)^2*(-dtheta)+3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rtheta+3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rthetam2-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta+2*dim2rtheta*dim2rtheta1*dtheta^3*di1rtheta1+3*dim2rtheta*dim2rtheta1*di1rtheta1*dtheta^2*(-dtheta)+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rtheta+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam2+2*dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-3*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)-3*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta))/(2*dtheta^2-3*(-dtheta2)*dtheta+(-dtheta2)^2)/(-di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-(-dtheta)*di1rthetam1^2*di1rtheta+di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)+di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)+di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)-(-dtheta)*di1rthetam1^2*di1rtheta1-(-dtheta)*di1rthetam1^2*di1rthetam2-dtheta*di1rthetam1^3+di1rthetam1^2*dtheta*di1rthetam2+di1rthetam1^2*dtheta*di1rtheta+di1rthetam1^2*dtheta*di1rtheta1+(-dtheta)*di1rthetam1^3-di1rtheta1*dtheta*di1rtheta*di1rthetam1-di1rtheta*dtheta*di1rthetam2*di1rthetam1+di1rtheta1*dtheta*di1rthetam2*di1rtheta-di1rtheta1*dtheta*di1rthetam2*di1rthetam1)/dtheta^2*(si1rtm1-s0-sr*di1rthetam1-1/2*srr*di1rthetam1^2-1/6*sr3*di1rthetam1^3-1/24*sr4*di1rthetam1^4)+2*(-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2-(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2+2*dtheta^3*dim2rtheta1^2*dim2rtheta+2*dtheta^3*dim2rtheta^2*dim2rtheta1-di2rtheta1*di2rtheta*di1rtheta1*dtheta^2*(-dtheta)-dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2-(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2-2*dtheta^3*dim2rtheta*dim2rtheta1*di1rthetam1-2*dtheta^3*dim2rtheta*dim2rtheta1*di1rtheta+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta^2+dtheta^2*(-dtheta)*di2rtheta^2*di2rtheta1+dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1+dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta-dtheta^2*(-dtheta)*di2rtheta*di2rtheta1*di1rthetam1-dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam1-dtheta^2*(-dtheta)*di1rtheta*di2rtheta*di2rtheta1+dtheta^2*(-dtheta)*di2rtheta*di2rtheta1^2+dtheta^2*(-dtheta2)*di2rtheta1^2*di2rtheta+4*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)+4*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)-di2rtheta1*di2rtheta*di1rtheta1*dtheta^2*(-dtheta2)+di2rtheta1*di2rtheta*di1rtheta1*dtheta*(-dtheta2)^2+di2rtheta1*di2rtheta*di1rtheta1*(-dtheta2)^2*(-dtheta)-3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rthetam1-3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rtheta+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rtheta-2*dim2rtheta*dim2rtheta1*dtheta^3*di1rtheta1-3*dim2rtheta*dim2rtheta1*di1rtheta1*dtheta^2*(-dtheta)-dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rtheta-2*dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+3*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)+3*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta))/dtheta^2/(dtheta*di1rthetam2^3+di1rtheta1*dtheta*di1rthetam2*di1rthetam1+di1rtheta1*dtheta*di1rthetam2*di1rtheta+di1rtheta*dtheta*di1rthetam2*di1rthetam1-dtheta*di1rthetam2^2*di1rthetam1-di1rtheta*dtheta*di1rthetam2^2-di1rthetam2^2*dtheta*di1rtheta1-di1rtheta1*dtheta*di1rtheta*di1rthetam1+di1rthetam2^2*di1rtheta1*(-dtheta)+di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+(-dtheta)*di1rthetam2^2*di1rtheta+(-dtheta)*di1rthetam2^2*di1rthetam1-di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)-di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-(-dtheta)*di1rthetam2^3)/(2*dtheta^2-3*(-dtheta2)*dtheta+(-dtheta2)^2)*(si1rtm2-s0-sr*di1rthetam2-1/2*srr*di1rthetam2^2-1/6*sr3*di1rthetam2^3-1/24*sr4*di1rthetam2^4)-2*(-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2-(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2+2*dtheta^3*dim2rtheta1^2*dim2rtheta+2*dtheta^3*dim2rtheta^2*dim2rtheta1-di2rtheta1*di2rtheta*di1rtheta1*dtheta^2*(-dtheta)-dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+4*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-2*dtheta^3*dim2rtheta*dim2rtheta1*di1rthetam2-2*dtheta^3*dim2rtheta*dim2rtheta1*di1rthetam1+dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta^2+dtheta^2*(-dtheta)*di2rtheta^2*di2rtheta1+dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1-dtheta^2*(-dtheta)*di2rtheta*di2rtheta1*di1rthetam1-dtheta^2*(-dtheta)*di2rtheta*di2rtheta1*di1rthetam2-dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam1+dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2+dtheta^2*(-dtheta)*di2rtheta*di2rtheta1^2+dtheta^2*(-dtheta2)*di2rtheta1^2*di2rtheta+4*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-di2rtheta1*di2rtheta*di1rtheta1*dtheta^2*(-dtheta2)+di2rtheta1*di2rtheta*di1rtheta1*dtheta*(-dtheta2)^2+di2rtheta1*di2rtheta*di1rtheta1*(-dtheta2)^2*(-dtheta)-3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rthetam1-3*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*di1rthetam2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1*di1rthetam1-2*dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-2*dim2rtheta*dim2rtheta1*dtheta^3*di1rtheta1-3*dim2rtheta*dim2rtheta1*di1rtheta1*dtheta^2*(-dtheta)-dtheta^2*(-dtheta2)*di2rtheta1*di2rtheta*di1rthetam2+3*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)+3*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta))/dtheta^2/(-2*di1rtheta^2*dtheta^2*di1rtheta1*(-dtheta)-2*di1rtheta^2*dtheta^2*di1rthetam2*(-dtheta)-3*dtheta^2*di1rtheta^2*di1rthetam2*(-dtheta2)-2*di1rtheta^2*dtheta^2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta^2*di1rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)+(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta^3*(-dtheta2)^2-2*di1rtheta1*dtheta^3*di1rthetam2*di1rtheta-2*di1rtheta1*dtheta^3*di1rtheta*di1rthetam1+2*di1rtheta1*dtheta^3*di1rthetam2*di1rthetam1-2*di1rtheta*dtheta^3*di1rthetam2*di1rthetam1-(-dtheta)*di1rtheta^2*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta^2*di1rthetam2*(-dtheta2)^2+dtheta*di1rtheta^2*di1rtheta1*(-dtheta2)^2+dtheta*di1rtheta^2*di1rthetam1*(-dtheta2)^2-3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+(-dtheta)*di1rtheta^3*(-dtheta2)^2+2*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)+3*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)+2*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)+2*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+2*di1rtheta^2*dtheta^3*di1rthetam2-(-dtheta)*di1rtheta^2*di1rtheta1*(-dtheta2)^2+dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+2*dtheta^2*di1rtheta^3*(-dtheta)+2*di1rtheta^2*dtheta^3*di1rthetam1+2*di1rtheta^2*dtheta^3*di1rtheta1+3*dtheta^2*di1rtheta^3*(-dtheta2)-2*dtheta^3*di1rtheta^3-dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta^2*di1rthetam2*(-dtheta2)^2+3*dtheta*di1rtheta^2*di1rthetam2*(-dtheta)*(-dtheta2)+3*dtheta*di1rtheta^2*di1rtheta1*(-dtheta)*(-dtheta2)+3*dtheta*di1rtheta^2*di1rthetam1*(-dtheta)*(-dtheta2)-3*dtheta^2*di1rtheta^2*di1rthetam1*(-dtheta2)-3*dtheta*di1rtheta^3*(-dtheta)*(-dtheta2))*(si1rt-s0-sr*di1rtheta-1/2*srr*di1rtheta^2-1/6*sr3*di1rtheta^3-1/24*sr4*di1rtheta^4)-2*(-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2+4*dtheta^3*dim2rtheta1^2*dim2rtheta+4*dtheta^3*dim2rtheta^2*dim2rtheta1+dtheta*(-dtheta)^2*di2rtheta*di2rtheta1^2-dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+dtheta*(-dtheta)^2*di2rtheta1*di2rtheta^2+di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta)*(-dtheta2)^2+di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta)*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rtheta*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rtheta*(-dtheta)*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2-di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rthetam2*dtheta*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rthetam1*dtheta*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rtheta*dtheta*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rthetam2*dtheta*(-dtheta)^2+4*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2-4*dim2rtheta*dtheta^3*dim1rthetam1*dim2rtheta1-4*dim2rtheta*dtheta^3*dim1rtheta*dim2rtheta1-di2rtheta1*di2rtheta*dim1rtheta*dtheta*(-dtheta)^2-3*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1-3*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)+4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-4*dim2rtheta*dtheta^3*dim1rthetam2*dim2rtheta1+3*dim2rtheta*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2+4*dtheta^2*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2-4*dim2rtheta*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1+3*dim2rtheta*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1-3*(-dtheta2)^2*dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2-4*dim2rtheta*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2+3*dim2rtheta*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2-4*dim2rtheta*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2+di2rtheta1*di2rtheta*dim1rthetam1*dtheta*(-dtheta2)^2)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-(-dtheta)*dim1rtheta1^3+dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta+(-dtheta)*dim1rtheta1^2*dim1rthetam1+(-dtheta)*dim1rtheta1^2*dim1rtheta+(-dtheta)*dim1rtheta1^2*dim1rthetam2+dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2-dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dtheta*dim1rtheta1^2*dim1rthetam1-dtheta*dim1rtheta1^2*dim1rtheta-dtheta*dim1rtheta1^2*dim1rthetam2+dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1^3)*(sim1rt1-s0-sr*dim1rtheta1-1/2*srr*dim1rtheta1^2-1/6*sr3*dim1rtheta1^3-1/24*sr4*dim1rtheta1^4)+2*(-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2+4*dtheta^3*dim2rtheta1^2*dim2rtheta+4*dtheta^3*dim2rtheta^2*dim2rtheta1+dtheta*(-dtheta)^2*di2rtheta*di2rtheta1^2+3*dtheta*dim1rtheta1*(-dtheta)^2*dim2rtheta*dim2rtheta1-3*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)^2+dtheta*dim1rtheta1*(-dtheta2)^2*di2rtheta*di2rtheta1-dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+dtheta*(-dtheta)^2*di2rtheta1*di2rtheta^2+di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta)*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rtheta*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rtheta*(-dtheta)*(-dtheta2)^2-dtheta*dim1rtheta1*(-dtheta)^2*di2rtheta*di2rtheta1+4*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)-4*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*dim1rtheta1-di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rthetam2*dtheta*(-dtheta2)^2+dim1rtheta1*(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1-dim1rtheta1*(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1+di2rtheta1*di2rtheta*dim1rtheta*dtheta*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rthetam2*dtheta*(-dtheta)^2-4*dim2rtheta*dtheta^3*dim1rtheta*dim2rtheta1-di2rtheta1*di2rtheta*dim1rtheta*dtheta*(-dtheta)^2-3*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1-3*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)+4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-4*dim2rtheta*dtheta^3*dim1rthetam2*dim2rtheta1+4*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2-4*dtheta^3*dim2rtheta*dim2rtheta1*dim1rtheta1-4*dim2rtheta*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1+3*dim2rtheta*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1-4*dim2rtheta*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2+3*dim2rtheta*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2)/(-dim1rtheta1*(-dtheta)^2*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2*(-dtheta2)+3*dtheta*dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2*(-dtheta2)^2-2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)+3*dtheta*dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+3*dtheta*dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rthetam2+2*dtheta^2*dim1rthetam1^2*dim1rthetam2*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rtheta1+2*dtheta^2*dim1rthetam1^2*dim1rtheta*(-dtheta2)^2-4*dtheta^3*dim1rthetam1^2*dim1rtheta*(-dtheta2)+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rtheta-(-dtheta)^2*dim1rthetam1^3*(-dtheta2)^2+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rtheta*(-dtheta2)+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rthetam2*(-dtheta2)+(-dtheta)^3*dim1rthetam1^3*(-dtheta2)-2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)^2-4*dtheta^3*dim1rthetam1^2*dim1rthetam2*(-dtheta2)-4*dtheta^3*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+2*dtheta^2*dim1rthetam1^2*dim1rtheta1*(-dtheta2)^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rthetam2*dtheta^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rtheta1*dtheta^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rtheta*dtheta^2-4*(-dtheta)*dim1rthetam1^3*dtheta^2*(-dtheta2)+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rtheta1+3*(-dtheta)*dim1rthetam1^3*dtheta*(-dtheta2)^2+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rtheta+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rthetam2+(-dtheta)^3*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)-(-dtheta)^3*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+(-dtheta)^3*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)-4*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)-3*dtheta*dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2*(-dtheta2)^2-2*dtheta^2*dim1rtheta*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*(-dtheta)*dim1rthetam1^2*dim1rtheta*dtheta^2*(-dtheta2)+4*(-dtheta)*dim1rthetam1^2*dim1rthetam2*dtheta^2*(-dtheta2)+4*(-dtheta)*dim1rthetam1^2*dim1rtheta1*dtheta^2*(-dtheta2)-3*(-dtheta)*dim1rthetam1^2*dim1rthetam2*dtheta*(-dtheta2)^2-3*(-dtheta)*dim1rthetam1^2*dim1rtheta*dtheta*(-dtheta2)^2-3*(-dtheta)*dim1rthetam1^2*dim1rtheta1*dtheta*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2-2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-2*(-dtheta)^3*dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta*dim1rthetam1*dim1rthetam2-6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rtheta-4*(-dtheta)*dim1rtheta1*dim1rthetam1*dim1rtheta*dtheta^2*(-dtheta2)-4*(-dtheta)*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2-4*(-dtheta)*dtheta^2*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+4*(-dtheta)*dim1rtheta1*dim1rtheta*dim1rthetam2*dtheta^2*(-dtheta2)-4*(-dtheta)*dim1rtheta1*dim1rthetam1*dim1rthetam2*dtheta^2*(-dtheta2)+(-dtheta)^3*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2-(-dtheta)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)-(-dtheta)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)-(-dtheta)^2*dtheta*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+6*(-dtheta)^2*dim1rthetam1^3*dtheta^2-4*(-dtheta)*dtheta^3*dim1rthetam1^3-2*dtheta^2*dim1rthetam1^3*(-dtheta2)^2+4*dtheta^3*dim1rthetam1^3*(-dtheta2)-2*(-dtheta)^3*dtheta*dim1rthetam1^3-(-dtheta)^3*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+(-dtheta)^2*dim1rthetam1^2*dim1rtheta*(-dtheta2)^2+(-dtheta)^2*dim1rthetam1^2*dim1rthetam2*(-dtheta2)^2+(-dtheta)^2*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2-4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2-4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta+2*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)^2-(-dtheta)^3*dim1rthetam1^2*dim1rthetam2*(-dtheta2)-(-dtheta)^3*dim1rthetam1^2*dim1rtheta*(-dtheta2)+(-dtheta)^2*dim1rthetam1^2*dim1rtheta1*(-dtheta2)^2-(-dtheta)^2*dtheta*dim1rthetam1^3*(-dtheta2)-dim1rtheta1*(-dtheta)^2*dim1rthetam1*dim1rtheta*(-dtheta2)^2+dim1rtheta1*(-dtheta)^2*dim1rtheta*dim1rthetam2*(-dtheta2)^2-dim1rtheta*(-dtheta)^2*dim1rthetam1*dim1rthetam2*(-dtheta2)^2)/(-dtheta)*(sim1rtm1-s0-sr*dim1rthetam1-1/2*srr*dim1rthetam1^2-1/6*sr3*dim1rthetam1^3-1/24*sr4*dim1rthetam1^4)-2*(-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2+4*dtheta^3*dim2rtheta1^2*dim2rtheta+4*dtheta^3*dim2rtheta^2*dim2rtheta1+dtheta*(-dtheta)^2*di2rtheta*di2rtheta1^2+3*dtheta*dim1rtheta1*(-dtheta)^2*dim2rtheta*dim2rtheta1+dtheta*dim1rtheta1*(-dtheta2)^2*di2rtheta*di2rtheta1-dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+dtheta*(-dtheta)^2*di2rtheta1*di2rtheta^2+di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta)*(-dtheta2)^2-di2rtheta1*di2rtheta*dim1rtheta*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rtheta*(-dtheta)*(-dtheta2)^2-dtheta*dim1rtheta1*(-dtheta)^2*di2rtheta*di2rtheta1-di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+4*dtheta^2*dim1rtheta*dim1rtheta1*(-dtheta2)*dim1rthetam1-4*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*dim1rtheta1+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta+dim1rtheta1*(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1-dim1rtheta1*(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1-di2rtheta1*di2rtheta*dim1rthetam1*dtheta*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rtheta*dtheta*(-dtheta2)^2-4*dim2rtheta*dtheta^3*dim1rthetam1*dim2rtheta1-4*dim2rtheta*dtheta^3*dim1rtheta*dim2rtheta1-di2rtheta1*di2rtheta*dim1rtheta*dtheta*(-dtheta)^2-3*(-dtheta2)^2*dtheta*dim1rtheta*dim1rtheta1*dim1rthetam1-3*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1-3*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)+4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-4*dtheta^3*dim2rtheta*dim2rtheta1*dim1rtheta1+3*dim2rtheta*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2-4*dim2rtheta*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1+3*dim2rtheta*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1-4*dim2rtheta*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2+di2rtheta1*di2rtheta*dim1rthetam1*dtheta*(-dtheta2)^2)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2+dtheta*dim1rthetam2^3-dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dim1rthetam2^2*dtheta*dim1rtheta1-dim1rthetam2^2*dtheta*dim1rtheta-dim1rthetam2^2*dtheta*dim1rthetam1+dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2-dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2+(-dtheta)*dim1rthetam2^2*dim1rtheta1+(-dtheta)*dim1rthetam2^2*dim1rtheta+(-dtheta)*dim1rthetam2^2*dim1rthetam1+dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta-(-dtheta)*dim1rthetam2^3+dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2)*(sim1rtm2-s0-sr*dim1rthetam2-1/2*srr*dim1rthetam2^2-1/6*sr3*dim1rthetam2^3-1/24*sr4*dim1rthetam2^4)+2*(-(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1^2+(-dtheta)^2*(-dtheta2)*di2rtheta*di2rtheta1^2-(-dtheta)*(-dtheta2)^2*di2rtheta1*di2rtheta^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*di2rtheta^2+4*dtheta^3*dim2rtheta1^2*dim2rtheta+4*dtheta^3*dim2rtheta^2*dim2rtheta1+dtheta*(-dtheta)^2*di2rtheta*di2rtheta1^2+3*dtheta*dim1rtheta1*(-dtheta)^2*dim2rtheta*dim2rtheta1+dtheta*dim1rtheta1*(-dtheta2)^2*di2rtheta*di2rtheta1-3*(-dtheta2)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dtheta*(-dtheta2)^2*di2rtheta1*di2rtheta^2-dtheta*(-dtheta2)^2*di2rtheta*di2rtheta1^2+dtheta*(-dtheta)^2*di2rtheta1*di2rtheta^2+di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta)*(-dtheta2)^2+di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta)*(-dtheta2)^2-dtheta*dim1rtheta1*(-dtheta)^2*di2rtheta*di2rtheta1-di2rtheta1*di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2-4*dtheta^2*dim2rtheta*(-dtheta)*dim2rtheta1*dim1rtheta1+4*dtheta^2*dim1rtheta1*dim1rthetam1*(-dtheta2)*dim1rthetam2-di2rtheta1*di2rtheta*dim1rthetam2*(-dtheta2)*(-dtheta)^2+di2rtheta1*di2rtheta*dim1rthetam2*dtheta*(-dtheta2)^2+dim1rtheta1*(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1-dim1rtheta1*(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1-di2rtheta1*di2rtheta*dim1rthetam1*dtheta*(-dtheta)^2-di2rtheta1*di2rtheta*dim1rthetam2*dtheta*(-dtheta)^2-4*dim2rtheta*dtheta^3*dim1rthetam1*dim2rtheta1-3*dtheta*(-dtheta)^2*dim2rtheta^2*dim2rtheta1-3*dim2rtheta*dim2rtheta1^2*dtheta*(-dtheta)^2+4*dtheta^2*dim2rtheta*dim2rtheta1^2*(-dtheta)+4*dtheta^2*dim2rtheta^2*dim2rtheta1*(-dtheta)-4*dim2rtheta*dtheta^3*dim1rthetam2*dim2rtheta1-4*dtheta^3*dim2rtheta*dim2rtheta1*dim1rtheta1+3*dim2rtheta*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2-4*dim2rtheta*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2+3*dim2rtheta*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2-4*dim2rtheta*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2+di2rtheta1*di2rtheta*dim1rthetam1*dtheta*(-dtheta2)^2)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dtheta*dim1rtheta^3-(-dtheta)*dim1rtheta^2*dim1rtheta1-(-dtheta)*dim1rtheta^2*dim1rthetam2-(-dtheta)*dim1rtheta^2*dim1rthetam1-dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2-dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta^2*dim1rthetam1+dtheta*dim1rtheta^2*dim1rtheta1+dtheta*dim1rtheta^2*dim1rthetam2+dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2+dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2+dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2+(-dtheta)*dim1rtheta^3)*(sim1rt-s0-sr*dim1rtheta-1/2*srr*dim1rtheta^2-1/6*sr3*dim1rtheta^3-1/24*sr4*dim1rtheta^4)+2*dtheta*dim2rtheta1*(2*dtheta+3*(-dtheta))/(-dtheta2)/(-2*dtheta^2*(-dtheta)*dim2rtheta1+2*dtheta^2*dim2rtheta1*(-dtheta2)+2*dtheta^2*(-dtheta)*dim2rtheta-2*dtheta^2*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta)*dim2rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)^2*dim2rtheta1-3*(-dtheta)*dtheta*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta2)^2*dim2rtheta-(-dtheta2)^3*dim2rtheta-(-dtheta)*(-dtheta2)^2*dim2rtheta1+(-dtheta)*(-dtheta2)^2*dim2rtheta+(-dtheta2)^3*dim2rtheta1)*(sim2rt-s0-sr*dim2rtheta-1/2*srr*dim2rtheta^2-1/6*sr3*dim2rtheta^3-1/24*sr4*dim2rtheta^4)-2*dtheta*dim2rtheta*(2*dtheta+3*(-dtheta))/(-dtheta2)/(-2*dtheta^2*(-dtheta)*dim2rtheta1+2*dtheta^2*dim2rtheta1*(-dtheta2)+2*dtheta^2*(-dtheta)*dim2rtheta-2*dtheta^2*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta)*dim2rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)^2*dim2rtheta1-3*(-dtheta)*dtheta*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta2)^2*dim2rtheta-(-dtheta2)^3*dim2rtheta-(-dtheta)*(-dtheta2)^2*dim2rtheta1+(-dtheta)*(-dtheta2)^2*dim2rtheta+(-dtheta2)^3*dim2rtheta1)*(sim2rt1-s0-sr*dim2rtheta1-1/2*srr*dim2rtheta1^2-1/6*sr3*dim2rtheta1^3-1/24*sr4*dim2rtheta1^4)-((-dtheta)*dtheta+(-dtheta2)*dtheta+(-dtheta)*(-dtheta2))/dtheta^2/((-dtheta)*(-dtheta2)*di2rtheta-2*di2rtheta*dtheta*(-dtheta)+2*(-dtheta)*dtheta*di2rtheta1-di2rtheta1*(-dtheta2)*(-dtheta)+4*di2rtheta*dtheta^2-2*di2rtheta*dtheta*(-dtheta2)+2*(-dtheta2)*dtheta*di2rtheta1-4*di2rtheta1*dtheta^2)*di2rtheta1*(si2rt-s0-sr*di2rtheta-1/2*srr*di2rtheta^2-1/6*sr3*di2rtheta^3-1/24*sr4*di2rtheta^4)+((-dtheta)*dtheta+(-dtheta2)*dtheta+(-dtheta)*(-dtheta2))/dtheta^2*di2rtheta/((-dtheta)*(-dtheta2)*di2rtheta-2*di2rtheta*dtheta*(-dtheta)+2*(-dtheta)*dtheta*di2rtheta1-di2rtheta1*(-dtheta2)*(-dtheta)+4*di2rtheta*dtheta^2-2*di2rtheta*dtheta*(-dtheta2)+2*(-dtheta2)*dtheta*di2rtheta1-4*di2rtheta1*dtheta^2)*(si2rt1-s0-sr*di2rtheta1-1/2*srr*di2rtheta1^2-1/6*sr3*di2rtheta1^3-1/24*sr4*di2rtheta1^4);
srtheta=-(-4*dtheta*(-dtheta2)*di1rtheta*di1rthetam1-4*dtheta*(-dtheta2)*di1rthetam2*di1rthetam1-4*dtheta*(-dtheta2)*di1rtheta*di1rthetam2-2*dtheta^2*dim2rtheta1^2+2*dtheta^2*dim2rtheta*di1rthetam2+2*dtheta^2*dim2rtheta*di1rthetam1+2*dtheta^2*dim2rtheta*di1rtheta-di2rtheta^2*dtheta*(-dtheta2)-2*dim2rtheta1*dtheta^2*dim2rtheta+2*dtheta^2*dim2rtheta1*di1rthetam2+2*dtheta^2*dim2rtheta1*di1rtheta+2*dtheta^2*dim2rtheta1*di1rthetam1+2*(-dtheta2)^2*di1rthetam1*di1rthetam2+2*(-dtheta2)^2*di1rtheta*di1rthetam2+2*(-dtheta2)^2*di1rthetam1*di1rtheta-2*dtheta^2*dim2rtheta^2-di2rtheta*(-dtheta2)*dtheta*di2rtheta1+di1rtheta*di2rtheta*dtheta*(-dtheta2)+(-dtheta2)^2*di2rtheta^2+(-dtheta2)^2*di2rtheta1^2+di1rtheta*(-dtheta2)*dtheta*di2rtheta1+(-dtheta2)^2*di2rtheta*di2rtheta1-(-dtheta2)^2*di2rtheta*di1rthetam2-(-dtheta2)^2*di2rtheta*di1rthetam1-(-dtheta2)^2*di2rtheta*di1rtheta+dtheta*(-dtheta2)*di2rtheta*di1rthetam1+dtheta*(-dtheta2)*di2rtheta1*di1rthetam1+dtheta*(-dtheta2)*di2rtheta1*di1rthetam2+dtheta*(-dtheta2)*di2rtheta*di1rthetam2-(-dtheta2)^2*di2rtheta1*di1rthetam2-(-dtheta2)^2*di2rtheta1*di1rtheta-dtheta*(-dtheta2)*di2rtheta1^2-(-dtheta2)^2*di2rtheta1*di1rthetam1)*(-dtheta)/dtheta/(-dtheta*di1rtheta1^2*di1rthetam2*(-dtheta2)^2-dtheta*di1rtheta1^2*di1rtheta*(-dtheta2)^2-dtheta*di1rtheta1^2*di1rthetam1*(-dtheta2)^2-3*dtheta*(-dtheta2)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)-(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+3*dtheta^2*di1rtheta1^2*di1rthetam1*(-dtheta2)+3*dtheta^2*di1rtheta1^2*di1rthetam2*(-dtheta2)+3*dtheta^2*di1rtheta1^2*di1rtheta*(-dtheta2)+2*di1rtheta1^2*dtheta^2*di1rtheta*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1^3*(-dtheta)+2*di1rtheta1*dtheta^3*di1rthetam2*di1rtheta+2*di1rtheta1*dtheta^3*di1rtheta*di1rthetam1+2*di1rtheta1^2*dtheta^2*di1rthetam2*(-dtheta)+2*di1rtheta1*dtheta^3*di1rthetam2*di1rthetam1-2*di1rtheta*dtheta^3*di1rthetam2*di1rthetam1+2*di1rtheta1^2*dtheta^2*di1rthetam1*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)+3*dtheta*(-dtheta2)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+2*dtheta^3*di1rtheta1^3+(-dtheta)*di1rtheta1^2*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta1^2*di1rtheta*(-dtheta2)^2+(-dtheta)*di1rtheta1^2*di1rthetam2*(-dtheta2)^2+2*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rthetam2*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1^2*di1rtheta*(-dtheta)-2*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+dtheta*di1rtheta1^3*(-dtheta2)^2-(-dtheta)*di1rtheta1^3*(-dtheta2)^2-3*dtheta^2*di1rtheta1^3*(-dtheta2)-2*di1rtheta1^2*dtheta^3*di1rthetam2-2*di1rtheta1^2*dtheta^3*di1rthetam1-2*dtheta^2*di1rtheta1^3*(-dtheta)-2*di1rtheta1^2*dtheta^3*di1rtheta+dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2)*(si1rt1-s0-sr*di1rtheta1-1/2*srr*di1rtheta1^2-1/6*sr3*di1rtheta1^3-1/24*sr4*di1rtheta1^4)+(-dtheta)*(dtheta*di1rtheta1*(-dtheta2)*di2rtheta+dtheta*di1rtheta1*(-dtheta2)*di2rtheta1-4*dtheta*(-dtheta2)*di1rtheta*di1rthetam2-2*dtheta^2*dim2rtheta1^2+2*dtheta^2*dim2rtheta*di1rthetam2+2*dtheta^2*dim2rtheta*di1rtheta-di2rtheta^2*dtheta*(-dtheta2)-2*dim2rtheta1*dtheta^2*dim2rtheta+2*dtheta^2*dim2rtheta1*di1rthetam2+2*dtheta^2*dim2rtheta1*di1rtheta+2*(-dtheta2)^2*di1rtheta*di1rthetam2+2*dtheta^2*dim2rtheta1*di1rtheta1+2*(-dtheta2)^2*di1rtheta1*di1rtheta+2*(-dtheta2)^2*di1rtheta1*di1rthetam2-2*dtheta^2*dim2rtheta^2-di2rtheta*(-dtheta2)*dtheta*di2rtheta1+di1rtheta*di2rtheta*dtheta*(-dtheta2)-4*dtheta*di1rtheta1*(-dtheta2)*di1rthetam2-4*dtheta*di1rtheta1*(-dtheta2)*di1rtheta+(-dtheta2)^2*di2rtheta^2+(-dtheta2)^2*di2rtheta1^2+di1rtheta*(-dtheta2)*dtheta*di2rtheta1+(-dtheta2)^2*di2rtheta*di2rtheta1-(-dtheta2)^2*di2rtheta*di1rthetam2-(-dtheta2)^2*di2rtheta*di1rtheta+dtheta*(-dtheta2)*di2rtheta1*di1rthetam2+dtheta*(-dtheta2)*di2rtheta*di1rthetam2-(-dtheta2)^2*di2rtheta1*di1rthetam2-(-dtheta2)^2*di2rtheta1*di1rtheta-dtheta*(-dtheta2)*di2rtheta1^2+2*dtheta^2*dim2rtheta*di1rtheta1-(-dtheta2)^2*di2rtheta1*di1rtheta1-(-dtheta2)^2*di2rtheta*di1rtheta1)/dtheta/(2*dtheta^2-3*(-dtheta2)*dtheta+(-dtheta2)^2)/(-di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-(-dtheta)*di1rthetam1^2*di1rtheta+di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)+di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)+di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)-(-dtheta)*di1rthetam1^2*di1rtheta1-(-dtheta)*di1rthetam1^2*di1rthetam2-dtheta*di1rthetam1^3+di1rthetam1^2*dtheta*di1rthetam2+di1rthetam1^2*dtheta*di1rtheta+di1rthetam1^2*dtheta*di1rtheta1+(-dtheta)*di1rthetam1^3-di1rtheta1*dtheta*di1rtheta*di1rthetam1-di1rtheta*dtheta*di1rthetam2*di1rthetam1+di1rtheta1*dtheta*di1rthetam2*di1rtheta-di1rtheta1*dtheta*di1rthetam2*di1rthetam1)*(si1rtm1-s0-sr*di1rthetam1-1/2*srr*di1rthetam1^2-1/6*sr3*di1rthetam1^3-1/24*sr4*di1rthetam1^4)+(-dtheta)*(-dtheta*di1rtheta1*(-dtheta2)*di2rtheta-dtheta*di1rtheta1*(-dtheta2)*di2rtheta1+4*dtheta*(-dtheta2)*di1rtheta*di1rthetam1+2*dtheta^2*dim2rtheta1^2-2*dtheta^2*dim2rtheta*di1rthetam1-2*dtheta^2*dim2rtheta*di1rtheta+di2rtheta^2*dtheta*(-dtheta2)+2*dim2rtheta1*dtheta^2*dim2rtheta-2*dtheta^2*dim2rtheta1*di1rtheta-2*dtheta^2*dim2rtheta1*di1rthetam1-2*(-dtheta2)^2*di1rthetam1*di1rtheta-2*dtheta^2*dim2rtheta1*di1rtheta1-2*(-dtheta2)^2*di1rtheta1*di1rtheta+2*dtheta^2*dim2rtheta^2+di2rtheta*(-dtheta2)*dtheta*di2rtheta1-di1rtheta*di2rtheta*dtheta*(-dtheta2)+4*dtheta*di1rtheta1*(-dtheta2)*di1rtheta+4*di1rtheta1*di1rthetam1*(-dtheta2)*dtheta-(-dtheta2)^2*di2rtheta^2-(-dtheta2)^2*di2rtheta1^2-di1rtheta*(-dtheta2)*dtheta*di2rtheta1-(-dtheta2)^2*di2rtheta*di2rtheta1+(-dtheta2)^2*di2rtheta*di1rthetam1+(-dtheta2)^2*di2rtheta*di1rtheta-dtheta*(-dtheta2)*di2rtheta*di1rthetam1-dtheta*(-dtheta2)*di2rtheta1*di1rthetam1+(-dtheta2)^2*di2rtheta1*di1rtheta+dtheta*(-dtheta2)*di2rtheta1^2-2*dtheta^2*dim2rtheta*di1rtheta1-2*di1rtheta1*di1rthetam1*(-dtheta2)^2+(-dtheta2)^2*di2rtheta1*di1rtheta1+(-dtheta2)^2*di2rtheta1*di1rthetam1+(-dtheta2)^2*di2rtheta*di1rtheta1)/dtheta/(dtheta*di1rthetam2^3+di1rtheta1*dtheta*di1rthetam2*di1rthetam1+di1rtheta1*dtheta*di1rthetam2*di1rtheta+di1rtheta*dtheta*di1rthetam2*di1rthetam1-dtheta*di1rthetam2^2*di1rthetam1-di1rtheta*dtheta*di1rthetam2^2-di1rthetam2^2*dtheta*di1rtheta1-di1rtheta1*dtheta*di1rtheta*di1rthetam1+di1rthetam2^2*di1rtheta1*(-dtheta)+di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+(-dtheta)*di1rthetam2^2*di1rtheta+(-dtheta)*di1rthetam2^2*di1rthetam1-di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)-di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-(-dtheta)*di1rthetam2^3)/(2*dtheta^2-3*(-dtheta2)*dtheta+(-dtheta2)^2)*(si1rtm2-s0-sr*di1rthetam2-1/2*srr*di1rthetam2^2-1/6*sr3*di1rthetam2^3-1/24*sr4*di1rthetam2^4)-(-dtheta*di1rtheta1*(-dtheta2)*di2rtheta-dtheta*di1rtheta1*(-dtheta2)*di2rtheta1+4*dtheta*(-dtheta2)*di1rthetam2*di1rthetam1+2*dtheta^2*dim2rtheta1^2-2*dtheta^2*dim2rtheta*di1rthetam2-2*dtheta^2*dim2rtheta*di1rthetam1+di2rtheta^2*dtheta*(-dtheta2)+2*dim2rtheta1*dtheta^2*dim2rtheta-2*dtheta^2*dim2rtheta1*di1rthetam2-2*dtheta^2*dim2rtheta1*di1rthetam1-2*(-dtheta2)^2*di1rthetam1*di1rthetam2-2*dtheta^2*dim2rtheta1*di1rtheta1-2*(-dtheta2)^2*di1rtheta1*di1rthetam2+2*dtheta^2*dim2rtheta^2+di2rtheta*(-dtheta2)*dtheta*di2rtheta1+4*dtheta*di1rtheta1*(-dtheta2)*di1rthetam2+4*di1rtheta1*di1rthetam1*(-dtheta2)*dtheta-(-dtheta2)^2*di2rtheta^2-(-dtheta2)^2*di2rtheta1^2-(-dtheta2)^2*di2rtheta*di2rtheta1+(-dtheta2)^2*di2rtheta*di1rthetam2+(-dtheta2)^2*di2rtheta*di1rthetam1-dtheta*(-dtheta2)*di2rtheta*di1rthetam1-dtheta*(-dtheta2)*di2rtheta1*di1rthetam1-dtheta*(-dtheta2)*di2rtheta1*di1rthetam2-dtheta*(-dtheta2)*di2rtheta*di1rthetam2+(-dtheta2)^2*di2rtheta1*di1rthetam2+dtheta*(-dtheta2)*di2rtheta1^2-2*dtheta^2*dim2rtheta*di1rtheta1-2*di1rtheta1*di1rthetam1*(-dtheta2)^2+(-dtheta2)^2*di2rtheta1*di1rtheta1+(-dtheta2)^2*di2rtheta1*di1rthetam1+(-dtheta2)^2*di2rtheta*di1rtheta1)*(-dtheta)/dtheta/(-2*di1rtheta^2*dtheta^2*di1rtheta1*(-dtheta)-2*di1rtheta^2*dtheta^2*di1rthetam2*(-dtheta)-3*dtheta^2*di1rtheta^2*di1rthetam2*(-dtheta2)-2*di1rtheta^2*dtheta^2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta^2*di1rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta)-3*dtheta^2*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)+(-dtheta)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2+(-dtheta)*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta^3*(-dtheta2)^2-2*di1rtheta1*dtheta^3*di1rthetam2*di1rtheta-2*di1rtheta1*dtheta^3*di1rtheta*di1rthetam1+2*di1rtheta1*dtheta^3*di1rthetam2*di1rthetam1-2*di1rtheta*dtheta^3*di1rthetam2*di1rthetam1-(-dtheta)*di1rtheta^2*di1rthetam1*(-dtheta2)^2+dtheta*di1rtheta^2*di1rthetam2*(-dtheta2)^2+dtheta*di1rtheta^2*di1rtheta1*(-dtheta2)^2+dtheta*di1rtheta^2*di1rthetam1*(-dtheta2)^2-3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta)-3*dtheta*(-dtheta2)*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta)+(-dtheta)*di1rtheta^3*(-dtheta2)^2+2*di1rtheta*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)-2*di1rtheta1*dtheta^2*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)+3*dtheta^2*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)+3*dtheta*(-dtheta2)*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta)+3*dtheta^2*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)+2*di1rtheta1*dtheta^2*di1rtheta*di1rthetam1*(-dtheta)+2*di1rtheta1*dtheta^2*di1rthetam2*di1rtheta*(-dtheta)+2*di1rtheta^2*dtheta^3*di1rthetam2-(-dtheta)*di1rtheta^2*di1rtheta1*(-dtheta2)^2+dtheta*di1rtheta1*di1rthetam2*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta*di1rthetam2*di1rthetam1*(-dtheta2)^2+2*dtheta^2*di1rtheta^3*(-dtheta)+2*di1rtheta^2*dtheta^3*di1rthetam1+2*di1rtheta^2*dtheta^3*di1rtheta1+3*dtheta^2*di1rtheta^3*(-dtheta2)-2*dtheta^3*di1rtheta^3-dtheta*di1rtheta1*di1rtheta*di1rthetam1*(-dtheta2)^2-dtheta*di1rtheta1*di1rthetam2*di1rtheta*(-dtheta2)^2-(-dtheta)*di1rtheta^2*di1rthetam2*(-dtheta2)^2+3*dtheta*di1rtheta^2*di1rthetam2*(-dtheta)*(-dtheta2)+3*dtheta*di1rtheta^2*di1rtheta1*(-dtheta)*(-dtheta2)+3*dtheta*di1rtheta^2*di1rthetam1*(-dtheta)*(-dtheta2)-3*dtheta^2*di1rtheta^2*di1rthetam1*(-dtheta2)-3*dtheta*di1rtheta^3*(-dtheta)*(-dtheta2))*(si1rt-s0-sr*di1rtheta-1/2*srr*di1rtheta^2-1/6*sr3*di1rtheta^3-1/24*sr4*di1rtheta^4)+dtheta*(-4*dtheta^2*(-dtheta)*dim2rtheta1*dim2rtheta+2*(-dtheta2)^2*dim1rthetam1*dim1rtheta*dtheta-2*dim2rtheta*dim1rthetam1*dtheta*(-dtheta)^2+4*dim2rtheta*dim1rthetam1*(-dtheta)*dtheta^2-2*dim1rthetam2*dim2rtheta*dtheta*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta1^2-2*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta-2*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1+4*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta+4*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1-4*dtheta^2*dim2rtheta^2*(-dtheta)-4*dtheta^2*(-dtheta)*dim2rtheta1^2+2*dim2rtheta1^2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2-di2rtheta1^2*(-dtheta2)*(-dtheta)^2+4*dim1rthetam2*dim2rtheta*(-dtheta)*dtheta^2-2*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2+4*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2-2*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2+4*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2-4*dtheta^2*dim1rthetam1*(-dtheta2)*dim1rthetam2-4*dtheta^2*dim1rthetam2*(-dtheta2)*dim1rtheta-4*dtheta^2*dim1rthetam1*(-dtheta2)*dim1rtheta+2*(-dtheta2)^2*dtheta*dim1rthetam1*dim1rthetam2+2*(-dtheta2)^2*dim1rthetam2*dim1rtheta*dtheta+2*dtheta*(-dtheta)^2*dim2rtheta*dim2rtheta1-(-dtheta2)^2*dim1rthetam1*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rtheta*(-dtheta)*di2rtheta1-(-dtheta2)^2*dim1rtheta*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam1*(-dtheta)*di2rtheta1-(-dtheta2)^2*dim1rthetam2*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam2*(-dtheta)*di2rtheta1-di2rtheta^2*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta^2+(-dtheta)^2*(-dtheta2)*dim1rtheta*di2rtheta1+(-dtheta)^2*(-dtheta2)*dim1rtheta*di2rtheta+di2rtheta1*dim1rthetam1*(-dtheta2)*(-dtheta)^2+dim1rthetam2*di2rtheta1*(-dtheta2)*(-dtheta)^2+di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1+dim1rthetam2*di2rtheta*(-dtheta2)*(-dtheta)^2-(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-(-dtheta)*dim1rtheta1^3+dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta+(-dtheta)*dim1rtheta1^2*dim1rthetam1+(-dtheta)*dim1rtheta1^2*dim1rtheta+(-dtheta)*dim1rtheta1^2*dim1rthetam2+dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2-dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dtheta*dim1rtheta1^2*dim1rthetam1-dtheta*dim1rtheta1^2*dim1rtheta-dtheta*dim1rtheta1^2*dim1rthetam2+dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1^3)*(sim1rt1-s0-sr*dim1rtheta1-1/2*srr*dim1rtheta1^2-1/6*sr3*dim1rtheta1^3-1/24*sr4*dim1rtheta1^4)-(-4*dtheta^2*(-dtheta)*dim2rtheta1*dim2rtheta-2*dim1rthetam2*dim2rtheta*dtheta*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta1^2-2*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta-2*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1+4*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta+4*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1-4*dtheta^2*dim2rtheta^2*(-dtheta)-4*dtheta^2*(-dtheta)*dim2rtheta1^2+2*dim2rtheta1^2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2-di2rtheta1^2*(-dtheta2)*(-dtheta)^2-(-dtheta)*dim1rtheta1*di2rtheta1*(-dtheta2)^2-(-dtheta)*dim1rtheta1*di2rtheta*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*dim1rtheta1+(-dtheta)^2*(-dtheta2)*di2rtheta*dim1rtheta1+4*dim1rthetam2*dim2rtheta*(-dtheta)*dtheta^2-2*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2+4*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2-4*dtheta^2*dim1rthetam2*(-dtheta2)*dim1rtheta+2*(-dtheta2)^2*dim1rthetam2*dim1rtheta*dtheta+2*dtheta*(-dtheta)^2*dim2rtheta*dim2rtheta1-4*dtheta^2*(-dtheta2)*dim1rtheta1*dim1rthetam2-4*dtheta^2*(-dtheta2)*dim1rtheta1*dim1rtheta+4*dtheta^2*(-dtheta)*dim2rtheta1*dim1rtheta1-2*(-dtheta)^2*dtheta*dim2rtheta*dim1rtheta1-2*(-dtheta)^2*dtheta*dim2rtheta1*dim1rtheta1+4*dtheta^2*(-dtheta)*dim2rtheta*dim1rtheta1+2*dtheta*dim1rtheta1*(-dtheta2)^2*dim1rtheta+2*dtheta*dim1rtheta1*dim1rthetam2*(-dtheta2)^2-(-dtheta2)^2*dim1rtheta*(-dtheta)*di2rtheta1-(-dtheta2)^2*dim1rtheta*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam2*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam2*(-dtheta)*di2rtheta1-di2rtheta^2*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta^2+(-dtheta)^2*(-dtheta2)*dim1rtheta*di2rtheta1+(-dtheta)^2*(-dtheta2)*dim1rtheta*di2rtheta+dim1rthetam2*di2rtheta1*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1+dim1rthetam2*di2rtheta*(-dtheta2)*(-dtheta)^2-(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1)*dtheta/(-dtheta)/(-dim1rtheta1*(-dtheta)^2*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2*(-dtheta2)+3*dtheta*dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2*(-dtheta2)^2-2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)+4*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)+3*dtheta*dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+3*dtheta*dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rthetam2+2*dtheta^2*dim1rthetam1^2*dim1rthetam2*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rtheta1+2*dtheta^2*dim1rthetam1^2*dim1rtheta*(-dtheta2)^2-4*dtheta^3*dim1rthetam1^2*dim1rtheta*(-dtheta2)+2*(-dtheta)^3*dtheta*dim1rthetam1^2*dim1rtheta-(-dtheta)^2*dim1rthetam1^3*(-dtheta2)^2+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rtheta*(-dtheta2)+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+(-dtheta)^2*dtheta*dim1rthetam1^2*dim1rthetam2*(-dtheta2)+(-dtheta)^3*dim1rthetam1^3*(-dtheta2)-2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)^2-4*dtheta^3*dim1rthetam1^2*dim1rthetam2*(-dtheta2)-4*dtheta^3*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+2*dtheta^2*dim1rthetam1^2*dim1rtheta1*(-dtheta2)^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rthetam2*dtheta^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rtheta1*dtheta^2-6*(-dtheta)^2*dim1rthetam1^2*dim1rtheta*dtheta^2-4*(-dtheta)*dim1rthetam1^3*dtheta^2*(-dtheta2)+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rtheta1+3*(-dtheta)*dim1rthetam1^3*dtheta*(-dtheta2)^2+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rtheta+4*(-dtheta)*dtheta^3*dim1rthetam1^2*dim1rthetam2+(-dtheta)^3*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)-(-dtheta)^3*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+(-dtheta)^3*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)-4*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)-3*dtheta*dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2*(-dtheta2)^2-2*dtheta^2*dim1rtheta*dim1rthetam1*dim1rthetam2*(-dtheta2)^2+4*(-dtheta)*dim1rthetam1^2*dim1rtheta*dtheta^2*(-dtheta2)+4*(-dtheta)*dim1rthetam1^2*dim1rthetam2*dtheta^2*(-dtheta2)+4*(-dtheta)*dim1rthetam1^2*dim1rtheta1*dtheta^2*(-dtheta2)-3*(-dtheta)*dim1rthetam1^2*dim1rthetam2*dtheta*(-dtheta2)^2-3*(-dtheta)*dim1rthetam1^2*dim1rtheta*dtheta*(-dtheta2)^2-3*(-dtheta)*dim1rthetam1^2*dim1rtheta1*dtheta*(-dtheta2)^2+2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2-2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-2*(-dtheta)^3*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-2*(-dtheta)^3*dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta*dim1rthetam1*dim1rthetam2-6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rthetam2+6*(-dtheta)^2*dtheta^2*dim1rtheta1*dim1rthetam1*dim1rtheta-4*(-dtheta)*dim1rtheta1*dim1rthetam1*dim1rtheta*dtheta^2*(-dtheta2)-4*(-dtheta)*dtheta^3*dim1rtheta*dim1rthetam1*dim1rthetam2-4*(-dtheta)*dtheta^2*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+4*(-dtheta)*dim1rtheta1*dim1rtheta*dim1rthetam2*dtheta^2*(-dtheta2)-4*(-dtheta)*dim1rtheta1*dim1rthetam1*dim1rthetam2*dtheta^2*(-dtheta2)+(-dtheta)^3*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2-(-dtheta)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2*(-dtheta2)-(-dtheta)^2*dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta*(-dtheta2)-(-dtheta)^2*dtheta*dim1rtheta*dim1rthetam1*(-dtheta2)*dim1rthetam2+6*(-dtheta)^2*dim1rthetam1^3*dtheta^2-4*(-dtheta)*dtheta^3*dim1rthetam1^3-2*dtheta^2*dim1rthetam1^3*(-dtheta2)^2+4*dtheta^3*dim1rthetam1^3*(-dtheta2)-2*(-dtheta)^3*dtheta*dim1rthetam1^3-(-dtheta)^3*dim1rthetam1^2*dim1rtheta1*(-dtheta2)+(-dtheta)^2*dim1rthetam1^2*dim1rtheta*(-dtheta2)^2+(-dtheta)^2*dim1rthetam1^2*dim1rthetam2*(-dtheta2)^2+(-dtheta)^2*dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)+4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rtheta*dim1rthetam2-4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rthetam2-4*(-dtheta)*dtheta^3*dim1rtheta1*dim1rthetam1*dim1rtheta+2*dtheta^2*dim1rtheta1*dim1rtheta*dim1rthetam2*(-dtheta2)^2-(-dtheta)^3*dim1rthetam1^2*dim1rthetam2*(-dtheta2)-(-dtheta)^3*dim1rthetam1^2*dim1rtheta*(-dtheta2)+(-dtheta)^2*dim1rthetam1^2*dim1rtheta1*(-dtheta2)^2-(-dtheta)^2*dtheta*dim1rthetam1^3*(-dtheta2)-dim1rtheta1*(-dtheta)^2*dim1rthetam1*dim1rtheta*(-dtheta2)^2+dim1rtheta1*(-dtheta)^2*dim1rtheta*dim1rthetam2*(-dtheta2)^2-dim1rtheta*(-dtheta)^2*dim1rthetam1*dim1rthetam2*(-dtheta2)^2)*(sim1rtm1-s0-sr*dim1rthetam1-1/2*srr*dim1rthetam1^2-1/6*sr3*dim1rthetam1^3-1/24*sr4*dim1rthetam1^4)+dtheta*(-4*dtheta^2*(-dtheta)*dim2rtheta1*dim2rtheta+2*(-dtheta2)^2*dim1rthetam1*dim1rtheta*dtheta-2*dim2rtheta*dim1rthetam1*dtheta*(-dtheta)^2+4*dim2rtheta*dim1rthetam1*(-dtheta)*dtheta^2+(-dtheta)*(-dtheta2)^2*di2rtheta1^2+2*(-dtheta2)^2*dtheta*dim1rtheta1*dim1rthetam1-2*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta-2*dtheta*(-dtheta)^2*dim1rtheta*dim2rtheta1+4*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta+4*dtheta^2*(-dtheta)*dim1rtheta*dim2rtheta1-4*dtheta^2*dim2rtheta^2*(-dtheta)-4*dtheta^2*(-dtheta)*dim2rtheta1^2+2*dim2rtheta1^2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2-di2rtheta1^2*(-dtheta2)*(-dtheta)^2-(-dtheta)*dim1rtheta1*di2rtheta1*(-dtheta2)^2-(-dtheta)*dim1rtheta1*di2rtheta*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*dim1rtheta1+(-dtheta)^2*(-dtheta2)*di2rtheta*dim1rtheta1-2*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2+4*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2-4*dtheta^2*dim1rthetam1*(-dtheta2)*dim1rtheta+2*dtheta*(-dtheta)^2*dim2rtheta*dim2rtheta1-4*dtheta^2*(-dtheta2)*dim1rtheta1*dim1rtheta+4*dtheta^2*(-dtheta)*dim2rtheta1*dim1rtheta1-4*dtheta^2*dim1rtheta1*(-dtheta2)*dim1rthetam1-2*(-dtheta)^2*dtheta*dim2rtheta*dim1rtheta1-2*(-dtheta)^2*dtheta*dim2rtheta1*dim1rtheta1+4*dtheta^2*(-dtheta)*dim2rtheta*dim1rtheta1+2*dtheta*dim1rtheta1*(-dtheta2)^2*dim1rtheta-(-dtheta2)^2*dim1rthetam1*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rtheta*(-dtheta)*di2rtheta1-(-dtheta2)^2*dim1rtheta*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam1*(-dtheta)*di2rtheta1-di2rtheta^2*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta^2+(-dtheta)^2*(-dtheta2)*dim1rtheta*di2rtheta1+(-dtheta)^2*(-dtheta2)*dim1rtheta*di2rtheta+di2rtheta1*dim1rthetam1*(-dtheta2)*(-dtheta)^2+di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1-(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2+dtheta*dim1rthetam2^3-dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dim1rthetam2^2*dtheta*dim1rtheta1-dim1rthetam2^2*dtheta*dim1rtheta-dim1rthetam2^2*dtheta*dim1rthetam1+dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2-dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2+(-dtheta)*dim1rthetam2^2*dim1rtheta1+(-dtheta)*dim1rthetam2^2*dim1rtheta+(-dtheta)*dim1rthetam2^2*dim1rthetam1+dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta-(-dtheta)*dim1rthetam2^3+dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2)*(sim1rtm2-s0-sr*dim1rthetam2-1/2*srr*dim1rthetam2^2-1/6*sr3*dim1rthetam2^3-1/24*sr4*dim1rthetam2^4)-dtheta*(-4*dtheta^2*(-dtheta)*dim2rtheta1*dim2rtheta-2*dim2rtheta*dim1rthetam1*dtheta*(-dtheta)^2+4*dim2rtheta*dim1rthetam1*(-dtheta)*dtheta^2-2*dim1rthetam2*dim2rtheta*dtheta*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta1^2+2*(-dtheta2)^2*dtheta*dim1rtheta1*dim1rthetam1-4*dtheta^2*dim2rtheta^2*(-dtheta)-4*dtheta^2*(-dtheta)*dim2rtheta1^2+2*dim2rtheta1^2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta)^2*dim2rtheta^2-di2rtheta1^2*(-dtheta2)*(-dtheta)^2-(-dtheta)*dim1rtheta1*di2rtheta1*(-dtheta2)^2-(-dtheta)*dim1rtheta1*di2rtheta*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)*di2rtheta1*dim1rtheta1+(-dtheta)^2*(-dtheta2)*di2rtheta*dim1rtheta1+4*dim1rthetam2*dim2rtheta*(-dtheta)*dtheta^2-2*dim2rtheta1*dim1rthetam1*dtheta*(-dtheta)^2+4*dim2rtheta1*dim1rthetam1*(-dtheta)*dtheta^2-2*dim1rthetam2*dim2rtheta1*dtheta*(-dtheta)^2+4*dim1rthetam2*dim2rtheta1*(-dtheta)*dtheta^2-4*dtheta^2*dim1rthetam1*(-dtheta2)*dim1rthetam2+2*(-dtheta2)^2*dtheta*dim1rthetam1*dim1rthetam2+2*dtheta*(-dtheta)^2*dim2rtheta*dim2rtheta1-4*dtheta^2*(-dtheta2)*dim1rtheta1*dim1rthetam2+4*dtheta^2*(-dtheta)*dim2rtheta1*dim1rtheta1-4*dtheta^2*dim1rtheta1*(-dtheta2)*dim1rthetam1-2*(-dtheta)^2*dtheta*dim2rtheta*dim1rtheta1-2*(-dtheta)^2*dtheta*dim2rtheta1*dim1rtheta1+4*dtheta^2*(-dtheta)*dim2rtheta*dim1rtheta1+2*dtheta*dim1rtheta1*dim1rthetam2*(-dtheta2)^2-(-dtheta2)^2*dim1rthetam1*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam1*(-dtheta)*di2rtheta1-(-dtheta2)^2*dim1rthetam2*(-dtheta)*di2rtheta-(-dtheta2)^2*dim1rthetam2*(-dtheta)*di2rtheta1-di2rtheta^2*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta^2+di2rtheta1*dim1rthetam1*(-dtheta2)*(-dtheta)^2+dim1rthetam2*di2rtheta1*(-dtheta2)*(-dtheta)^2+di2rtheta*dim1rthetam1*(-dtheta2)*(-dtheta)^2+(-dtheta)*(-dtheta2)^2*di2rtheta*di2rtheta1+dim1rthetam2*di2rtheta*(-dtheta2)*(-dtheta)^2-(-dtheta2)*(-dtheta)^2*di2rtheta*di2rtheta1)/(-(-dtheta)*(-dtheta2)^2+(-dtheta)^2*(-dtheta2)-4*dtheta^2*(-dtheta2)+4*dtheta^2*(-dtheta)-2*dtheta*(-dtheta)^2+2*dtheta*(-dtheta2)^2)/(-dtheta)/(-dtheta*dim1rtheta1*dim1rthetam1*dim1rtheta-dtheta*dim1rtheta^3-(-dtheta)*dim1rtheta^2*dim1rtheta1-(-dtheta)*dim1rtheta^2*dim1rthetam2-(-dtheta)*dim1rtheta^2*dim1rthetam1-dtheta*dim1rtheta*dim1rthetam1*dim1rthetam2-dtheta*dim1rtheta1*dim1rtheta*dim1rthetam2+dtheta*dim1rtheta1*dim1rthetam1*dim1rthetam2+dtheta*dim1rtheta^2*dim1rthetam1+dtheta*dim1rtheta^2*dim1rtheta1+dtheta*dim1rtheta^2*dim1rthetam2+dim1rtheta*(-dtheta)*dim1rthetam1*dim1rthetam2+dim1rtheta1*(-dtheta)*dim1rtheta*dim1rthetam2+dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rtheta-dim1rtheta1*(-dtheta)*dim1rthetam1*dim1rthetam2+(-dtheta)*dim1rtheta^3)*(sim1rt-s0-sr*dim1rtheta-1/2*srr*dim1rtheta^2-1/6*sr3*dim1rtheta^3-1/24*sr4*dim1rtheta^4)+2*dtheta^2*(-dtheta)/(-dtheta2)/(-2*dtheta^2*(-dtheta)*dim2rtheta1+2*dtheta^2*dim2rtheta1*(-dtheta2)+2*dtheta^2*(-dtheta)*dim2rtheta-2*dtheta^2*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta)*dim2rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)^2*dim2rtheta1-3*(-dtheta)*dtheta*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta2)^2*dim2rtheta-(-dtheta2)^3*dim2rtheta-(-dtheta)*(-dtheta2)^2*dim2rtheta1+(-dtheta)*(-dtheta2)^2*dim2rtheta+(-dtheta2)^3*dim2rtheta1)*(sim2rt-s0-sr*dim2rtheta-1/2*srr*dim2rtheta^2-1/6*sr3*dim2rtheta^3-1/24*sr4*dim2rtheta^4)-2*dtheta^2*(-dtheta)/(-dtheta2)/(-2*dtheta^2*(-dtheta)*dim2rtheta1+2*dtheta^2*dim2rtheta1*(-dtheta2)+2*dtheta^2*(-dtheta)*dim2rtheta-2*dtheta^2*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta)*dim2rtheta1*(-dtheta2)-3*dtheta*(-dtheta2)^2*dim2rtheta1-3*(-dtheta)*dtheta*dim2rtheta*(-dtheta2)+3*dtheta*(-dtheta2)^2*dim2rtheta-(-dtheta2)^3*dim2rtheta-(-dtheta)*(-dtheta2)^2*dim2rtheta1+(-dtheta)*(-dtheta2)^2*dim2rtheta+(-dtheta2)^3*dim2rtheta1)*(sim2rt1-s0-sr*dim2rtheta1-1/2*srr*dim2rtheta1^2-1/6*sr3*dim2rtheta1^3-1/24*sr4*dim2rtheta1^4)-1/2*(-dtheta)*(-dtheta2)/dtheta/((-dtheta)*(-dtheta2)*di2rtheta-2*di2rtheta*dtheta*(-dtheta)+2*(-dtheta)*dtheta*di2rtheta1-di2rtheta1*(-dtheta2)*(-dtheta)+4*di2rtheta*dtheta^2-2*di2rtheta*dtheta*(-dtheta2)+2*(-dtheta2)*dtheta*di2rtheta1-4*di2rtheta1*dtheta^2)*(si2rt-s0-sr*di2rtheta-1/2*srr*di2rtheta^2-1/6*sr3*di2rtheta^3-1/24*sr4*di2rtheta^4)+1/2*(-dtheta)*(-dtheta2)/dtheta/((-dtheta)*(-dtheta2)*di2rtheta-2*di2rtheta*dtheta*(-dtheta)+2*(-dtheta)*dtheta*di2rtheta1-di2rtheta1*(-dtheta2)*(-dtheta)+4*di2rtheta*dtheta^2-2*di2rtheta*dtheta*(-dtheta2)+2*(-dtheta2)*dtheta*di2rtheta1-4*di2rtheta1*dtheta^2)*(si2rt1-s0-sr*di2rtheta1-1/2*srr*di2rtheta1^2-1/6*sr3*di2rtheta1^3-1/24*sr4*di2rtheta1^4);

