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 ((id Z)(#)sin+cos) implies (id Z)(#)sin+cos
is_differentiable_on Z & for x st x in Z holds (((id Z)(#)sin+cos)`|Z).x =x*cos
  .x
proof
  assume
A1: Z c= dom ((id Z)(#)sin+cos);
  then Z c= dom ((id Z)(#)sin) /\ dom cos by VALUED_1:def 1;
  then
A2: Z c= dom ((id Z)(#)sin) by XBOOLE_1:18;
  then
A3: (id Z)(#)sin is_differentiable_on Z by Th45;
A4: cos is_differentiable_on Z by FDIFF_1:26,SIN_COS:67;
  now
    let x;
    assume
A5: x in Z;
    hence
    (((id Z)(#)sin+cos)`|Z).x = diff((id Z)(#)sin,x) + diff(cos,x) by A1,A3,A4,
FDIFF_1:18
      .=(((id Z)(#)sin)`|Z).x + diff(cos,x) by A3,A5,FDIFF_1:def 7
      .=sin.x+ x*cos.x+ diff(cos,x) by A2,A5,Th45
      .=sin.x+ x*cos.x+(-sin.x) by SIN_COS:63
      .=x*cos.x;
  end;
  hence thesis by A1,A3,A4,FDIFF_1:18;
end;
