reserve x,r,a,x0,p for Real;
reserve n,i,m for Element of NAT;
reserve Z for open Subset of REAL;
reserve f,f1,f2 for PartFunc of REAL,REAL;
reserve k for Nat;

theorem
  f is_differentiable_on 2,Z implies diff(f^2,Z).2=2(#)(f(#)(diff(f,Z).2
  ))+2(#)((f`|Z)^2)
proof
  assume f is_differentiable_on 2,Z;
  then
  diff(f^2,Z).2 =(diff(f,Z).2)(#)f+(2(#)((f`|Z)(#)(f`|Z))+f(#)(diff(f,Z).2
  )) by Th50
    .=((diff(f,Z).2)(#)f+ f(#)(diff(f,Z).2)) + 2(#)((f`|Z)(#)(f`|Z)) by
RFUNCT_1:8
    .=1(#)(f(#)(diff(f,Z).2))+ f(#)(diff(f,Z).2) + 2(#)((f`|Z)(#)(f`|Z)) by
RFUNCT_1:21
    .=1(#)(f(#)(diff(f,Z).2))+1(#)(f(#)(diff(f,Z).2))+2(#)((f`|Z)(#)(f`|Z))
  by RFUNCT_1:21
    .=(1+1)(#)(f(#)(diff(f,Z).2))+2(#)((f`|Z)(#)(f`|Z)) by Th5
    .=2(#)(f(#)(diff(f,Z).2))+2(#)((f`|Z)(#)(f`|Z))
    .=2(#)(f(#)(diff(f,Z).2))+2(#)((f`|Z)^2);
  hence thesis;
end;
