 reserve n,m,i,p for Nat,
         h,k,r,r1,r2,x,x0,x1,x2,x3 for Real;
 reserve f,f1,f2,g for Function of REAL,REAL;

theorem
  x in dom cosec & x+h in dom cosec implies
  fD(cosec(#)cosec,h).x = -4*sin(2*x+h)*sin(h)/(cos(2*x+h)-cos(h))^2
proof
  set f=cosec(#)cosec;
  assume
A1:x in dom cosec & x+h in dom cosec;
A2:sin.x<>0 & sin.(x+h)<>0 by A1,RFUNCT_1:3;
  x in dom f & x+h in dom f
  proof
    x in dom cosec /\ dom cosec & x+h in dom cosec /\ dom cosec by A1;
    hence thesis by VALUED_1:def 4;
  end;
  then
  fD(f,h).x = (cosec(#)cosec).(x+h)-(cosec(#)cosec).x by DIFF_1:1
    .= cosec.(x+h)*cosec.(x+h)-(cosec(#)cosec).x by VALUED_1:5
    .= cosec.(x+h)*cosec.(x+h)-cosec.x*cosec.x by VALUED_1:5
    .= (sin.(x+h))"*cosec.(x+h)-cosec.x*cosec.x by A1,RFUNCT_1:def 2
    .= (sin.(x+h))"*(sin.(x+h))"-cosec.x*cosec.x by A1,RFUNCT_1:def 2
    .= (sin.(x+h))"*(sin.(x+h))"-(sin.x)"*cosec.x by A1,RFUNCT_1:def 2
    .= ((sin.(x+h))")^2-((sin.x)")^2 by A1,RFUNCT_1:def 2
    .= (1/sin.(x+h)-1/sin.x)*(1/sin.(x+h)+1/sin.x)
    .= ((1*sin.x-1*sin.(x+h))/(sin.(x+h)*sin.x))*(1/sin.(x+h)+1/sin.x)
                                                       by A2,XCMPLX_1:130
    .= ((sin.x-sin.(x+h))/(sin.(x+h)*sin.x))
       *((sin.x+sin.(x+h))/(sin.(x+h)*sin.x)) by A2,XCMPLX_1:116
    .= ((sin.x-sin.(x+h))*(sin.x+sin.(x+h)))
       /((sin.(x+h)*sin.x)*(sin.(x+h)*sin.x)) by XCMPLX_1:76
    .= (sin(x)*sin(x)-sin(x+h)*sin(x+h))/(sin(x+h)*sin(x))^2
    .= (sin(x+(x+h))*sin(x-(x+h)))/(sin(x+h)*sin(x))^2 by SIN_COS4:37
    .= (sin(2*x+h)*sin(-h))
       /(-(1/2)*(cos((x+h)+x)-cos((x+h)-x)))^2 by SIN_COS4:29
    .= (sin(2*x+h)*(-sin(h)))/((1/4)*(cos(2*x+h)-cos(h))^2) by SIN_COS:31
    .= -1*(sin(2*x+h)*sin(h))/((1/4)*(cos(2*x+h)-cos(h))^2)
    .= -(1/(1/4))*((sin(2*x+h)*sin(h))/(cos(2*x+h)-cos(h))^2) by XCMPLX_1:76
    .= -4*sin(2*x+h)*sin(h)/(cos(2*x+h)-cos(h))^2;
  hence thesis;
end;
