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 (f(#)(arctan)) & Z c= ].-1,1.[ & (for x st x in Z holds f.x=r
  *x+s) implies f(#)(arctan) is_differentiable_on Z & for x st x in Z holds ((f
  (#)(arctan))`|Z).x = r*arctan.x + (r*x+s)/(1+x^2)
proof
  assume that
A1: Z c= dom (f(#)(arctan)) and
A2: Z c= ].-1,1.[ and
A3: for x st x in Z holds f.x=r*x+s;
  Z c= dom f /\ dom arctan by A1,VALUED_1:def 4;
  then
A4: Z c= dom f by XBOOLE_1:18;
  then
A5: f 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 ((f(#)(arctan))`|Z).x = r*arctan.x + (r*x+s)/(1+x ^2)
  proof
    let x;
    assume
A7: x in Z;
    then
A8: -1 < x by A2,XXREAL_1:4;
A9: x < 1 by A2,A7,XXREAL_1:4;
    ((f(#)(arctan))`|Z).x = (arctan.x)*diff(f,x) + (f.x)*diff(arctan,x)
    by A1,A5,A6,A7,FDIFF_1:21
      .= (arctan.x)*(f`|Z).x + (f.x)*diff(arctan,x) by A5,A7,FDIFF_1:def 7
      .= (arctan.x)*r + (f.x)*diff(arctan,x) by A3,A4,A7,FDIFF_1:23
      .= (arctan.x)*r + (f.x)*(1/(1+x^2)) by A8,A9,Th75
      .= r*arctan.x + (r*x+s)/(1+x^2) by A3,A7;
    hence thesis;
  end;
  hence thesis by A1,A5,A6,FDIFF_1:21;
end;
