let Z be open Subset of REAL ; :: thesis: ( Z c= dom (cos (#) (sin + cos )) implies ( cos (#) (sin + cos ) is_differentiable_on Z & ( for x being Real st x in Z holds
((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 ) ) ) )

assume A1: Z c= dom (cos (#) (sin + cos )) ; :: thesis: ( cos (#) (sin + cos ) is_differentiable_on Z & ( for x being Real st x in Z holds
((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 ) ) )

then A2: Z c= (dom (sin + cos )) /\ (dom cos ) by VALUED_1:def 4;
then A3: Z c= dom cos by XBOOLE_1:18;
A4: Z c= dom (sin + cos ) by A2, XBOOLE_1:18;
then A5: ( sin + cos is_differentiable_on Z & ( for x being Real st x in Z holds
((sin + cos ) `| Z) . x = (cos . x) - (sin . x) ) ) by FDIFF_7:38;
for x being Real st x in Z holds
cos is_differentiable_in x by SIN_COS:68;
then A6: cos is_differentiable_on Z by A3, FDIFF_1:16;
for x being Real st x in Z holds
((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 )
proof
let x be Real; :: thesis: ( x in Z implies ((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 ) )
assume A7: x in Z ; :: thesis: ((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 )
then ((cos (#) (sin + cos )) `| Z) . x = (((sin + cos ) . x) * (diff cos ,x)) + ((cos . x) * (diff (sin + cos ),x)) by A1, A5, A6, FDIFF_1:29
.= (((sin . x) + (cos . x)) * (diff cos ,x)) + ((cos . x) * (diff (sin + cos ),x)) by VALUED_1:1
.= (((sin . x) + (cos . x)) * (- (sin . x))) + ((cos . x) * (diff (sin + cos ),x)) by SIN_COS:68
.= (((sin . x) + (cos . x)) * (- (sin . x))) + ((cos . x) * (((sin + cos ) `| Z) . x)) by A5, A7, FDIFF_1:def 8
.= (((sin . x) + (cos . x)) * (- (sin . x))) + ((cos . x) * ((cos . x) - (sin . x))) by A4, A7, FDIFF_7:38 ;
hence ((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 ) ; :: thesis: verum
end;
hence ( cos (#) (sin + cos ) is_differentiable_on Z & ( for x being Real st x in Z holds
((cos (#) (sin + cos )) `| Z) . x = (((cos . x) ^2 ) - ((2 * (sin . x)) * (cos . x))) - ((sin . x) ^2 ) ) ) by A1, A5, A6, FDIFF_1:29; :: thesis: verum