reserve r,p,x for Real;
reserve n for Element of NAT;
reserve A for non empty closed_interval Subset of REAL;
reserve Z for open Subset of REAL;

theorem Th11:
  -sin+(id Z)(#)cos is_differentiable_on Z & for x st x in Z holds
  ((-sin+(id Z)(#)cos)`|Z).x =-x*sin.x
proof
  dom (-sin+(id Z)(#)cos) = dom (-sin) /\ dom((id Z)(#)cos) by VALUED_1:def 1
    .= REAL /\ dom((id Z)(#)cos) by SIN_COS:24,VALUED_1:8
    .= dom((id Z)(#)cos) by XBOOLE_1:28
    .= dom (id Z) /\ REAL by SIN_COS:24,VALUED_1:def 4
    .= dom (id Z) by XBOOLE_1:28;
  then
A1: Z = dom (-sin+(id Z)(#)cos) by RELAT_1:45;
A2: (id Z)(#)cos is_differentiable_on Z by Th10;
A3: -sin is_differentiable_on Z by FDIFF_1:26,INTEGRA8:24;
  now
    let x;
    assume
A4: x in Z;
    hence
    ((-sin+(id Z)(#)cos)`|Z).x = diff(-sin,x)+diff((id Z)(#)cos,x) by A1,A2,A3,
FDIFF_1:18
      .=(((id Z)(#)cos)`|Z).x + diff(-sin,x) by A2,A4,FDIFF_1:def 7
      .=cos.x- x*sin.x+ diff(-sin,x) by A4,Th10
      .=cos.x- x*sin.x +(-cos.x) by Lm2
      .=-x*sin.x;
  end;
  hence thesis by A1,A2,A3,FDIFF_1:18;
end;
