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 Th6:
  not 0 in Z & Z c= dom (cos*((id Z)^)) implies cos*((id Z)^)
is_differentiable_on Z & for x st x in Z holds ((cos*((id Z)^))`|Z).x = 1/x^2*
  sin.(1/x)
proof
  set f = id Z;
  assume that
A1: not 0 in Z and
A2: Z c= dom (cos*(f^));
  for y being object st y in Z holds y in dom (f^) by A2,FUNCT_1:11;
  then
A3: Z c= dom (f^);
A4: f^ is_differentiable_on Z by A1,Th4;
A5: for x st x in Z holds cos*(f^) is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then
A6: f^ is_differentiable_in x by A4,FDIFF_1:9;
    cos is_differentiable_in (f^).x by SIN_COS:63;
    hence thesis by A6,FDIFF_2:13;
  end;
  then
A7: cos*(f^) is_differentiable_on Z by A2,FDIFF_1:9;
  for x st x in Z holds ((cos*(f^))`|Z).x = 1/x^2*sin.(1/x)
  proof
    let x;
A8: diff(cos,(f^).x)=-sin.((f^).x) by SIN_COS:63;
A9: cos is_differentiable_in (f^).x by SIN_COS:63;
    assume
A10: x in Z;
    then f^ is_differentiable_in x by A4,FDIFF_1:9;
    then diff(cos*(f^),x) = diff(cos, (f^).x)*diff(f^,x) by A9,FDIFF_2:13
      .=-sin.((f^).x)*diff(f^,x) by A8
      .=-sin.((f.x)")*diff(f^,x) by A3,A10,RFUNCT_1:def 2
      .=-sin.((f.x)")*((f^)`|Z).x by A4,A10,FDIFF_1:def 7
      .=-sin.((f.x)")*(-1/x^2) by A1,A10,Th4
      .=-sin.(1*x")*(-1/x^2) by A10,FUNCT_1:18
      .=-sin.(1/x)*(-1/x^2) by XCMPLX_0:def 9
      .=sin.(1/x)*(1/x^2);
    hence thesis by A7,A10,FDIFF_1:def 7;
  end;
  hence thesis by A2,A5,FDIFF_1:9;
end;
