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
  not 0 in Z & Z c= dom (g(#)(sin*((id Z)^))) & g=#Z 2 implies g(#)(sin*
((id Z)^)) is_differentiable_on Z & for x st x in Z holds ((g(#)(sin*((id Z)^))
  )`|Z).x = 2*x*sin.(1/x)-cos.(1/x)
proof
  set f = id Z;
  assume that
A1: not 0 in Z and
A2: Z c= dom (g(#)(sin*(f^))) and
A3: g=#Z 2;
A4: for x st x in Z holds g is_differentiable_in x by A3,TAYLOR_1:2;
A5: Z c= dom g /\ dom (sin*(f^)) by A2,VALUED_1:def 4;
  then Z c= dom g by XBOOLE_1:18;
  then
A6: g is_differentiable_on Z by A4,FDIFF_1:9;
A7: for x st x in Z holds (g`|Z).x = 2*x
  proof
    let x;
    assume
A8: x in Z;
    diff(g,x) = 2 * (x #Z (2-1)) by A3,TAYLOR_1:2
      .=2*x by PREPOWER:35;
    hence thesis by A6,A8,FDIFF_1:def 7;
  end;
A9: sin*(f^) is_differentiable_on Z by A1,Th5;
A10: Z c= dom (sin*(f^)) by A5,XBOOLE_1:18;
  then for y being object st y in Z holds y in dom (f^) by FUNCT_1:11;
  then
A11: Z c= dom (f^);
  now
    let x;
    assume
A12: x in Z;
    then
    ((g(#)(sin*(f^)))`|Z).x = ((sin*(f^)).x)*diff(g,x) + (g.x)*diff(sin*(
    f^),x) by A2,A9,A6,FDIFF_1:21
      .=((sin*(f^)).x)*(g`|Z).x+ (g.x)*diff(sin*(f^),x) by A6,A12,FDIFF_1:def 7
      .=((sin*(f^)).x)*(2*x)+(g.x)*diff(sin*(f^),x) by A7,A12
      .=((sin*(f^)).x)*(2*x)+(x #Z 2)*diff(sin*(f^),x) by A3,TAYLOR_1:def 1
      .=((sin*(f^)).x)*(2*x)+(x #Z 2)*(((sin*(f^))`|Z).x ) by A9,A12,
FDIFF_1:def 7
      .=((sin*(f^)).x)*(2*x)+(x #Z 2)*(-(1/x^2)*cos.(1/x)) by A1,A12,Th5
      .=((sin*(f^)).x)*(2*x)-(x #Z (1+1))*((1/x^2)*cos.(1/x))
      .=((sin*(f^)).x)*(2*x) -((x #Z 1)*(x #Z 1))*((1/x^2)*cos.(1/x)) by
TAYLOR_1:1
      .=((sin*(f^)).x)*(2*x) -(x*(x #Z 1))*((1/x^2)*cos.(1/x)) by PREPOWER:35
      .=((sin*(f^)).x)*(2*x) -(x*x)*(((1*1)/(x*x))*cos.(1/x)) by PREPOWER:35
      .=((sin*(f^)).x)*(2*x) -(x*x)*(((1/x)*(1/x))*cos.(1/x)) by XCMPLX_1:102
      .=((sin*(f^)).x)*(2*x) -(x*(1/x))*(x*(1/x))*cos.(1/x)
      .=((sin*(f^)).x)*(2*x) -(x*(1/x))*(1)*cos.(1/x) by A1,A12,XCMPLX_1:106
      .=((sin*(f^)).x)*(2*x) -(1)*(1)*cos.(1/x) by A1,A12,XCMPLX_1:106
      .=(sin.((f^).x))*(2*x) -cos.(1/x) by A10,A12,FUNCT_1:12
      .=(sin.((f.x)"))*(2*x) -cos.(1/x) by A11,A12,RFUNCT_1:def 2
      .=(sin.(1*x"))*(2*x) -cos.(1/x) by A12,FUNCT_1:18
      .=2*x*sin.(1/x)-cos.(1/x) by XCMPLX_0:def 9;
    hence ((g(#)(sin*(f^)))`|Z).x = 2*x*sin.(1/x)-cos.(1/x);
  end;
  hence thesis by A2,A9,A6,FDIFF_1:21;
end;
