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