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