 reserve a,x for Real;
 reserve n for Element of NAT;
 reserve A for non empty closed_interval Subset of REAL;
 reserve f,h,f1,f2 for PartFunc of REAL,REAL;
 reserve Z for open Subset of REAL;

theorem
 A c= Z & f=-cos/sin/f1-(id Z)^/sin^2 & f1=#Z 2
 & Z c= dom ((id Z)^(#)cot) & Z = dom f & f|A is continuous
 implies
 integral(f,A)=((id Z)^(#)cot).(upper_bound A)-((id Z)^(#)cot).(lower_bound A)
proof
  assume
A1:A c= Z & f=-cos/sin/f1-(id Z)^/sin^2 & f1=#Z 2
     & Z c= dom ((id Z)^(#)cot) & Z = dom f & f|A is continuous;then
A2:f is_integrable_on A & f|A is bounded by INTEGRA5:10,11;
   set g = id Z;
Z c= dom (g^(#)cot) by A1;
    then Z c= dom (g^) /\ dom cot by VALUED_1:def 4;then
A3:Z c= dom (g^) by XBOOLE_1:18;
A4:not 0 in Z
   proof
     assume A5: 0 in Z;
     dom ((id Z)^) = dom id Z \ (id Z)"{0} by RFUNCT_1:def 2
                  .= dom id Z \ {0} by Lm1,A5; then
     not 0 in {0} by A5,A3,XBOOLE_0:def 5;
     hence thesis by TARSKI:def 1;
   end;then
A6:(id Z)^(#)cot is_differentiable_on Z by A1,FDIFF_8:35;
    dom f = dom (-cos/sin/f1) /\ dom ((id Z)^/sin^2) by A1,VALUED_1:12;then
A7:dom f c= dom (-cos/sin/f1) & dom f c= dom ((id Z)^/sin^2) by XBOOLE_1:18;
then dom f c= dom (cos/sin/f1) by VALUED_1:8;
then A8:Z c= dom (cos/sin/f1) & Z c= dom ((id Z)^/sin^2) by A1,A7;
   dom (cos/sin/f1) = dom (cos/sin) /\ (dom f1 \ f1"{0}) by RFUNCT_1:def 1;then
A9:Z c= dom (cos/sin) by A8,XBOOLE_1:18;
   dom ((id Z)^/sin^2) c= dom ((id Z)^) /\ (dom (sin^2) \ (sin^2)"{0})
   by RFUNCT_1:def 1;then
   dom ((id Z)^/sin^2) c= dom ((id Z)^)
   & dom ((id Z)^/sin^2) c= dom (sin^2) \ (sin^2)"{0} by XBOOLE_1:18;then
A10:Z c= dom ((id Z)^) & Z c= dom (sin^2) \ (sin^2)"{0} by A8;
A11:for x st x in Z holds f.x=-cos.x/sin.x/x^2-1/x/(sin.x)^2
     proof
      let x;
      assume
A12:x in Z;then
     (-cos/sin/f1 - (id Z)^/sin^2).x
     =(-cos/sin/f1).x-((id Z)^/sin^2).x by A1,VALUED_1:13
    .=-(cos/sin/f1).x-((id Z)^/sin^2).x by VALUED_1:8
    .=-((cos/sin).x/f1.x)-((id Z)^/sin^2).x by A12,A8,RFUNCT_1:def 1
    .=-cos.x/sin.x/f1.x-((id Z)^/sin^2).x by A9,A12,RFUNCT_1:def 1
    .=-cos.x/sin.x/f1.x-((id Z)^).x/(sin^2).x by A8,A12,RFUNCT_1:def 1
    .=-cos.x/sin.x/f1.x-(((id Z).x)")/(sin^2).x by A10,A12,RFUNCT_1:def 2
    .=-cos.x/sin.x/f1.x-1/x/(sin^2).x by A12,FUNCT_1:18
    .=-cos.x/sin.x/f1.x-1/x/(sin.x)^2 by VALUED_1:11
    .=-cos.x/sin.x/(x #Z 2)-1/x/(sin.x)^2 by A1,TAYLOR_1:def 1
    .=-cos.x/sin.x/x^2-1/x/(sin.x)^2 by FDIFF_7:1;
    hence thesis by A1;
     end;
A13:for x being Element of REAL
    st x in dom(((id Z)^(#)cot)`|Z) holds (((id Z)^(#)cot)`|Z).x=f.x
   proof
   let x be Element of REAL;
   assume x in dom(((id Z)^(#)cot)`|Z);then
A14:x in Z by A6,FDIFF_1:def 7;then
  (((id Z)^(#)cot)`|Z).x=-cos.x/sin.x/x^2-1/x/(sin.x)^2 by A1,A4,FDIFF_8:35
  .=f.x by A11,A14;
  hence thesis;
  end;
  dom(((id Z)^(#)cot)`|Z)=dom f by A1,A6,FDIFF_1:def 7;
  then(((id Z)^(#)cot)`|Z)= f by A13,PARTFUN1:5;
  hence thesis by A1,A2,A6,INTEGRA5:13;
end;
