 reserve a,b,x,r for Real;
 reserve y for set;
 reserve n for Element of NAT;
 reserve A for non empty closed_interval Subset of REAL;
 reserve f,g,f1,f2,g1,g2 for PartFunc of REAL,REAL;
 reserve Z for open Subset of REAL;

theorem Th1:
 Z c= dom ((f1+f2)^) & (for x st x in Z holds f1.x=1) & f2=#Z 2
 implies (f1+f2)^ is_differentiable_on Z & for x st x in Z holds
 (((f1+f2)^)`|Z).x = -2*x/(1+x |^2)^2
 proof
  assume
A1:Z c= dom ((f1+f2)^) & (for x st x in Z holds f1.x=1) & f2=#Z 2;
dom ((f1+f2)^) c= dom (f1+f2) by RFUNCT_1:1;
then A2:Z c= dom (f1+f2) by A1;
then A3:f1+f2 is_differentiable_on Z &
   for x st x in Z holds ((f1+f2)`|Z).x = 2*x by A1,SIN_COS9:101;
A4:for x st x in Z holds (f1+f2).x<>0 by A1,RFUNCT_1:3;
then A5:(f1+f2)^ is_differentiable_on Z by A3,FDIFF_2:22;
  for x st x in Z holds (((f1+f2)^)`|Z).x = -2*x/(1+x |^2)^2
  proof
    let x;
    assume
A6: x in Z; then
A7: (f1+f2).x<>0 by A1,RFUNCT_1:3;
A8: f1+f2 is_differentiable_in x by A3,A6,FDIFF_1:9;
A9:f2.x=x #Z 2 by A1,TAYLOR_1:def 1
      .=x |^2 by PREPOWER:36;
A10:(f1+f2).x=f1.x+f2.x by A2,A6,VALUED_1:def 1
      .=1+x |^2 by A1,A6,A9;
    (((f1+f2)^)`|Z).x = diff((f1+f2)^,x) by A5,A6,FDIFF_1:def 7
                   .= - diff((f1+f2),x)/((f1+f2).x)^2 by A7,A8,FDIFF_2:15
                   .= -((f1+f2)`|Z).x/((f1+f2).x)^2 by A3,A6,FDIFF_1:def 7
                   .= -2*x/(1+x |^2)^2 by A1,A2,A6,A10,SIN_COS9:101;
    hence thesis;
  end;
  hence thesis by A3,A4,FDIFF_2:22;
end;
