reserve y for set,
  x,a,b for Real,
  n for Element of NAT,
  Z for open Subset of REAL,
  f,f1,f2,g for PartFunc of REAL,REAL;

theorem Th22:
  Z c= dom ((f1+f2)/(f1-f2)) & (for x st x in Z holds f1.x=a) & f2
  =#Z 2 & (for x st x in Z holds (f1-f2).x>0) implies (f1+f2)/(f1-f2)
is_differentiable_on Z & for x st x in Z holds (((f1+f2)/(f1-f2))`|Z).x = (4*a*
  x)/(a-x|^2)|^2
proof
  assume that
A1: Z c= dom ((f1+f2)/(f1-f2)) and
A2: for x st x in Z holds f1.x=a and
A3: f2=#Z 2 and
A4: for x st x in Z holds (f1-f2).x>0;
A5: Z c= dom (f1+f2) /\ (dom (f1-f2)\(f1-f2)"{0}) by A1,RFUNCT_1:def 1;
  then
A6: Z c= dom (f1+f2) by XBOOLE_1:18;
  then
A7: f1+f2 is_differentiable_on Z by A2,A3,Lm1;
A8: Z c= dom (f1-f2) by A5,XBOOLE_1:1;
  then
A9: f1-f2 is_differentiable_on Z by A2,A3,Lm2;
A10: for x st x in Z holds (f1-f2).x <> 0 by A4;
  then
A11: (f1+f2)/(f1-f2) is_differentiable_on Z by A7,A9,FDIFF_2:21;
  for x st x in Z holds (((f1+f2)/(f1-f2))`|Z).x = (4*a*x)/(a-x|^2)|^2
  proof
    let x;
    assume
A12: x in Z;
    then
A13: f1.x=a by A2;
A14: (f1-f2).x <>0 by A4,A12;
    f1+f2 is_differentiable_in x & f1-f2 is_differentiable_in x by A7,A9,A12,
FDIFF_1:9;
    then
    diff((f1+f2)/(f1-f2),x) =(diff((f1+f2),x)*(f1-f2).x - diff((f1-f2),x)
    *(f1+f2).x)/((f1-f2).x)^2 by A14,FDIFF_2:14
      .=(diff((f1+f2),x)*(f1.x-f2.x)- diff((f1-f2),x)*(f1+f2).x)/((f1-f2).x)
    ^2 by A8,A12,VALUED_1:13
      .=(diff((f1+f2),x)*(f1.x-f2.x)- diff((f1-f2),x)* (f1.x+f2.x))/((f1-f2)
    .x)^2 by A6,A12,VALUED_1:def 1
      .=(diff((f1+f2),x)*(f1.x-f2.x)- diff((f1-f2),x)* (f1.x+f2.x))/(f1.x-f2
    .x)^2 by A8,A12,VALUED_1:13
      .=((((f1+f2)`|Z).x)*(f1.x-f2.x)- diff((f1-f2),x)* (f1.x+f2.x))/(f1.x-
    f2.x)^2 by A7,A12,FDIFF_1:def 7
      .=((2*x)*(f1.x-f2.x)-diff((f1-f2),x)*(f1.x+f2.x))/(f1.x-f2.x)^2 by A2,A3
,A6,A12,Lm1
      .=((2*x)*(f1.x-f2.x)-(((f1-f2)`|Z).x)*(f1.x+f2.x))/(f1.x-f2.x)^2 by A9
,A12,FDIFF_1:def 7
      .=((2*x)*(f1.x-f2.x)-(-2*x)*(f1.x+f2.x))/(f1.x-f2.x)^2 by A2,A3,A8,A12
,Lm2
      .=(4*x*a)/(a-(x #Z 2))^2 by A3,A13,TAYLOR_1:def 1
      .=(4*x*a)/(a-x|^2)^2 by PREPOWER:36
      .=(4*x*a)/((a-x|^2)|^1*(a- x|^2))
      .=(4*x*a)/(a-x|^2)|^(1+1)by NEWTON:6
      .= (4*a*x)/(a-x|^2)|^2;
    hence thesis by A11,A12,FDIFF_1:def 7;
  end;
  hence thesis by A7,A9,A10,FDIFF_2:21;
end;
