reserve x,x0, r, s, h for Real,

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

  f, f1, f2 for PartFunc of REAL,REAL;

theorem
  Z c= dom (arctan-id Z) & Z c= ].-1,1.[ implies arctan-id Z
is_differentiable_on Z & for x st x in Z holds ((arctan-id Z)`|Z).x = -x^2/(1+x
  ^2)
proof
  assume that
A1: Z c= dom (arctan-id Z) and
A2: Z c= ].-1,1.[;
A3: for x st x in Z holds (id Z).x = 1*x+0 by FUNCT_1:18;
  Z c= dom arctan /\ dom (id Z) by A1,VALUED_1:12;
  then
A4: Z c= dom (id Z) by XBOOLE_1:18;
  then
A5: id Z is_differentiable_on Z by A3,FDIFF_1:23;
A6: arctan is_differentiable_on Z by A2,Th81;
  for x st x in Z holds ((arctan-id Z)`|Z).x = -x^2/(1+x^2)
  proof
    let x;
A7: 1+x^2 > 0 by XREAL_1:34,63;
    assume
A8: x in Z;
    then ((arctan-id Z)`|Z).x = diff(arctan,x)-diff(id Z,x) by A1,A5,A6,
FDIFF_1:19
      .= ((arctan)`|Z).x-diff(id Z,x) by A6,A8,FDIFF_1:def 7
      .= 1/(1+x^2)-diff(id Z,x) by A2,A8,Th81
      .= 1/(1+x^2)-((id Z)`|Z).x by A5,A8,FDIFF_1:def 7
      .= 1/(1+x^2)-1 by A4,A3,A8,FDIFF_1:23
      .= 1/(1+x^2)-(1+x^2)/(1+x^2) by A7,XCMPLX_1:60
      .= -x^2/(1+x^2);
    hence thesis;
  end;
  hence thesis by A1,A5,A6,FDIFF_1:19;
end;
