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