reserve y for set;
reserve x,a,b,c for Real;
reserve n for Element of NAT;
reserve Z for open Subset of REAL;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem
  Z c= dom (ln*sin) & (for x st x in Z holds sin.x >0) implies ln*sin
  is_differentiable_on Z & for x st x in Z holds ((ln*sin)`|Z).x = cot(x)
proof
  assume that
A1: Z c= dom (ln*sin) and
A2: for x st x in Z holds sin.x >0;
A3: sin is_differentiable_on Z by FDIFF_1:26,SIN_COS:68;
A4: for x st x in Z holds ln*sin is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then sin is_differentiable_in x & sin.x >0 by A2,A3,FDIFF_1:9;
    hence thesis by TAYLOR_1:20;
  end;
  then
A5: ln*sin is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((ln*sin)`|Z).x =cot(x)
  proof
    let x;
    assume
A6: x in Z;
    then sin is_differentiable_in x & sin.x >0 by A2,A3,FDIFF_1:9;
    then diff(ln*sin,x) =diff(sin,x)/(sin.x) by TAYLOR_1:20
      .=cos.x/sin.x by SIN_COS:64
      .=cos(x)/sin.x by SIN_COS:def 19
      .=cos(x)/sin(x) by SIN_COS:def 17
      .=cot(x) by SIN_COS4:def 2;
    hence thesis by A5,A6,FDIFF_1:def 7;
  end;
  hence thesis by A1,A4,FDIFF_1:9;
end;
