reserve x,a,b,c for Real,
  n for Nat,
  Z for open Subset of REAL,
  f, f1,f2 for PartFunc of REAL,REAL;

theorem
  Z c= dom (sec*ln) implies sec*ln is_differentiable_on Z & for x st x
  in Z holds ((sec*ln)`|Z).x = sin.(ln.x)/(x*(cos.(ln.x))^2)
proof
  assume
A1: Z c= dom (sec*ln);
  dom (sec*ln) c= dom ln by RELAT_1:25;
  then
A2: Z c= dom ln by A1,XBOOLE_1:1;
A3: for x st x in Z holds x>0
  proof
    let x;
    assume x in Z;
    then x in right_open_halfline(0) by A2,TAYLOR_1:18;
    then ex g being Real st x=g & 0<g by Lm1;
    hence thesis;
  end;
A4: for x st x in Z holds diff(ln,x) = 1/x
  proof
    let x;
    assume x in Z;
    then x>0 by A3;
    then x in right_open_halfline(0) by Lm1;
    hence thesis by TAYLOR_1:18;
  end;
A5: for x st x in Z holds cos.(ln.x)<>0
  proof
    let x;
    assume x in Z;
    then ln.x in dom sec by A1,FUNCT_1:11;
    hence thesis by RFUNCT_1:3;
  end;
A6: for x st x in Z holds sec*ln is_differentiable_in x
  proof
    let x;
    assume
A7: x in Z;
    then cos.(ln.x)<>0 by A5;
    then
A8: sec is_differentiable_in ln.x by Th1;
    ln is_differentiable_in x by A3,A7,TAYLOR_1:18;
    hence thesis by A8,FDIFF_2:13;
  end;
  then
A9: sec*ln is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((sec*ln)`|Z).x = sin.(ln.x)/(x*(cos.(ln.x))^2)
  proof
    let x;
    assume
A10: x in Z;
    then
A11: ln is_differentiable_in x by A3,TAYLOR_1:18;
A12: cos.(ln.x)<>0 by A5,A10;
    then sec is_differentiable_in ln.x by Th1;
    then diff(sec*ln,x) = diff(sec,ln.x)*diff(ln,x) by A11,FDIFF_2:13
      .=(sin.(ln.x)/(cos.(ln.x))^2) * diff(ln,x) by A12,Th1
      .=(1/x)*(sin.(ln.x)/(cos.(ln.x))^2) by A4,A10
      .=(1*sin.(ln.x))/(x*(cos.(ln.x))^2) by XCMPLX_1:76;
    hence thesis by A9,A10,FDIFF_1:def 7;
  end;
  hence thesis by A1,A6,FDIFF_1:9;
end;
