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 Th107:
  Z c= dom (f1+f2) & (for x st x in Z holds f1.x=1) & f2=( #Z 2)*
f & (for x st x in Z holds f.x=x/r) implies f1+f2 is_differentiable_on Z & for
  x st x in Z holds ((f1+f2)`|Z).x = (2*x)/(r^2)
proof
  assume that
A1: Z c= dom (f1+f2) and
A2: for x st x in Z holds f1.x=1 and
A3: f2=( #Z 2)*f and
A4: for x st x in Z holds f.x=x/r;
A5: for x st x in Z holds f1.x=0*x+1 by A2;
A6: Z c= dom f1 /\ dom f2 by A1,VALUED_1:def 1;
  then
A7: Z c= dom f1 by XBOOLE_1:18;
  then
A8: f1 is_differentiable_on Z by A5,FDIFF_1:23;
A9: for x st x in Z holds f.x=(1/r)*x+0
  proof
    let x;
    assume x in Z;
    hence f.x = x/r by A4
      .= (1/r)*x+0;
  end;
A10: for x st x in Z holds f2 is_differentiable_in x
  proof
    let x;
    Z c= dom (( #Z 2)*f) by A3,A6,XBOOLE_1:18;
    then for y being object st y in Z holds y in dom f by FUNCT_1:11;
    then Z c= dom f;
    then
A11: f is_differentiable_on Z by A9,FDIFF_1:23;
    assume x in Z;
    then f is_differentiable_in x by A11,FDIFF_1:9;
    hence thesis by A3,TAYLOR_1:3;
  end;
  Z c= dom f2 by A6,XBOOLE_1:18;
  then
A12: f2 is_differentiable_on Z by A10,FDIFF_1:9;
A13: for x st x in Z holds (f2`|Z).x = (2*x)/(r^2)
  proof
    let x;
    assume
A14: x in Z;
    Z c= dom (( #Z 2)*f) by A3,A6,XBOOLE_1:18;
    then for y being object st y in Z holds y in dom f by FUNCT_1:11;
    then
A15: Z c= dom f;
    then
A16: f is_differentiable_on Z by A9,FDIFF_1:23;
    then
A17: f is_differentiable_in x by A14,FDIFF_1:9;
    (f2`|Z).x = diff(( #Z 2)*f,x) by A3,A12,A14,FDIFF_1:def 7
      .= 2 * (f.x) #Z (2-1) *diff(f,x) by A17,TAYLOR_1:3
      .= 2*(f.x)*diff(f,x) by PREPOWER:35
      .= 2*(x/r)*diff(f,x) by A4,A14
      .= 2*(x/r)*(f`|Z).x by A14,A16,FDIFF_1:def 7
      .= 2*(x/r)*(1/r) by A9,A14,A15,FDIFF_1:23
      .= 2*((x/r)*(1/r))
      .= 2*((x*1)/(r*r)) by XCMPLX_1:76
      .= (2*x)/(r^2);
    hence thesis;
  end;
  for x st x in Z holds ((f1+f2)`|Z).x = (2*x)/(r^2)
  proof
    let x;
    assume
A18: x in Z;
    then ((f1+f2)`|Z).x = diff(f1,x) + diff(f2,x) by A1,A8,A12,FDIFF_1:18
      .= (f1`|Z).x + diff(f2,x) by A8,A18,FDIFF_1:def 7
      .= (f1`|Z).x + (f2`|Z).x by A12,A18,FDIFF_1:def 7
      .= 0 + (f2`|Z).x by A7,A5,A18,FDIFF_1:23
      .= (2*x)/(r^2) by A13,A18;
    hence thesis;
  end;
  hence thesis by A1,A8,A12,FDIFF_1:18;
end;
