reserve y for set,
  x,r,a,b for Real,
  n for Element of NAT,
  Z for open Subset of REAL,
  f,f1,f2,f3 for PartFunc of REAL,REAL;

theorem
  Z c= dom ((-1/n)(#)(( #Z n)*(sin^))) & n>0 & (for x st x in Z holds
sin.x<>0) implies (-1/n)(#)(( #Z n)*(sin^)) is_differentiable_on Z & for x st x
  in Z holds (((-1/n)(#)(( #Z n)*(sin^)))`|Z).x=cos.x/((sin.x) #Z (n+1))
proof
  assume that
A1: Z c= dom ((-1/n)(#)(( #Z n)*(sin^))) and
A2: n>0 and
A3: for x st x in Z holds sin.x<>0;
A4: Z c= dom (( #Z n)*(sin^)) by A1,VALUED_1:def 5;
A5: sin^ is_differentiable_on Z by A3,FDIFF_4:40;
  now
    let x;
    assume x in Z;
    then sin^ is_differentiable_in x by A5,FDIFF_1:9;
    hence ( #Z n)*(sin^) is_differentiable_in x by TAYLOR_1:3;
  end;
  then
A6: ( #Z n)*(sin^) is_differentiable_on Z by A4,FDIFF_1:9;
  for y being object st y in Z holds y in dom (sin^) by A4,FUNCT_1:11;
  then
A7: Z c= dom (sin^) by TARSKI:def 3;
  for x st x in Z holds (((-1/n)(#)(( #Z n)*(sin^)))`|Z).x =cos.x/((sin.x
  ) #Z (n+1))
  proof
    let x;
    assume
A8: x in Z;
    then
A9: sin^ is_differentiable_in x by A5,FDIFF_1:9;
A10: (sin^).x=(sin.x)" by A7,A8,RFUNCT_1:def 2
      .=1/sin.x by XCMPLX_1:215;
    (((-1/n)(#)(( #Z n)*(sin^)))`|Z).x =(-1/n)*diff((( #Z n)*(sin^)),x)
    by A1,A6,A8,FDIFF_1:20
      .=(-1/n)*(n*(((sin^).x) #Z (n-1)) * diff(sin^,x)) by A9,TAYLOR_1:3
      .=(-1/n)*(n*(((sin^).x) #Z (n-1)) * ((sin^)`|Z).x) by A5,A8,FDIFF_1:def 7
      .=(-1/n)*(n*(((sin^).x) #Z (n-1)) *(-cos.x/(sin.x)^2)) by A3,A8,
FDIFF_4:40
      .=-((1/n)*n)*(((sin^).x) #Z (n-1)) *(-cos.x/(sin.x)^2)
      .=-1*(((sin^).x) #Z (n-1)) * (-cos.x/(sin.x)^2) by A2,XCMPLX_1:106
      .=-(1/sin.x) #Z (n-1) *(-cos.x/((sin.x) #Z 2)) by A10,Th1
      .=-(-cos.x/((sin.x) #Z 2))*(1/((sin.x) #Z (n-1))) by PREPOWER:42
      .=(cos.x/((sin.x) #Z 2))*(1/((sin.x) #Z (n-1)))
      .=cos.x/((sin.x) #Z 2)/((sin.x) #Z (n-1)) by XCMPLX_1:99
      .=cos.x/(((sin.x) #Z 2)*((sin.x) #Z (n-1))) by XCMPLX_1:78
      .=cos.x/((sin.x) #Z (2+(n-1))) by A3,A8,PREPOWER:44
      .=cos.x/((sin.x) #Z (n+1));
    hence thesis;
  end;
  hence thesis by A1,A6,FDIFF_1:20;
end;
