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