 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 & f1=g-f2 & f2=#Z 2 & (for x st x in Z holds f.x=x*(1-x #Z 2) #R (-1/2)
& g.x=1 & f1.x >0) & Z c= dom (( #R (1/2))*f1)
& Z = dom f & f|A is continuous implies
integral(f,A)=(-( #R (1/2))*f1).(upper_bound A)
             -(-( #R (1/2))*f1).(lower_bound A)
proof
   assume
A1:A c= Z & f1=g-f2 & f2=#Z 2
  & (for x st x in Z holds f.x=x*(1-x #Z 2) #R (-1/2)
  & g.x=1 & f1.x >0) & Z c= dom (( #R (1/2))*f1)
  & Z = dom f & f|A is continuous;then
A2:f is_integrable_on A & f|A is bounded by INTEGRA5:10,11;
A3:for x st x in Z holds g.x=1 & f1.x >0 by A1;
A4:Z c= dom (-( #R (1/2))*f1) by A1,VALUED_1:8;
for y being object st y in Z holds y in dom f1 by A1,FUNCT_1:11;
then A5:Z c= dom ((g+(-1)(#)f2)) by A1;
A6:(( #R (1/2))*f1) is_differentiable_on Z by A1,A3,FDIFF_7:22;
then A7:(-1)(#)(( #R (1/2))*f1) is_differentiable_on Z by A4,FDIFF_1:20;
A8:f2=#Z 2 & for x st x in Z holds g.x=1+0*x by A1;
then A9:f1 is_differentiable_on Z &
  for x st x in Z holds (f1`|Z).x =0+2*(-1)*x by A1,A5,FDIFF_4:12;
A10:for x st x in Z holds ((-( #R (1/2))*f1)`|Z).x =x*(1-x #Z 2) #R (-1/2)
   proof
     let x;
     assume
A11:x in Z;then
A12:x in dom (g-f2) by A1,FUNCT_1:11;
A13:f1 is_differentiable_in x by A9,A11,FDIFF_1:9;
A14:(g-f2).x=g.x - f2.x by A12,VALUED_1:13
      .=1 -(f2.x) by A1,A11
      .=1 -(x #Z 2) by A1,TAYLOR_1:def 1; then
A15:f1.x = 1-x #Z 2 & f1.x >0 by A1,A11;
A16:( #R (1/2))*f1 is_differentiable_in x by A6,A11,FDIFF_1:9;
 ((-( #R (1/2))*f1)`|Z).x=diff((-( #R (1/2))*f1),x) by A7,A11,FDIFF_1:def 7
                       .=(-1)*diff((( #R (1/2))*f1),x) by A16,FDIFF_1:15
                       .=(-1)*((1/2)*((f1.x) #R (1/2-1)) * diff(f1,x))
   by A13,A15,TAYLOR_1:22
      .=(-1)*((1/2)*((f1.x) #R (1/2-1))*(f1`|Z).x) by A9,A11,FDIFF_1:def 7
      .=(-1)*((1/2)*((f1.x) #R (1/2-1))*(0+2*(-1)*x))
        by A1,A5,A8,A11,FDIFF_4:12
      .=x*(1-x #Z 2) #R (-1/2) by A1,A14;
     hence thesis;
   end;
A17:for x being Element of REAL
    st x in dom ((-( #R (1/2))*f1)`|Z) holds ((-( #R (1/2))*f1)`|Z).x=f.x
   proof
   let x be Element of REAL;
   assume x in dom ((-( #R (1/2))*f1)`|Z);then
A18:x in Z by A7,FDIFF_1:def 7; then
   ((-( #R (1/2))*f1)`|Z).x=x*(1-x #Z 2) #R (-1/2) by A10
   .=f.x by A1,A18;
   hence thesis;
   end;
  dom((-( #R (1/2))*f1)`|Z)=dom f by A1,A7,FDIFF_1:def 7;
  then((-( #R (1/2))*f1)`|Z) = f by A17,PARTFUN1:5;
   hence thesis by A1,A2,A7,INTEGRA5:13;
end;
