 reserve a,b,x,r for Real;
 reserve y for set;
 reserve n for Element of NAT;
 reserve A for non empty closed_interval Subset of REAL;
 reserve f,g,f1,f2,g1,g2 for PartFunc of REAL,REAL;
 reserve Z for open Subset of REAL;

theorem
 A c= Z & Z = dom f & f=exp_R(#)(cos/sin)-exp_R/sin^2 implies
 integral(f,A)=(exp_R(#)cot).(upper_bound A)-(exp_R(#)cot).(lower_bound A)
proof
   assume
A1:A c= Z & Z = dom f & f=exp_R(#)(cos/sin)-exp_R/sin^2;
then Z = dom (exp_R(#)(cos/sin)) /\ dom (exp_R/sin^2) by VALUED_1:12;
then
A2:Z c= dom (exp_R(#)(cos/sin)) & Z c= dom (exp_R/sin^2) by XBOOLE_1:18;
A3:dom (exp_R(#)(cos/sin)) c= dom exp_R /\ dom (cos/sin) by VALUED_1:def 4;
dom (exp_R/sin^2) c= dom exp_R /\ (dom sin^2 \ (sin^2)"{0})
   by RFUNCT_1:def 1;
   then dom (exp_R(#)(cos/sin)) c= dom exp_R &
   dom (exp_R(#)(cos/sin)) c= dom (cos/sin) &
   dom (exp_R/sin^2) c= dom sin^2 \ (sin^2)"{0} by A3,XBOOLE_1:18; then
A4:Z c= dom exp_R & Z c= dom (cos/sin) & Z c= dom sin^2 \ (sin^2)"{0}
   by A2;
A5:exp_R is_differentiable_on Z by FDIFF_1:26,TAYLOR_1:16;
for x st x in Z holds cos/sin is_differentiable_in x
    proof
    let x;
    assume x in Z;then
    sin.x<>0 by A4,FDIFF_8:2;
    hence thesis by FDIFF_7:47;
    end;
then cos/sin is_differentiable_on Z by A4,FDIFF_1:9;
then A6:exp_R(#)(cos/sin) is_differentiable_on Z by A2,A5,FDIFF_1:21;
sin is_differentiable_on Z by FDIFF_1:26,SIN_COS:68;
then A7:sin^2 is_differentiable_on Z by FDIFF_2:20;
x in Z implies (sin^2).x<>0
    proof
    assume x in Z;then
    x in dom (exp_R/sin^2) by A2;
    then x in dom exp_R /\ (dom sin^2 \ (sin^2)"{0}) by RFUNCT_1:def 1;
    then x in dom sin^2 \ (sin^2)"{0} by XBOOLE_0:def 4;
    then x in dom ((sin^2)^) by RFUNCT_1:def 2;
      hence thesis by RFUNCT_1:3;
    end;
then exp_R/sin^2 is_differentiable_on Z by A5,A7,FDIFF_2:21;
    then f|Z is continuous by A1,A6,FDIFF_1:19,25;then
f|A is continuous by A1,FCONT_1:16;
then A8:f is_integrable_on A & f|A is bounded by A1,INTEGRA5:10,11;
A9:(exp_R(#)cot) is_differentiable_on Z by A2,FDIFF_8:31;
A10:for x st x in Z holds f.x=exp_R.x*cos.x/sin.x-exp_R.x/(sin.x)^2
   proof
   let x;
   assume
A11:x in Z;
  then (exp_R(#)(cos/sin)-exp_R/sin^2).x
  =((exp_R(#)(cos/sin)).x)-(exp_R/sin^2).x by A1,VALUED_1:13
 .=((exp_R.x)*((cos/sin).x))-(exp_R/sin^2).x by VALUED_1:5
 .=((exp_R.x)*(cos.x*(sin.x)"))-(exp_R/sin^2).x
   by A4,A11,RFUNCT_1:def 1
 .=exp_R.x*cos.x/sin.x-exp_R.x/(sin^2).x by A2,A11,RFUNCT_1:def 1
 .=exp_R.x*cos.x/sin.x-exp_R.x/(sin.x)^2 by VALUED_1:11;
     hence thesis by A1;
   end;
A12:for x being Element of REAL
    st x in dom((exp_R(#)cot)`|Z) holds ((exp_R(#)cot)`|Z).x=f.x
   proof
     let x be Element of REAL;
     assume x in dom((exp_R(#)cot)`|Z);then
A13: x in Z by A9,FDIFF_1:def 7; then
 ((exp_R(#)cot)`|Z).x=exp_R.x*cos.x/sin.x-exp_R.x/(sin.x)^2 by A2,FDIFF_8:31
  .=f.x by A13,A10;
   hence thesis;
   end;
  dom((exp_R(#)cot)`|Z)=dom f by A1,A9,FDIFF_1:def 7;
  then ((exp_R(#)cot)`|Z)= f by A12,PARTFUN1:5;
  hence thesis by A1,A8,A2,FDIFF_8:31,INTEGRA5:13;
end;
