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 ((id Z)(#)(arccot)+(1/2)(#)(ln*(f1+f2))) & Z c= ].-1,1.[ & f2
=#Z 2 & (for x st x in Z holds f1.x=1 ) implies (id Z)(#)(arccot)+(1/2)(#)(ln*(
f1+f2)) is_differentiable_on Z & for x st x in Z holds (((id Z)(#)(arccot)+(1/2
  )(#)(ln*(f1+f2)))`|Z).x = arccot.x
proof
  assume that
A1: Z c= dom ((id Z)(#)(arccot)+(1/2)(#)(ln*(f1+f2))) and
A2: Z c= ].-1,1.[ and
A3: f2=#Z 2 and
A4: for x st x in Z holds f1.x=1;
  Z c= dom ((id Z)(#)(arccot)) /\ dom ((1/2)(#)(ln*(f1+f2))) by A1,
VALUED_1:def 1;
  then
A5: Z c= dom ((1/2)(#)(ln*(f1+f2))) by XBOOLE_1:18;
  then
A6: ((1/2)(#)(ln*(f1+f2))) is_differentiable_on Z by A3,A4,Th102;
A7: (id Z)(#)(arccot) is_differentiable_on Z by A2,Th96;
  for x st x in Z holds (((id Z)(#)(arccot)+(1/2)(#)(ln*(f1+f2)))`|Z).x =
  arccot.x
  proof
    let x;
    assume
A8: x in Z;
    hence (((id Z)(#)(arccot)+(1/2)(#)(ln*(f1+f2)))`|Z).x = diff((id Z)(#)(
    arccot),x)+diff((1/2)(#)(ln*(f1+f2)),x) by A1,A7,A6,FDIFF_1:18
      .= (((id Z)(#)(arccot))`|Z).x+diff((1/2)(#)(ln*(f1+f2)),x) by A7,A8,
FDIFF_1:def 7
      .= (((id Z)(#)(arccot))`|Z).x+(((1/2)(#)(ln*(f1+f2)))`|Z).x by A6,A8,
FDIFF_1:def 7
      .= arccot.x-x/(1+x^2)+(((1/2)(#)(ln*(f1+f2)))`|Z).x by A2,A8,Th96
      .= arccot.x-x/(1+x^2)+x/(1+x^2) by A3,A4,A5,A8,Th102
      .= arccot.x;
  end;
  hence thesis by A1,A7,A6,FDIFF_1:18;
end;
