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

theorem
  Z c= dom -(ln*(f-exp_R)) & (for x st x in Z holds f.x=1 & (f-exp_R).x>
0) implies -(ln*(f-exp_R)) is_differentiable_on Z & for x st x in Z holds ( (-
  ln*(f-exp_R)) `|Z).x = exp_R.x/(1-exp_R.x)
proof
  assume that
A1: Z c= dom -(ln*(f-exp_R)) and
A2: for x st x in Z holds f.x=1 & (f-exp_R).x>0;
A3: for x st x in Z holds f.x=0*x+1 by A2;
A4: Z c= dom (ln*(f-exp_R)) by A1,VALUED_1:8;
  then for y being object st y in Z holds y in dom (f-exp_R) by FUNCT_1:11;
  then
A5: Z c= dom (f-exp_R) by TARSKI:def 3;
  then Z c= dom exp_R /\ dom f by VALUED_1:12;
  then
A6: Z c= dom f by XBOOLE_1:18;
  then
A7: f is_differentiable_on Z by A3,FDIFF_1:23;
A8: exp_R is_differentiable_on Z by FDIFF_1:26,TAYLOR_1:16;
  then
A9: f-exp_R is_differentiable_on Z by A5,A7,FDIFF_1:19;
  for x st x in Z holds ln*(f-exp_R) is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then f-exp_R is_differentiable_in x & (f-exp_R).x >0 by A2,A9,FDIFF_1:9;
    hence thesis by TAYLOR_1:20;
  end;
  then
A10: ln*(f-exp_R) is_differentiable_on Z by A4,FDIFF_1:9;
A11: for x st x in Z holds ((f-exp_R)`|Z).x =-exp_R.x
  proof
    let x;
    assume
A12: x in Z;
    hence ((f-exp_R)`|Z).x =diff(f,x)-diff(exp_R,x) by A5,A7,A8,FDIFF_1:19
      .= diff(f,x)-exp_R.x by SIN_COS:65
      .= (f`|Z).x-exp_R.x by A7,A12,FDIFF_1:def 7
      .=0-exp_R.x by A6,A3,A12,FDIFF_1:23
      .=-exp_R.x;
  end;
A13: for x st x in Z holds ( (-ln*(f-exp_R)) `|Z).x = exp_R.x/(1-exp_R.x)
  proof
    let x;
    assume
A14: x in Z;
    then
A15: (f-exp_R).x=f.x-exp_R.x by A5,VALUED_1:13
      .=1-exp_R.x by A2,A14;
A16: (f-exp_R) is_differentiable_in x & (f-exp_R).x >0 by A2,A9,A14,FDIFF_1:9;
    (((-1)(#)(ln*(f-exp_R)))`|Z).x =(-1)*diff((ln*(f-exp_R)),x) by A1,A10,A14,
FDIFF_1:20
      .=(-1)*(diff((f-exp_R),x)/((f-exp_R).x)) by A16,TAYLOR_1:20
      .=(-1)*(((f-exp_R)`|Z).x/(f-exp_R).x) by A9,A14,FDIFF_1:def 7
      .=(-1)*((-exp_R.x)/(1-exp_R.x)) by A11,A14,A15
      .=((-1)*(-exp_R.x))/(1-exp_R.x) by XCMPLX_1:74
      .=exp_R.x/(1-exp_R.x);
    hence thesis;
  end;
  Z c= dom ((-1)(#)(ln*(f-exp_R))) by A1;
  hence thesis by A10,A13,FDIFF_1:20;
end;
