reserve x for Real,

  Z for open Subset of REAL;

theorem
  cos*cos is_differentiable_on Z & for x st x in Z holds((cos*cos)`|Z).x
  = sin.(cos.x)*sin.x
proof
A1: for x st x in Z holds cos*cos is_differentiable_in x
  proof
    let x;
    assume x in Z;
A2: cos is_differentiable_in cos.x by SIN_COS:63;
    cos is_differentiable_in x by SIN_COS:63;
    hence thesis by A2,FDIFF_2:13;
  end;
  rng cos c= REAL;
  then
A3: dom (cos*cos) = REAL by RELAT_1:27,SIN_COS:24;
  then
A4: cos*cos is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds((cos*cos)`|Z).x = sin.(cos.x)*sin.x
  proof
    let x;
    assume
A5: x in Z;
A6: cos is_differentiable_in cos.x by SIN_COS:63;
    cos is_differentiable_in x by SIN_COS:63;
    then diff(cos*cos,x) =diff(cos,cos.x)*diff(cos,x) by A6,FDIFF_2:13
      .=(-sin.(cos.x))*diff(cos,x) by SIN_COS:63
      .=(-sin.(cos.x))*(-sin.x) by SIN_COS:63;
    hence thesis by A4,A5,FDIFF_1:def 7;
  end;
  hence thesis by A3,A1,FDIFF_1:9;
end;
