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 (arccot*f) & f=f1+h(#)f2 & (for x st x in Z holds f.x > -1 &
f.x < 1) & (for x st x in Z holds f1.x = r+s*x) & f2=#Z 2 implies arccot*(f1+h
(#)f2) is_differentiable_on Z & for x st x in Z holds ((arccot*(f1+h(#)f2))`|Z)
  .x = -(s+2*h*x)/(1+(r+s*x+h*x^2)^2)
proof
  assume that
A1: Z c= dom (arccot*f) and
A2: f=f1+h(#)f2 and
A3: for x st x in Z holds f.x > -1 & f.x < 1 and
A4: for x st x in Z holds f1.x = r+s*x and
A5: f2=#Z 2;
  dom (arccot*f) c= dom f by RELAT_1:25;
  then
A6: Z c= dom (f1+h(#)f2) by A1,A2;
  then Z c= dom f1 /\ dom (h(#)f2) by VALUED_1:def 1;
  then
A7: Z c= dom (h(#)f2) by XBOOLE_1:18;
A8: (f1+h(#)f2) is_differentiable_on Z by A4,A5,A6,FDIFF_4:12;
A9: for x st x in Z holds arccot*(f1+h(#)f2) is_differentiable_in x
  proof
    let x;
    assume
A10: x in Z;
    then
A11: f.x > -1 by A3;
A12: f.x < 1 by A3,A10;
    f is_differentiable_in x by A2,A8,A10,FDIFF_1:9;
    hence thesis by A2,A11,A12,Th86;
  end;
  then
A13: arccot*(f1+h(#)f2) is_differentiable_on Z by A1,A2,FDIFF_1:9;
  for x st x in Z holds ((arccot*(f1+h(#)f2))`|Z).x = -(s+2*h*x)/(1+(r+s*
  x+h*x^2)^2)
  proof
    let x;
    assume
A14: x in Z;
    then
A15: (f1+h(#)f2).x = f1.x+(h(#)f2).x by A6,VALUED_1:def 1
      .= f1.x+h*f2.x by A7,A14,VALUED_1:def 5
      .= r+s*x+h*(f2.x) by A4,A14
      .= r+s*x+h*(x #Z (1+1)) by A5,TAYLOR_1:def 1
      .= r+s*x+h*((x #Z 1)*(x #Z 1)) by TAYLOR_1:1
      .= r+s*x+h*(x*(x #Z 1)) by PREPOWER:35
      .= r+s*x+h*x^2 by PREPOWER:35;
A16: f is_differentiable_in x by A2,A8,A14,FDIFF_1:9;
A17: f.x > -1 by A3,A14;
A18: f.x < 1 by A3,A14;
    ((arccot*(f1+h(#)f2))`|Z).x = diff((arccot)*f,x) by A2,A13,A14,
FDIFF_1:def 7
      .= -diff(f,x)/(1+(f.x)^2) by A16,A17,A18,Th86
      .= -((f1+h(#)f2)`|Z).x/(1+(f.x)^2) by A2,A8,A14,FDIFF_1:def 7
      .= -(s+2*h*x)/(1+(r+s*x+h*x^2)^2) by A2,A4,A5,A6,A14,A15,FDIFF_4:12;
    hence thesis;
  end;
  hence thesis by A1,A2,A9,FDIFF_1:9;
end;
