 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 c= dom (ln*(f1+f2))
& r <> 0 & (for x st x in Z holds g.x=x/r & g.x > -1 & g.x < 1 & f1.x=1)
& f2=( #Z 2)*g & Z = dom f & f=arccot*g implies
integral(f,A)=((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2))).(upper_bound A)
             -((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2))).(lower_bound A)
proof
  assume
A1:A c= Z & Z c= dom (ln*(f1+f2))
  & r <> 0 & (for x st x in Z holds g.x=x/r & g.x > -1 & g.x < 1 & f1.x=1)
  & f2=( #Z 2)*g & Z = dom f & f=(arccot)*g;
Z c= dom id Z /\ dom f by A1;
then A2:Z c= dom ((id Z)(#)((arccot)*g)) by A1,VALUED_1:def 4;
Z c= dom ((r/2)(#)(ln*(f1+f2))) by A1,VALUED_1:def 5;
then Z c= dom ((id Z)(#)((arccot)*g)) /\ dom ((r/2)(#)(ln*(f1+f2)))
   by A2,XBOOLE_1:19;
then
A3:Z c= dom ((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2))) by VALUED_1:def 1;
A4:for x st x in Z holds g.x=x/r & g.x > -1 & g.x < 1 by A1;
     for x st x in Z holds g.x=(1/r)*x+0
     proof
       let x;
       assume x in Z;
       then g.x=x/r by A1;
       hence thesis;
     end;
     then
 for x st x in Z holds g.x=(1/r)*x+0 & g.x > -1 & g.x < 1 by A1;
then f is_differentiable_on Z by A1,SIN_COS9:88;
    then f|Z is continuous by FDIFF_1:25;then
f|A is continuous by A1,FCONT_1:16;
then A5:f is_integrable_on A & f|A is bounded by A1,INTEGRA5:10,11;
A6:(for x st x in Z holds f1.x=1)
    & (for x st x in Z holds g.x=x/r) by A1; then
A7:(id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)) is_differentiable_on Z
   by A1,A3,A4,SIN_COS9:110;
A8:for x st x in Z holds f.x=arccot.(x/r)
   proof
   let x;
   assume
A9:x in Z;
  then (arccot*g).x=arccot.(g.x) by A1,FUNCT_1:12
             .=arccot.(x/r) by A1,A9;
   hence thesis by A1;
   end;
A10:for x being Element of REAL
   st x in dom(((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)))`|Z) holds
 (((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)))`|Z).x=f.x
  proof
   let x be Element of REAL;
   assume x in dom(((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)))`|Z); then
A11:x in Z by A7,FDIFF_1:def 7;then
 (((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)))`|Z).x=arccot.(x/r)
 by A1,A3,A4,A6,SIN_COS9:110
                                                .=f.x by A8,A11;
   hence thesis;
   end;
dom(((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)))`|Z)=dom f
   by A1,A7,FDIFF_1:def 7;
then (((id Z)(#)((arccot)*g)+(r/2)(#)(ln*(f1+f2)))`|Z) = f by A10,PARTFUN1:5;
   hence thesis by A1,A5,A7,INTEGRA5:13;
end;
