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
  A c= Z implies integral((-id Z)(#)sin,A) = (-sin+(id Z)(#)cos).(
  upper_bound A)-(-sin+(id Z)(#)cos).(lower_bound A)
proof
  assume
A1: A c= Z;
A2: -sin+(id Z)(#)cos is_differentiable_on Z by Th11;
A3: for x st x in Z holds (-id Z).x =(-1)*x +0
  proof
    let x;
    assume
A4: x in Z;
    (-id Z).x = -(id Z.x) by VALUED_1:8
      .=-x by A4,FUNCT_1:18
      .=(-1)*x +0;
    hence thesis;
  end;
A5: for x st x in Z holds ((-id Z)(#)sin).x = -x*sin.x
  proof
    let x;
    assume
A6: x in Z;
    ((-id Z)(#)sin).x = ((-id Z).x)*(sin.x) by VALUED_1:5
      .= ((-1)*x+0)*(sin.x) by A3,A6
      .= -x*sin.x;
    hence thesis;
  end;
A7: for x being Element of REAL
  st x in dom ((-sin+(id Z)(#)cos)`|Z) holds ((-sin+(id Z)(#)cos)`|
  Z).x = ((-id Z)(#)sin).x
  proof
    let x be Element of REAL;
    assume x in dom ((-sin+(id Z)(#)cos)`|Z);
    then
A8: x in Z by A2,FDIFF_1:def 7;
    then ((-sin+(id Z)(#)cos)`|Z).x =-x*sin.x by Th11
      .= ((-id Z)(#)sin).x by A5,A8;
    hence thesis;
  end;
  dom ((-id Z)(#)sin) = dom (-id Z) /\ REAL by SIN_COS:24,VALUED_1:def 4
    .= dom (-id Z) by XBOOLE_1:28
    .= dom (id Z) by VALUED_1:8;
  then
A9: Z = dom ((-id Z)(#)sin) by RELAT_1:45;
  then dom ((-sin+(id Z)(#)cos)`|Z) = dom ((-id Z)(#)sin) by A2,FDIFF_1:def 7;
  then
A10: ((-sin+(id Z)(#)cos)`|Z) = (-id Z)(#)sin by A7,PARTFUN1:5;
  ((-id Z)(#)sin)|A is continuous;
  then
A11: (-id Z)(#)sin is_integrable_on A by A1,A9,INTEGRA5:11;
  ((-id Z)(#)sin)|A is bounded by A1,A9,INTEGRA5:10;
  hence thesis by A1,A11,A10,Th11,INTEGRA5:13;
end;
