let Z be open Subset of REAL ; :: thesis: for f being PartFunc of REAL , REAL st Z c= dom ((f ^ ) (#) cot ) & ( for x being Real st x in Z holds
f . x = x ) holds
( (f ^ ) (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
(((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) ) )

let f be PartFunc of REAL , REAL ; :: thesis: ( Z c= dom ((f ^ ) (#) cot ) & ( for x being Real st x in Z holds
f . x = x ) implies ( (f ^ ) (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
(((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) ) ) )

assume that
A1: Z c= dom ((f ^ ) (#) cot ) and
A2: for x being Real st x in Z holds
f . x = x ; :: thesis: ( (f ^ ) (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
(((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) ) )

A3: Z c= (dom (f ^ )) /\ (dom cot ) by A1, VALUED_1:def 4;
then A4: Z c= dom (f ^ ) by XBOOLE_1:18;
A5: Z c= dom cot by A3, XBOOLE_1:18;
dom (f ^ ) c= dom f by RFUNCT_1:11;
then A6: Z c= dom f by A4, XBOOLE_1:1;
A7: for x being Real st x in Z holds
( f . x = x & f . x <> 0 ) by A2, A4, RFUNCT_1:13;
then A8: ( f ^ is_differentiable_on Z & ( for x being Real st x in Z holds
((f ^ ) `| Z) . x = - (1 / (x ^2 )) ) ) by A6, FDIFF_5:4;
A9: for x being Real st x in Z holds
( cot is_differentiable_in x & diff cot ,x = - (1 / ((sin . x) ^2 )) )
proof
let x be Real; :: thesis: ( x in Z implies ( cot is_differentiable_in x & diff cot ,x = - (1 / ((sin . x) ^2 )) ) )
assume x in Z ; :: thesis: ( cot is_differentiable_in x & diff cot ,x = - (1 / ((sin . x) ^2 )) )
then sin . x <> 0 by A5, Th2;
hence ( cot is_differentiable_in x & diff cot ,x = - (1 / ((sin . x) ^2 )) ) by FDIFF_7:47; :: thesis: verum
end;
then for x being Real st x in Z holds
cot is_differentiable_in x ;
then A10: cot is_differentiable_on Z by A5, FDIFF_1:16;
for x being Real st x in Z holds
(((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 ))
proof
let x be Real; :: thesis: ( x in Z implies (((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) )
assume A11: x in Z ; :: thesis: (((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 ))
then (((f ^ ) (#) cot ) `| Z) . x = ((cot . x) * (diff (f ^ ),x)) + (((f ^ ) . x) * (diff cot ,x)) by A1, A8, A10, FDIFF_1:29
.= ((cot . x) * (((f ^ ) `| Z) . x)) + (((f ^ ) . x) * (diff cot ,x)) by A8, A11, FDIFF_1:def 8
.= ((cot . x) * (- (1 / (x ^2 )))) + (((f ^ ) . x) * (diff cot ,x)) by A6, A7, A11, FDIFF_5:4
.= (- ((cot . x) * (1 / (x ^2 )))) + (((f ^ ) . x) * (- (1 / ((sin . x) ^2 )))) by A9, A11
.= (- (((cos . x) / (sin . x)) * (1 / (x ^2 )))) - (((f ^ ) . x) / ((sin . x) ^2 )) by A5, A11, RFUNCT_1:def 4
.= (- (((cos . x) / (sin . x)) / (x ^2 ))) - (((f . x) " ) / ((sin . x) ^2 )) by A4, A11, RFUNCT_1:def 8
.= (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) by A2, A11 ;
hence (((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) ; :: thesis: verum
end;
hence ( (f ^ ) (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
(((f ^ ) (#) cot ) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2 ))) - ((1 / x) / ((sin . x) ^2 )) ) ) by A1, A8, A10, FDIFF_1:29; :: thesis: verum