let a be Real; :: thesis: for A being non empty closed_interval Subset of REAL
for f, g, f1, f2 being PartFunc of REAL,REAL
for Z being open Subset of REAL st A c= Z & g = f1 - f2 & f2 = #Z 2 & ( for x being Real st x in Z holds
( f . x = x * (((a ^2) - (x #Z 2)) #R (- (1 / 2))) & f1 . x = a ^2 & g . x > 0 ) ) & Z c= dom ((#R (1 / 2)) * g) & Z = dom f & f | A is continuous holds
integral (f,A) = ((- ((#R (1 / 2)) * g)) . (upper_bound A)) - ((- ((#R (1 / 2)) * g)) . (lower_bound A))

let A be non empty closed_interval Subset of REAL; :: thesis: for f, g, f1, f2 being PartFunc of REAL,REAL
for Z being open Subset of REAL st A c= Z & g = f1 - f2 & f2 = #Z 2 & ( for x being Real st x in Z holds
( f . x = x * (((a ^2) - (x #Z 2)) #R (- (1 / 2))) & f1 . x = a ^2 & g . x > 0 ) ) & Z c= dom ((#R (1 / 2)) * g) & Z = dom f & f | A is continuous holds
integral (f,A) = ((- ((#R (1 / 2)) * g)) . (upper_bound A)) - ((- ((#R (1 / 2)) * g)) . (lower_bound A))

let f, g, f1, f2 be PartFunc of REAL,REAL; :: thesis: for Z being open Subset of REAL st A c= Z & g = f1 - f2 & f2 = #Z 2 & ( for x being Real st x in Z holds
( f . x = x * (((a ^2) - (x #Z 2)) #R (- (1 / 2))) & f1 . x = a ^2 & g . x > 0 ) ) & Z c= dom ((#R (1 / 2)) * g) & Z = dom f & f | A is continuous holds
integral (f,A) = ((- ((#R (1 / 2)) * g)) . (upper_bound A)) - ((- ((#R (1 / 2)) * g)) . (lower_bound A))

let Z be open Subset of REAL; :: thesis: ( A c= Z & g = f1 - f2 & f2 = #Z 2 & ( for x being Real st x in Z holds
( f . x = x * (((a ^2) - (x #Z 2)) #R (- (1 / 2))) & f1 . x = a ^2 & g . x > 0 ) ) & Z c= dom ((#R (1 / 2)) * g) & Z = dom f & f | A is continuous implies integral (f,A) = ((- ((#R (1 / 2)) * g)) . (upper_bound A)) - ((- ((#R (1 / 2)) * g)) . (lower_bound A)) )

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