reserve x for Real,

  Z for open Subset of REAL;

theorem
  Z c= dom (sin(#)(tan-cot)) implies sin(#)(tan-cot)
is_differentiable_on Z & for x st x in Z holds ((sin(#)(tan-cot))`|Z).x =cos.x*
  (tan.x-cot.x)+sin.x*(1/(cos.x)^2+1/(sin.x)^2)
proof
A1: for x st x in Z holds sin is_differentiable_in x by SIN_COS:64;
  assume
A2: Z c= dom (sin(#)(tan-cot));
  then
A3: Z c= dom (tan-cot) /\ dom sin by VALUED_1:def 4;
  then
A4: Z c= dom (tan-cot) by XBOOLE_1:18;
  then
A5: tan-cot is_differentiable_on Z by Th5;
  Z c= dom sin by A3,XBOOLE_1:18;
  then
A6: sin is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds (sin(#)(tan-cot)`|Z).x =cos.x*(tan.x-cot.x)+sin.x*
  (1/(cos.x)^2+1/(sin.x)^2)
  proof
    let x;
    assume
A7: x in Z;
    then
    (sin(#)(tan-cot)`|Z).x = ((tan-cot).x)*diff(sin,x)+sin.x*diff(tan-cot
    ,x) by A2,A5,A6,FDIFF_1:21
      .= (tan.x-cot.x)*diff(sin,x)+sin.x*diff(tan-cot,x) by A4,A7,VALUED_1:13
      .= (tan.x-cot.x) * cos.x +sin.x * diff(tan-cot,x) by SIN_COS:64
      .=(tan.x-cot.x) * cos.x +sin.x * ((tan-cot)`|Z).x by A5,A7,FDIFF_1:def 7
      .=(tan.x-cot.x) * cos.x +sin.x * (1/(cos.x)^2+1/(sin.x)^2) by A4,A7,Th5;
    hence thesis;
  end;
  hence thesis by A2,A5,A6,FDIFF_1:21;
end;
