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

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 = (a * x) + b ) holds
( f (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
((f (#) cot) `| Z) . x = ((a * (cos . x)) / (sin . x)) - (((a * x) + b) / ((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 = (a * x) + b ) implies ( f (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
((f (#) cot) `| Z) . x = ((a * (cos . x)) / (sin . x)) - (((a * x) + b) / ((sin . x) ^2)) ) ) )

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

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