reserve x for Real,

  n for Element of NAT,
   y for set,
  Z for open Subset of REAL,

     g for PartFunc of REAL,REAL;

theorem
  not 0 in Z & Z c= dom ((id Z)(#)(arccot*((id Z)^))) & (for x st x in Z
  holds ((id Z)^).x > -1 & ((id Z)^).x < 1) implies (id Z)(#)(arccot*((id Z)^))
is_differentiable_on Z & for x st x in Z holds (((id Z)(#)(arccot*((id Z)^)))`|
  Z).x = arccot.(1/x)+x/(1+x^2)
proof
  set f = id Z;
  assume that
A1: not 0 in Z and
A2: Z c= dom ((id Z)(#)(arccot*(f^))) and
A3: for x st x in Z holds (f^).x > -1 & (f^).x < 1;
A4: Z c= dom (id Z) /\ dom (arccot*(f^)) by A2,VALUED_1:def 4;
  then
A5: Z c= dom (arccot*(f^)) by XBOOLE_1:18;
  then
A6: arccot*(f^) is_differentiable_on Z by A1,A3,SIN_COS9:112;
A7: for x st x in Z holds (id Z).x = 1*x+0 by FUNCT_1:18;
A8: Z c= dom id Z by A4,XBOOLE_1:18;
  then
A9: id Z is_differentiable_on Z by A7,FDIFF_1:23;
  for y being object st y in Z holds y in dom (f^) by A5,FUNCT_1:11;
  then
A10: Z c= dom (f^) by TARSKI:def 3;
  for x st x in Z holds (((id Z)(#)(arccot*(f^)))`|Z).x = arccot.(1/x)+x/
  (1+x^2)
  proof
    let x;
    assume
A11: x in Z;
    then
    (((id Z)(#)(arccot*(f^)))`|Z).x = ((arccot*(f^)).x)*diff((id Z),x)+((
    id Z).x)*diff(arccot*(f^),x) by A2,A6,A9,FDIFF_1:21
      .= ((arccot*(f^)).x)*((id Z)`|Z).x+((id Z).x)*diff(arccot*(f^),x) by A9
,A11,FDIFF_1:def 7
      .= ((arccot*(f^)).x)*1+((id Z).x)*diff(arccot*(f^),x) by A8,A7,A11,
FDIFF_1:23
      .= ((arccot*(f^)).x)*1+x*diff(arccot*(f^),x) by A11,FUNCT_1:18
      .= (arccot*(f^)).x+x*(((arccot*(f^))`|Z).x) by A6,A11,FDIFF_1:def 7
      .= (arccot*(f^)).x+x*(1/(1+x^2)) by A1,A3,A5,A11,SIN_COS9:112
      .= arccot.((f^).x)+x/(1+x^2) by A5,A11,FUNCT_1:12
      .= arccot.((f.x)")+x/(1+x^2) by A10,A11,RFUNCT_1:def 2
      .= arccot.(1/x)+x/(1+x^2) by A11,FUNCT_1:18;
    hence thesis;
  end;
  hence thesis by A2,A6,A9,FDIFF_1:21;
end;
