 reserve a,x for Real;
 reserve n for Element of NAT;
 reserve A for non empty closed_interval Subset of REAL;
 reserve f,h,f1,f2 for PartFunc of REAL,REAL;
 reserve Z for open Subset of REAL;

theorem Th27:
Z c= dom (cot*ln) implies -cot*ln is_differentiable_on Z &
for x st x in Z holds ((-cot*ln)`|Z).x = 1/(x*(sin.(ln.x))^2)
proof
   assume
A1:Z c= dom (cot*ln);
then A2:Z c= dom (-cot*ln) by VALUED_1:8;
dom (cot*ln) c= dom ln by RELAT_1:25;
then A3:Z c= dom ln by A1;
A4: for x st x in Z holds x>0
  proof
    let x;
    assume x in Z;
    then x in right_open_halfline(0) by A3,TAYLOR_1:18;
    then ex g being Real st x=g & 0<g by Lm2;
    hence thesis;
  end;
A5: for x st x in Z holds sin.(ln.x)<>0
  proof
    let x;
    assume x in Z;
    then ln.x in dom (cos/sin) by A1,FUNCT_1:11;
    hence thesis by FDIFF_8:2;
  end;
A6:for x st x in Z holds diff(ln,x) = 1/x
  proof
    let x;
    assume x in Z;
    then x>0 by A4;
    then x in right_open_halfline(0) by Lm2;
    hence thesis by TAYLOR_1:18;
  end;
A7:cot*ln is_differentiable_on Z by A1,FDIFF_8:15;
then A8:(-1)(#)(cot*ln) is_differentiable_on Z by A2,FDIFF_1:20;
 for x st x in Z holds ((-cot*ln)`|Z).x = 1/(x*(sin.(ln.x))^2)
   proof
     let x;
     assume
A9:x in Z; then
A10:ln is_differentiable_in x by A4,TAYLOR_1:18;
A11:x>0 & sin.(ln.x)<>0 by A4,A5,A9;then
A12:cot is_differentiable_in ln.x by FDIFF_7:47;
A13:cot*ln is_differentiable_in x by A7,A9,FDIFF_1:9;
  ((-cot*ln)`|Z).x=diff(-cot*ln,x) by A8,A9,FDIFF_1:def 7
                 .=(-1)*(diff(cot*ln,x)) by A13,FDIFF_1:15
                 .=(-1)*(diff(cot,ln.x)*diff(ln,x)) by A10,A12,FDIFF_2:13
                 .=(-1)*((-1/(sin.(ln.x))^2) * diff(ln,x)) by A11,FDIFF_7:47
                 .=(-1)*(-diff(ln,x)/(sin.(ln.x))^2)
                 .=(-1)*(-(1/x)/(sin.(ln.x))^2) by A6,A9
                 .=1/(x*(sin.(ln.x))^2) by XCMPLX_1:78;
    hence thesis;
   end;
   hence thesis by A2,A7,FDIFF_1:20;
end;
