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

theorem
  Z c= dom (( #R (1/2))*f) & f=f1+f2 & f2=#Z 2 & (for x st x in Z holds
f1.x=a^2 & f.x>0) implies ( #R (1/2))*f is_differentiable_on Z & for x st x in
  Z holds ((( #R (1/2))*f)`|Z).x =x * (a^2+x |^2) #R (-1/2)
proof
  assume that
A1: Z c= dom (( #R (1/2))*f) and
A2: f=f1+f2 and
A3: f2=#Z 2 and
A4: for x st x in Z holds f1.x=a^2 & f.x>0;
  for y being object st y in Z holds y in dom f by A1,FUNCT_1:11;
  then
A5: Z c= dom (f1+f2) by A2,TARSKI:def 3;
A6: for x st x in Z holds f1.x=a^2 by A4;
  then
A7: f is_differentiable_on Z by A2,A3,A5,Th17;
A8: for x st x in Z holds ( #R (1/2))*f is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then f is_differentiable_in x & f.x >0 by A4,A7,FDIFF_1:9;
    hence thesis by TAYLOR_1:22;
  end;
  then
A9: ( #R (1/2))*f is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((( #R (1/2))*f)`|Z).x =x * (a^2+x |^2) #R (-1/2)
  proof
    let x;
    assume
A10: x in Z;
    then x in dom (f1+f2) by A1,A2,FUNCT_1:11;
    then
A11: ( f1+f2).x=f1.x + f2.x by VALUED_1:def 1
      .=a^2 +(f2.x) by A4,A10
      .=a^2 +(x #Z 2) by A3,TAYLOR_1:def 1
      .=a^2 +(x |^2) by PREPOWER:36;
    f is_differentiable_in x & f.x >0 by A4,A7,A10,FDIFF_1:9;
    then diff(( #R (1/2)) *f,x) = (1/2)*( ( f.x) #R (1/2-1)) * diff(f,x) by
TAYLOR_1:22
      .= (1/2)*( ( f.x) #R (1/2-1))*(f`|Z).x by A7,A10,FDIFF_1:def 7
      .= (1/2)*( (a^2+x |^2) #R (1/2-1))*(2*x) by A2,A3,A5,A6,A10,A11,Th17
      .=x* (a^2+x |^2) #R (-1/2);
    hence thesis by A9,A10,FDIFF_1:def 7;
  end;
  hence thesis by A1,A8,FDIFF_1:9;
end;
