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

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

A3: (id Z) ^ is_differentiable_on Z by A1, FDIFF_5:4;
A4: Z c= (dom ((id Z) ^)) /\ (dom cot) by A2, VALUED_1:def 4;
then A5: Z c= dom cot by XBOOLE_1:18;
A6: 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 A7: cot is_differentiable_on Z by A5, FDIFF_1:9;
A8: Z c= dom ((id Z) ^) by A4, XBOOLE_1:18;
for x being Real st x in Z holds
((((id Z) ^) (#) cot) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2))) - ((1 / x) / ((sin . x) ^2))
proof
let x be Real; :: thesis: ( x in Z implies ((((id Z) ^) (#) cot) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2))) - ((1 / x) / ((sin . x) ^2)) )
assume A9: x in Z ; :: thesis: ((((id Z) ^) (#) cot) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2))) - ((1 / x) / ((sin . x) ^2))
then ((((id Z) ^) (#) cot) `| Z) . x = ((cot . x) * (diff (((id Z) ^),x))) + ((((id Z) ^) . x) * (diff (cot,x))) by A2, A3, A7, FDIFF_1:21
.= ((cot . x) * ((((id Z) ^) `| Z) . x)) + ((((id Z) ^) . x) * (diff (cot,x))) by A3, A9, FDIFF_1:def 7
.= ((cot . x) * (- (1 / (x ^2)))) + ((((id Z) ^) . x) * (diff (cot,x))) by A1, A9, FDIFF_5:4
.= (- ((cot . x) * (1 / (x ^2)))) + ((((id Z) ^) . x) * (- (1 / ((sin . x) ^2)))) by A6, A9
.= (- (((cos . x) / (sin . x)) * (1 / (x ^2)))) - ((((id Z) ^) . x) / ((sin . x) ^2)) by A5, A9, RFUNCT_1:def 1
.= (- (((cos . x) / (sin . x)) / (x ^2))) - ((((id Z) . x) ") / ((sin . x) ^2)) by A8, A9, RFUNCT_1:def 2
.= (- (((cos . x) / (sin . x)) / (x ^2))) - ((1 / x) / ((sin . x) ^2)) by A9, FUNCT_1:18 ;
hence ((((id Z) ^) (#) cot) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2))) - ((1 / x) / ((sin . x) ^2)) ; :: thesis: verum
end;
hence ( ((id Z) ^) (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
((((id Z) ^) (#) cot) `| Z) . x = (- (((cos . x) / (sin . x)) / (x ^2))) - ((1 / x) / ((sin . x) ^2)) ) ) by A2, A3, A7, FDIFF_1:21; :: thesis: verum