reserve x for Real,

  Z for open Subset of REAL;

theorem Th5:
  Z c= dom(tan-cot) implies (tan - cot) is_differentiable_on Z &
  for x st x in Z holds((tan - cot)`|Z).x = 1/(cos.x)^2+1/(sin.x)^2
proof
  assume
A1: Z c= dom (tan-cot);
  then
A2: Z c= dom tan /\ dom cot by VALUED_1:12;
  then
A3: Z c= dom tan by XBOOLE_1:18;
  for x st x in Z holds tan is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then cos.x <> 0 by A3,FDIFF_8:1;
    hence thesis by FDIFF_7:46;
  end;
  then
A4: tan is_differentiable_on Z by A3,FDIFF_1:9;
A5: Z c= dom cot by A2,XBOOLE_1:18;
  for x st x in Z holds cot is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then sin.x <> 0 by A5,FDIFF_8:2;
    hence thesis by FDIFF_7:47;
  end;
  then
A6: cot is_differentiable_on Z by A5,FDIFF_1:9;
  for x st x in Z holds ((tan-cot)`|Z).x =1/(cos.x)^2+1/(sin.x)^2
  proof
    let x;
    assume
A7: x in Z;
    then
A8: sin.x<> 0 by A5,FDIFF_8:2;
A9: cos.x<> 0 by A3,A7,FDIFF_8:1;
    ((tan-cot)`|Z).x = diff(tan,x)-diff(cot,x)by A1,A6,A4,A7,FDIFF_1:19
      .=1/(cos.x)^2-diff(cot,x) by A9,FDIFF_7:46
      .=1/(cos.x)^2-(-1/(sin.x)^2) by A8,FDIFF_7:47
      .=1/(cos.x)^2+1/(sin.x)^2;
    hence thesis;
  end;
  hence thesis by A1,A6,A4,FDIFF_1:19;
end;
