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