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 (ln(#)arccot) & Z c= ].-1,1.[ implies (ln(#)arccot)
is_differentiable_on Z & for x st x in Z holds ((ln(#)arccot)`|Z).x = arccot.x/
  x-ln.x/(1+x^2)
proof
A1: right_open_halfline 0 = {g where g is Real: 0 < g} by XXREAL_1:230;
  assume that
A2: Z c= dom (ln(#)arccot) and
A3: Z c= ].-1,1.[;
A4: arccot is_differentiable_on Z by A3,Th82;
  Z c= dom ln /\ dom arccot by A2,VALUED_1:def 4;
  then
A5: Z c= dom ln by XBOOLE_1:18;
A6: for x st x in Z holds x > 0
  proof
    let x;
    assume x in Z;
    then x in right_open_halfline(0) by A5,TAYLOR_1:18;
    then ex g being Real st x = g & 0 < g by A1;
    hence thesis;
  end;
  then for x st x in Z holds ln is_differentiable_in x by TAYLOR_1:18;
  then
A7: ln is_differentiable_on Z by A5,FDIFF_1:9;
A8: for x st x in Z holds diff(ln,x) = 1/x
  proof
    let x;
    assume x in Z;
    then x > 0 by A6;
    then x in right_open_halfline(0) by A1;
    hence thesis by TAYLOR_1:18;
  end;
  for x st x in Z holds ((ln(#)arccot)`|Z).x = arccot.x/x-ln.x/(1+x^2)
  proof
    let x;
    assume
A9: x in Z;
    then
    ((ln(#)arccot)`|Z).x = (arccot.x)*diff(ln,x)+(ln.x)*diff(arccot,x) by A2,A7
,A4,FDIFF_1:21
      .= (arccot.x)*(1/x)+(ln.x)*diff(arccot,x) by A8,A9
      .= (arccot.x)*(1/x)+(ln.x)*((arccot)`|Z).x by A4,A9,FDIFF_1:def 7
      .= (arccot.x)*(1/x)+(ln.x)*(-1/(1+x^2)) by A3,A9,Th82
      .= arccot.x/x-ln.x/(1+x^2);
    hence thesis;
  end;
  hence thesis by A2,A7,A4,FDIFF_1:21;
end;
